Skip to content

Move off meta.json-schema.tools as the $schema dialect and $ref target #423

Description

@ember-muse

Context

Our canonical schemas (spec/1.3/schema.json, spec/1.4/schema.json) still declare:

"$schema": "https://meta.json-schema.tools/"

and reference it internally:

"JSONSchema": { "$ref": "https://meta.json-schema.tools" }

That domain serves a copy of the draft-07 meta-schema with title annotations added (for prettier generated typing names — see open-rpc/meta-schema#323 and open-rpc/meta-schema#324 for the history). It works, but it is an external dependency baked into the spec itself: separate org, separate infra, and we have already been bitten:

  • @open-rpc/playground had to vendor the JSONSchema definition locally as a stopgap because of CORS issues with https://meta.json-schema.tools (see the open-rpc/tools changelog for @open-rpc/playground@1.1.2)
  • openrpc-linter rewrites $schema to http://json-schema.org/draft-07/schema# when it encounters it
  • execution-apis tooling strips the embedded identifiers so the definition behaves like a local subschema

Proposal

Long term, the spec should not depend on a third-party domain for its own dialect identifier. Options:

  • Reference the canonical draft-07 meta-schema URL (http://json-schema.org/draft-07/schema#) instead — simplest, but loses the title annotations that give us nice generated type names
  • Self-host the annotated JSONSchema meta-schema under our own domain (e.g. alongside the versioned schemas from Serve versioned meta-schemas on meta.open-rpc.org and deprecate the legacy root URL #422), so the $schema / $ref targets are infrastructure we control
  • Inline the JSONSchema definition into our schemas so there is no remote $ref at all

Tasks

Related: #422 (versioned meta-schemas on meta.open-rpc.org).

Activity

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

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