Closed
Description
in https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.1.2:
The "$vocabulary" keyword SHOULD be used in the root schema of any schema document intended for use as a meta-schema. It MUST NOT appear in subschemas.
I'm not sure if the intent here is that metaschemas cannot be bundled which would (assuming that there are "$schema" and "$id" keywords alongside), result in "$vocabulary" appearing in the root of its particular resource but not in the root of the actual document itself -- or if this language preceded the formalization of bundling.
I think this usecase should be explicitly called out as either allowed or disallowed.
example:
{
"$defs": {
"metaschema": {
"$id": "https://localhost:1234/mymetaschema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$vocabulary": {
...
}
}
},
"$id": "https://localhost:1234/myschema",
"$schema": "https://localhost:1234/mymetaschema",
...,
}