Issues on definitions endpoints


Checking REST 1.0.0 / definitions found some issues on the template endpoints:

1. In GET /definition/template/adl1.4/{template_id} the template_id param should be removed from the URL because it collides with the other endpoint GET /definition/template/adl1.4/{template_id}/{version_pattern} when the version_pattern is empty (because it is optional).

Also the second endpoint is about one template and the first about a list of templates, so the template_id param doesn't make much sense on the first endpoint.

2. Remove "all" from the name "List all templates", I think "List templates" is more clear, and if in the future we add parameters for pagination, that I think should be added, the response won't be "all" templates, just a subset, but still will "list templates".

3. On the description of the 200 for the GET /definition/template/adl1.4/{template_id} endpoint it says "200 OK is returned when the EHR resource is successfully retrieved." Should replace "EHR" with "template", or rewrite that a little since it will return 200 OK even if no template is present on the server, since the empty collection of resources is still a valid response. Unless there is a 50x error, this endpoint will always return 200.





Sebastian Iancu
December 20, 2018, 1:13 PM

All (most) of these were already fixed in v1.0.1 caused by #82 github issue.
It is just the the changes are yet not released.

Sebastian Iancu
July 19, 2019, 2:58 PM

I’m working on the fix for this, …should "List all templates /definition/template/adl2" return all templates on their latest versions, or all templates and all their versions?

I’m inclined to say that it should return all templates and their latest version, and use an OPTION /definition/template/adl2/{template_id} action to list all versions of a specific template.


Thomas Beale
July 19, 2019, 3:04 PM

I think your solution is correct. It is hard to imagine by default wanting all templates in all their versions, which might be very numerous and ancient/irrelevant. If specific versions are required, it will most likely be on a per template basis. Repeated use will get the whole lot back easily enough if really required.


Pablo Pazos