I am working on the Addon Manager module, so i made an api request to the addon index https://addons.openmrs.org/, to retrieve list of developers/maintainers of all module. It was successful but the problem is that not all modules are listed in the addon index and so the modules not listed return a 404 error in the browser console as shown below.
I have looked at https://github.com/openmrs/openmrs-contrib-addonindex the addonindex repository, so i can return null if the module dose not exist. But i can’t seem to find a way around it
cc @dkayiwa @suthagar23 @ivange94 @judeniroshan
I agree you should address this, but I’m surprised to see all those modules
not in the add-on index. Maybe we’re doing something wrong either on the
query side or on the add-on index side.
Thank you @darius for the heads-up. I think i found the bug.
The way i got the developers name from the addon index was to concatenate https://addons.openmrs.org with the
packageName key property of each modules.
So i discovered that the value of some
packageName key do not match the value on the addon index url, hence the
For example the
Legacy UI Module exist on the addon index but it returns 404 because the value of the
https://addons.openmrs.org/#/show/org.openmrs.module.legacyui does not match ‘https://addons.openmrs.org/#/show/org.openmrs.module.legacyui’
If all the value in
packageName are uniform with the addon index, then it would be solved.
What are your thought?
You have correctly noted that the internal uids in the addon index don’t always match the modulePackage (which is what “org.openmrs.module.legacyui” is technically called within OpenMRS).
The REST call you want is:
Thanks @darius. It works!
Yah, it will definitely work. I used this while working on SysAdmin OWA.