Skip to content
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

Provide JSON Schema definitions of the WES data model #135

Open
susheel opened this issue May 9, 2019 · 9 comments
Open

Provide JSON Schema definitions of the WES data model #135

susheel opened this issue May 9, 2019 · 9 comments

Comments

@susheel
Copy link
Member

susheel commented May 9, 2019

Provide JSON Schema definitions to help WES clients validate WES request/responses.

@jaeddy
Copy link
Member

jaeddy commented May 9, 2019

@susheel - what's the benefit of storing this separately from the definitions (or components in OpenAPI 3) section of the spec YAML? When converted to JSON, this section provides exactly the JSON Schema definitions you describe.

I'd be a little worried about the two documents potentially getting out of sync.

@susheel
Copy link
Member Author

susheel commented May 10, 2019

It is mainly to allow a non-swagger client to still validate the JSON response without processing the swagger spec to extract the JSON schema.

I am planning to raise this as a separate proposal but just wanted to give you the context of where I'm going with this. Long-term I see the need to embed the schema version into the JSON response to allow a client to validate and process cross-service JSON responses. Example below:

{
  "@context": "http://ga4gh.cloud/wes/v1",
  "id": "..."
  ...
}

http://ga4gh.cloud/wes/v1 is just a well-known direct url path to the JSON schema defenition of the JSON response.

This is especially needed when we get a TRS v1 response to be sent to a WES service that can process both TRS v1 and v2 JSON data. Ditto for WES <--> TES and/or DRS.

I strongly feel this is better than relying on the current suggestion of using baseURL versions /ga4gh/wes/v1 path as downstream services will not know which version of the upstream response they are processing. JSON schema is needed for this that know which swagger spec was used to produce the JSON body.

@briandoconnor
Copy link
Contributor

@susheel how does this relate to ga4gh/data-repository-service-schemas#264 ? Also, can you just generate this JSON as part of the documentation build system?

@jaeddy
Copy link
Member

jaeddy commented May 13, 2019

Thanks, @susheel! I like this vision, though would like to see it as part of the build process (the JSON file doesn't need to be under version control — but we can certainly handle the Swagger processing to save clients the trouble). I'd be OK merging your PR for now and dealing with the build/deploy/hosting updates in a separate ticket.

@briandoconnor — I do think this relates to what the Discovery WS is trying to enable, but not sure exactly how it fits with /service-info. Might be worth chatting with them some more. This could also be a topic on which the Smart API folks could lend some insight.

@susheel
Copy link
Member Author

susheel commented May 17, 2019

@briandoconnor @jaeddy Yes, I believe this can be generated from the build process. I use https://github.com/instrumenta/openapi2jsonschema

@jaeddy
Copy link
Member

jaeddy commented May 21, 2019

I'll merge develop into master sometime today or tomorrow, which should close this issue, then address the build changes in #137.

@ruchim
Copy link
Collaborator

ruchim commented Dec 8, 2020

hey @jaeddy -- do you feel this issue should be closed? And also #137 -- they both seem linked.

@uniqueg
Copy link
Contributor

uniqueg commented Jun 18, 2024

Related: ga4gh/TASC#43

@uniqueg
Copy link
Contributor

uniqueg commented Nov 1, 2024

I very much like the HATEOAS aspects of @susheel's suggestion, but given that tooling around OpenAPI is excellent and includes converters for JSON Schema, the main point of the issue seems redundant to me in 2024.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants