-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
schemaUrl Property to document the API schema used by the service #27
base: develop
Are you sure you want to change the base?
Conversation
I can understand the use-case here. Would this be a JSON-schema or Swagger API declaration? |
Ideally both. I was only thinking along the lines of the OpenAPI/Swagger YAML definitions in this iteration as it would give the client both the JSON type definitions and the API path-spec in a single file. Most OpenAPI client frameworks can already handle the Swagger/OpenAPI YAMLs natively for self configuration. Not sure about JSON schema, which I have only seen for data validation. I suspect we would need a separate JSON schema support when we start dealing with different type definitions for multiple versions of the same API. Let's cross that bridge when we get there. |
Then my bigger question is how would you know which model in the OpenAPI
spec refers to service-info? I guess we'd look for the service-info
endpoint, find the associated payload & parse that. It's quite a
complicated path to resolving it versus a JSON schema, which would directly
refer to the response modelled.
I guess what I'm missing here is a worked through example of how someone
would go about using this. Otherwise I'd push to not integrating it into
this current version spec and waiting to see what happens in PRC.
…On Mon, 10 Jun 2019 at 17:18, Susheel Varma ***@***.***> wrote:
Ideally both.
I was only thinking along the lines of the OpenAPI/Swagger YAML
definitions in this iteration as it would give the client both the JSON
type definitions and the API path-spec in a single file.
Most OpenAPI client frameworks can already handle the Swagger/OpenAPI
YAMLs natively for self configuration. Not sure about JSON schema, which I
have only seen for data validation.
I suspect we would need a separate JSON schema support when we start
dealing with different type definitions for multiple versions of the same
API. Let's cross that bridge when we get there.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#27?email_source=notifications&email_token=AABLSGIINQUNKXQYN7SSDDLPZZ5FFA5CNFSM4HWJMT22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXKLN5I#issuecomment-500479733>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABLSGJMW7C73NERDRXK6O3PZZ5FFANCNFSM4HWJMT2Q>
.
|
Honestly, I would have liked to have the service expose a URL to underlying JSON schema, hence the original name (schemaUrl). I eventually shied away from this at this point in time, as it would mean a lot more upfront work, and as AFAIK none of the current GA4GH API specs does this natively:
That being said, JSON schema only provides useful data model validation but does not provide any hints on the API path-spec itself. The Swagger/OpenAPI YAML spec provides both. We are primarily interested in using this mechanism to introduce local Swagger path-spec and model x-extensions that would still be compatible with the GA4GH community spec. Our clients will be able to use the service-provided schemaUrl to make use of (non-breaking) extended features, while still allowing GA4GH community clients with hard-coded common GA4GH spec. Rather than relying on clients to manually hard-code this from a separate location, it would be great if this was available from the service endpoint itself. The default can still point to the GA4GH common spec. Happy for this to stay in the backlog for a future date. |
On the 1st point we should keep an eye on the WES issue. I know there are problems with openapi and JSON schema compatibility but this is in the process of being resolved. On the second point I thought I'm afraid to say that think it's better to define what we're trying to achieve here and the use-case we're looking to solve than injecting a new attribute late on in the process. Sorry. |
Sorry, I meant |
Okay. I think best to retain this for future versions once we know more
about the place of JSON schema. Might be good to collaborate with Schema
Blocks on this.
…On Tue, 11 Jun 2019 at 10:54, Susheel Varma ***@***.***> wrote:
Sorry, I meant $schema and $id. I was only hoping it will go through in
this round. Happy for this to stay in the backlog for a future date.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#27?email_source=notifications&email_token=AABLSGJRW6OWNQBAQO4UAJTPZ5Y67A5CNFSM4HWJMT22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXMS33Y#issuecomment-500772335>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABLSGK73LLNJELEYATHXODPZ5Y67ANCNFSM4HWJMT2Q>
.
|
I feel it may be worth adding the explicit URL to the API schema used by the service. This would allow clients to detect the API schema used by the service and self-configure. This could point to the GA4GH YAML spec or a local copy that may add non-breaking extensions. See example below:
Related GA4GH DRS /service-info PR #277 discussion.
Resolves #26