Open
Description
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/playgroundhad to vendor the JSONSchema definition locally as a stopgap because of CORS issues withhttps://meta.json-schema.tools(see the open-rpc/tools changelog for@open-rpc/playground@1.1.2)openrpc-linterrewrites$schematohttp://json-schema.org/draft-07/schema#when it encounters itexecution-apistooling 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 thetitleannotations 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/$reftargets are infrastructure we control - Inline the
JSONSchemadefinition into our schemas so there is no remote$refat all
Tasks
- Decide which option we want
- Update
spec/1.3/schema.jsonandspec/1.4/schema.json($schema+JSONSchema$ref) - Check downstream consumers that special-case the URL and update/remove workarounds:
schema-utils-js(registers it in AJV under that key), playground (local vendoring workaround),openrpc-linter(rewrites it),execution-apis(strips the identifiers) - Account for this in the deprecation plan in Plan to deprecate this repo — consolidate schema + typings into
@open-rpc/specand@open-rpc/spec-typesmeta-schema#476
Related: #422 (versioned meta-schemas on meta.open-rpc.org).
Metadata
Metadata
Assignees
Labels
No labels
Activity