Open jvandegriff opened 4 years ago
related to issue #101
would require major overhaul, so not likely at this point; would need a champion to proceed
telecon on 2021-05-24
Could be done as an optional mechanism: add trailing slash to URL to get extra links to the next level links
Idea is to make it self-documenting for someone typing link to a browser so they could teach themselves how to use it by just typing the top link, and then following subsequent links.
could expose this as an option in the capabilities
endpoint.
Output would need to be HTML for browsers.
Jeremy: could do this by requiring the top-level hapi
endpoint to be an official / standardized explanation.
Lower priority for now.
This is tied to our re-look at the whole API, especially in terms of the OpenAPI community.
Until then, we should not make these kinds of big changes.
(Jon V): I'm unceremoniously putting Bobby's email in here:
An addition to the HAPI spec could meet Aaron's request that HAPI links be usable by users directly. As Bernie pointed out, his HAPI implementation presents a different more client friendly interface when called with accept header of HTML. The REST concept HATEOS https://en.wikipedia.org/wiki/HATEOAS calls for returning links for dynamically discovering the actions and resources possible (affordances) from there, without manual intervention. This could be in a more readable form when called with accept of HTML as Bernie did.
HATEOAS REST Services With Spring https://dzone.com/articles/hypermedia-driven-rest-services-with-spring-hateoa Design principles of the REST-ful JSON API (HATEOAS) http://perpetuum-mobile.net/tech/design-principles-of-the-rest-ful-json-api-hateoas/
The top level call /hapi/ (not /hapi) would return
A call to /hapi/info?id=ACE_MAG would return
or perhaps more useful:
"link": {rel="all_variables", href="/data?id=<ProductID>¶meters=Time,mag_GSE,quality_flag,,...&time.min=1998-001Z&time.max=2017-100Z" }
and for the complaint of not storing the calling sequence:
"link": {rel="self", href="/hapi/info?id=ACE_MAG" }
From REST API — What Is HATEOAS? https://dzone.com/articles/rest-api-what-is-hateoas and Creating a hypermedia-driven RESTful web service https://openliberty.io/guides/rest-hateoas.html, we could perhaps use the name "_links" instead of "link" or maybe its own _links section, with multiple link sections (the rel= is standard HTML but maybe not necessary):