What's the core usecase for IdentifierResource

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

Did you take a look at the unit tests for that resource?

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?

Well seems we have a bug in the webservices.rest. Created ticket at : [RESTWS-747] - OpenMRS Issues

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

Did you respond to Burke’s comment on the ticket?