You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following on from discussion in #153 I see there is a big challenge in that the TRS API do not follow the Hypermedia as the Engine of Application State principle - that is, the client is repeatedly forced to traverse JSON to pick up multiple key-values to then construct new URIs based on the Swagger templates.
It would be quite helpful, specially for new users of the API who may not know the TRS spec fully, to simply find links to the sub-resources along the line.
Say starting at a resource like https://workflowhub.eu/ga4gh/trs/v2/toolClasses - there are no links to search for /tools of the given type although that is presumably the main purpose of this listing.
I would suggest that all entries, specially in listings like /tools include hyperlinks so that the developer don't always have to hand-construct URIs like /tools/{id}/versions/{version_id} where they would otherwise have to make sure they don't mix up their id from their ids.
I am not suggesting we change it drastically to use their _embedded resources - although they are also interesting. Simply adding the informational _links blocks.
For instance - here showing our current non-TRS use of url could be combined with HAL _links sections for navigating the TRS API.
When there is no existing link relation appropriate one can use permalinks like https://w3id.org/ga4gh/trs/tests or just use _links: {self: {}} under its own JSON branch, as shown for versions above.
┆Issue is synchronized with this Jira Story
┆containerName: GA4GH tool-registry-service
┆Issue Number: TRS-46
The text was updated successfully, but these errors were encountered:
Quickly browsing the discussion, it seems like there there isn't a pre-baked solution in the openapi tooling for this.
But informational _links blocks sound fine.
Real REST APIs? 😳 If done with care, I'm all for it! And the proposed _links sound useful and inoffensive to me as well. Interesting read @denis-yuen :)
Following on from discussion in #153 I see there is a big challenge in that the TRS API do not follow the Hypermedia as the Engine of Application State principle - that is, the client is repeatedly forced to traverse JSON to pick up multiple key-values to then construct new URIs based on the Swagger templates.
It would be quite helpful, specially for new users of the API who may not know the TRS spec fully, to simply find links to the sub-resources along the line.
Say starting at a resource like https://workflowhub.eu/ga4gh/trs/v2/toolClasses - there are no links to search for
/tools
of the given type although that is presumably the main purpose of this listing.I would suggest that all entries, specially in listings like
/tools
include hyperlinks so that the developer don't always have to hand-construct URIs like/tools/{id}/versions/{version_id}
where they would otherwise have to make sure they don't mix up theirid
from theirid
s.The JSON Hypertext Application Language (HAL) comes to mind, allowing you to add various short-cuts and save some unnecessary API calls by typing links with link relations
I am not suggesting we change it drastically to use their
_embedded
resources - although they are also interesting. Simply adding the informational_links
blocks.For instance - here showing our current non-TRS use of
url
could be combined with HAL_links
sections for navigating the TRS API.When there is no existing link relation appropriate one can use permalinks like
https://w3id.org/ga4gh/trs/tests
or just use_links: {self: {}}
under its own JSON branch, as shown forversions
above.┆Issue is synchronized with this Jira Story
┆containerName: GA4GH tool-registry-service
┆Issue Number: TRS-46
The text was updated successfully, but these errors were encountered: