Skip to content

Avoid $ref in /queryables #153

@m-mohr

Description

@m-mohr

Neither a bug nor really a feature, so opening a blank issue.

The /queryables endpoints refer to external schemas using $ref. This leads to a lot of downstream HTTP requests in clients, e.g. STAC Browser. For example requesting https://planetarycomputer.microsoft.com/api/stac/v1/queryables has a single field defined, which pretty much just refers to a very simple JSON Schema of like 30 bytes: { "type": "string", "minLength": 1 }. For this simple schema. the client has to sends 8(!) http requests returning a total of nearly 10.000 bytes. Could this be improved?

Two alternative solutions could be considered:

  1. Inline at least the simple schemas.
  2. Bundle the schema on the server-side and return the bundled schema.

I'd prefer version 2 as it just is much more lightweight on the clients, which don't need to carry a full $ref parser library. $refs itself are also pretty ill-defined with a lot of different implementation, so the interoperability is pretty bad. The JSON Schema community is currently discussing this, but that will take more time: https://github.com/json-schema-org/referencing https://phil.tech/2022/bundling-openapi-with-javascript/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions