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

Queryables / Schemas: with $ref or dereferenced #840

Open
m-mohr opened this issue Jul 6, 2023 · 2 comments
Open

Queryables / Schemas: with $ref or dereferenced #840

m-mohr opened this issue Jul 6, 2023 · 2 comments

Comments

@m-mohr
Copy link
Contributor

m-mohr commented Jul 6, 2023

In STAC I observe that the queryables / schemas returned by the API often use $ref to link to "relatively" simple schemas.
I guess in Python and other clients that's not so much of an issue, but I'm implementing a browser-based tool (i.e. STAC Browser) that can show a form for queryables, but loading all the dozens of related schemas and dereferncing them freezes the Browser for multiple seconds. In this use-case it's really bad to have $refs, especially if you link to various files/extensions.

I'm wondering:

  1. Any guidance from OGC what is preferrable? (with $ref or dereferenced)
  2. Would it make sense to add a query parameter that allows to retrieve the schemas in a dereferenced form? (?dereference=1 or so). (I think so.)
@cportele
Copy link
Member

cportele commented Jul 6, 2023

  1. In general, it is safer to send the response without $refs, since not all clients may support it. This is also what we do in our implementation. The current recommendation for how to construct the schema does not mention $ref, so implicitly I would say that the guidance is not to use $ref. Maybe that should be made explicit?

  2. I have concerns about making this required to support, a recommendation should be enough. Almost all guidance on constructing the schema are in a recommendation, so this aspect should be, too. It is very easy to construct a JSON Schema that probably most clients won't be able to parse, but we also do not prohibit that, because at this point we do not have a clear understanding what a good profile of JSON Schema is, to make a firm requirement. I would see the $refs in the same context.

@m-mohr
Copy link
Contributor Author

m-mohr commented Jul 6, 2023

Thanks!

  1. I think some guidance around $ref would be great.
  2. Yeah, a recommendation would be enough for sure. If supported, great. If not supported, then you are out of luck anyway, but it just ignores the parameter and doesn't error. :-)

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

No branches or pull requests

2 participants