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

Rename $recursive* to $dynamic*, make it work with normal anchors / plain name fragments instead of base URI switching #930

Merged
merged 10 commits into from
Jul 17, 2020
2 changes: 1 addition & 1 deletion hyper-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"https://json-schema.org/draft/2019-09/vocab/content": true,
"https://json-schema.org/draft/2019-09/vocab/hyper-schema": true
},
"$recursiveAnchor": true,
"$dynamicAnchor": "meta",

"title": "JSON Hyper-Schema",
"allOf": [
Expand Down
276 changes: 142 additions & 134 deletions jsonschema-core.xml

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions links.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "https://json-schema.org/draft/2019-09/hyper-schema",
"$id": "https://json-schema.org/draft/2019-09/links",
"title": "Link Description Object",

Relequestual marked this conversation as resolved.
Show resolved Hide resolved
"allOf": [
{ "required": [ "rel", "href" ] },
{ "$ref": "#/$defs/noRequiredFields" }
Expand Down Expand Up @@ -36,7 +37,7 @@
"format": "uri-template"
},
"hrefSchema": {
"$recursiveRef": "https://json-schema.org/draft/2019-09/hyper-schema",
"$dynamicRef": "https://json-schema.org/draft/2019-09/hyper-schema#meta",
"default": false
},
"templatePointers": {
Expand All @@ -63,23 +64,23 @@
"type": "string"
},
"targetSchema": {
"$recursiveRef": "https://json-schema.org/draft/2019-09/hyper-schema",
"$dynamicRef": "https://json-schema.org/draft/2019-09/hyper-schema#meta",
"default": true
},
"targetMediaType": {
"type": "string"
},
"targetHints": { },
"headerSchema": {
"$recursiveRef": "https://json-schema.org/draft/2019-09/hyper-schema",
"$dynamicRef": "https://json-schema.org/draft/2019-09/hyper-schema#meta",
"default": true
},
"submissionMediaType": {
"type": "string",
"default": "application/json"
},
"submissionSchema": {
"$recursiveRef": "https://json-schema.org/draft/2019-09/hyper-schema",
"$dynamicRef": "https://json-schema.org/draft/2019-09/hyper-schema#meta",
"default": true
},
"$comment": {
Expand Down
30 changes: 15 additions & 15 deletions meta/applicator.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,47 @@
"$vocabulary": {
"https://json-schema.org/draft/2019-09/vocab/applicator": true
},
"$recursiveAnchor": true,
"$dynamicAnchor": "meta",
Relequestual marked this conversation as resolved.
Show resolved Hide resolved

"title": "Applicator vocabulary meta-schema",
"properties": {
"prefixItems": { "$ref": "#/$defs/schemaArray" },
"items": { "$recursiveRef": "#" },
"unevaluatedItems": { "$recursiveRef": "#" },
"contains": { "$recursiveRef": "#" },
"additionalProperties": { "$recursiveRef": "#" },
"unevaluatedProperties": { "$recursiveRef": "#" },
"items": { "$dynamicRef": "#meta" },
"unevaluatedItems": { "$dynamicRef": "#meta" },
"contains": { "$dynamicRef": "#meta" },
"additionalProperties": { "$dynamicRef": "#meta" },
"unevaluatedProperties": { "$dynamicRef": "#meta" },
"properties": {
"type": "object",
"additionalProperties": { "$recursiveRef": "#" },
"additionalProperties": { "$dynamicRef": "#meta" },
"default": {}
},
"patternProperties": {
"type": "object",
"additionalProperties": { "$recursiveRef": "#" },
"additionalProperties": { "$dynamicRef": "#meta" },
"propertyNames": { "format": "regex" },
"default": {}
},
"dependentSchemas": {
"type": "object",
"additionalProperties": {
"$recursiveRef": "#"
"$dynamicRef": "#meta"
}
},
"propertyNames": { "$recursiveRef": "#" },
"if": { "$recursiveRef": "#" },
"then": { "$recursiveRef": "#" },
"else": { "$recursiveRef": "#" },
"propertyNames": { "$dynamicRef": "#meta" },
"if": { "$dynamicRef": "#meta" },
"then": { "$dynamicRef": "#meta" },
"else": { "$dynamicRef": "#meta" },
"allOf": { "$ref": "#/$defs/schemaArray" },
"anyOf": { "$ref": "#/$defs/schemaArray" },
"oneOf": { "$ref": "#/$defs/schemaArray" },
"not": { "$recursiveRef": "#" }
"not": { "$dynamicRef": "#meta" }
},
"$defs": {
"schemaArray": {
"type": "array",
"minItems": 1,
"items": { "$recursiveRef": "#" }
"items": { "$dynamicRef": "#meta" }
}
}
}
4 changes: 2 additions & 2 deletions meta/content.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"$vocabulary": {
"https://json-schema.org/draft/2019-09/vocab/content": true
},
"$recursiveAnchor": true,
"$dynamicAnchor": "meta",

"title": "Content vocabulary meta-schema",

"type": ["object", "boolean"],
"properties": {
"contentMediaType": { "type": "string" },
"contentEncoding": { "type": "string" },
"contentSchema": { "$recursiveRef": "#" }
"contentSchema": { "$dynamicRef": "#meta" }
}
}
4 changes: 2 additions & 2 deletions meta/core.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"$vocabulary": {
"https://json-schema.org/draft/2019-09/vocab/core": true
},
"$recursiveAnchor": true,
"$dynamicAnchor": "meta",

