Skip to content

Commit

Permalink
Update meta-schemas for $dynamic*
Browse files Browse the repository at this point in the history
Replace $recursiveAnchor: true with $dynamicAnchor: "meta"
and update $recursiveRef to $dynamicRef accordingly.
  • Loading branch information
handrews committed May 20, 2020
1 parent 5b4a559 commit f79761e
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 32 deletions.
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
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",

"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
32 changes: 16 additions & 16 deletions meta/applicator.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,52 @@
"$vocabulary": {
"https://json-schema.org/draft/2019-09/vocab/applicator": true
},
"$recursiveAnchor": true,
"$dynamicAnchor": "meta",

"title": "Applicator vocabulary meta-schema",
"properties": {
"additionalItems": { "$recursiveRef": "#" },
"unevaluatedItems": { "$recursiveRef": "#" },
"additionalItems": { "$dynamicRef": "#meta" },
"unevaluatedItems": { "$dynamicRef": "#meta" },
"items": {
"anyOf": [
{ "$recursiveRef": "#" },
{ "$dynamicRef": "#meta" },
{ "$ref": "#/$defs/schemaArray" }
]
},
"contains": { "$recursiveRef": "#" },
"additionalProperties": { "$recursiveRef": "#" },
"unevaluatedProperties": { "$recursiveRef": "#" },
"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

0 comments on commit f79761e

Please sign in to comment.