Closed redmitry closed 3 years ago
IMU, both approaches doesn't need to be alternative, right? I like the API to be explicit both in requests and in responses. This shouldn't preclude that the (suggested) implementation is purely relaying in such "explicitness", in a similar way that we are doing with user credentials (that are conveyed inside a token). I see a difference between transversal concerns (AuthN/AuthZ) and core features. Having said that is my "preference/principal", questions:
- Would the "Accept" support such dynamic schema where different parts should honor different schemas?
- Who is resolving the schema in the "Accept"?
This is a job of the REST framework to resolve. In java (JAX-RS) one may have several methods sharing the same @Path an with only difference on accept or content-type headers. For instance the same endpoint may serve json, yaml, xml, rdf, etc. providing four different implementations and it's a JAX-RS which choose them on the @Produces annotation.
@jrambla, @redmitry, I think we can close this issue, can't we?
In the future, we need a better discussion on how much the tooling/frameworks should be leveraged against the verbosity of the API. Or how much the API should be linked to an specific protocol (e.g. HTTP) or be more agnostic to it. Etc. I believe that is not for version 2 but for a future one. GA4GH TASC future guidelines would also contribute to the discussion.
Hello,
Currently requested Schema Version is defined in the "meta" block of the request:
This approach introduces implementation complexities. For instance, decision on parsing and validating must be implemented by the implementation code, instead of a REST framework (i.e. JAX-RS). Support for different formats by the same endpoint is usually implemented via HTTP “Accept” header. For instance, this approach is adopted by the GA4GH RNAGet API:
Kind regards,
Dmitry