"title": "Core vocabulary meta-schema",
"type": ["object", "boolean"],
Expand Down Expand Up @@ -51,7 +51,7 @@
},
"$defs": {
"type": "object",
"additionalProperties": { "$recursiveRef": "#" },
"additionalProperties": { "$dynamicRef": "#meta" },
"default": {}
}
}
Expand Down
2 changes: 1 addition & 1 deletion meta/format.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"$vocabulary": {
"https://json-schema.org/draft/2019-09/vocab/format": true
},
"$recursiveAnchor": true,
"$dynamicAnchor": "meta",

"title": "Format vocabulary meta-schema",
"type": ["object", "boolean"],
Expand Down
2 changes: 1 addition & 1 deletion meta/hyper-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"$vocabulary": {
"https://json-schema.org/draft/2019-09/vocab/hyper-schema": true
},
"$recursiveAnchor": true,
"$dynamicAnchor": "meta",

"title": "JSON Hyper-Schema Vocabulary Schema",
"type": ["object", "boolean"],
Expand Down
2 changes: 1 addition & 1 deletion meta/meta-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"$vocabulary": {
"https://json-schema.org/draft/2019-09/vocab/meta-data": true
},
"$recursiveAnchor": true,
"$dynamicAnchor": "meta",

"title": "Meta-data vocabulary meta-schema",

Expand Down
2 changes: 1 addition & 1 deletion meta/validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"$vocabulary": {
"https://json-schema.org/draft/2019-09/vocab/validation": true
},
"$recursiveAnchor": true,
"$dynamicAnchor": "meta",

"title": "Validation vocabulary meta-schema",
"type": ["object", "boolean"],
Expand Down
6 changes: 3 additions & 3 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"https://json-schema.org/draft/2019-09/vocab/format": false,
"https://json-schema.org/draft/2019-09/vocab/content": true
},
"$recursiveAnchor": true,
"$dynamicAnchor": "meta",

"title": "Core and Validation specifications meta-schema",
"allOf": [
Expand All @@ -25,15 +25,15 @@
"definitions": {
"$comment": "While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",
"type": "object",
"additionalProperties": { "$recursiveRef": "#" },
"additionalProperties": { "$dynamicRef": "#meta" },
"default": {}
},
"dependencies": {
"$comment": "\"dependencies\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \"dependentSchemas\" and \"dependentRequired\"",
"type": "object",
"additionalProperties": {
"anyOf": [
{ "$recursiveRef": "#" },
{ "$dynamicRef": "#meta" },
{ "$ref": "meta/validation#/$defs/stringArray" }
]
}
Expand Down