samuel34
(Samuel Male)
January 8, 2019, 9:20am
1
Hey,
We have an IdentifierResource already added in the idgen module as a subresource for IdentifierSourceResource however, this resource isn’t working.
curl -u admin:Admin123 -i "http://localhost:8080/openmrs/ws/rest/v1/idgen/identifiersource/05a29f94-c0ed-11e2-94be-8c13b969e334/identifier"
The above call causes an UnknownResourceException
full log : https://pastebin.com/R1EgJxQt
Well I believe this resource ain’t available because this method #getPropertiesToExposeAsSubResources() wasn’t overriden in IdentifierSourceResource.
My Qeury
But I wonder what’s the use of this Subresource? I find it sort of trivial! Is it there for someone who wants an identifier string to be generated for them depending on a given IdentifierSource? If so, which property of the IdenifierSource is this Subresource delegating? Is it the reservedIdentifiers
?
cc: @burke , @mogoodrich , @dkayiwa
dkayiwa
(Daniel Kayiwa)
January 8, 2019, 1:38pm
2
Did you take a look at the unit tests for that resource?
samuel34
(Samuel Male)
January 8, 2019, 1:50pm
3
Well looking at the test units gives me a better insight. I understand its used to generate new Identifiers according to the sourceType.
Which property of IdentifierSource is this sub-resource delegating to?
samuel34
(Samuel Male)
January 9, 2019, 6:52am
4
Well seems we have a bug in the webservices.rest. Created ticket at : [RESTWS-747] - OpenMRS Issues
samuel34
(Samuel Male)
January 9, 2019, 1:24pm
5
With further investigation, I realized that we just had to override BaseRestController#getNamespace() and update it with the module namespace.
Lets close RESTWS-747 as Wont fix /Fixed .
The issue was this wasn’t documented anywhere.
cc: @dkayiwa
dkayiwa
(Daniel Kayiwa)
January 10, 2019, 8:39am
6
Did you respond to Burke’s comment on the ticket?