-
-
Notifications
You must be signed in to change notification settings - Fork 321
re-unite meta-schema #1610
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
base: main
Are you sure you want to change the base?
re-unite meta-schema #1610
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
{ | ||
"$schema": "https://json-schema.org/version/year/meta", | ||
"$id": "https://json-schema.org/version/year/meta", | ||
"$dynamicAnchor": "meta", | ||
|
||
"title": "JSON Schema Core and Validation specification meta-schema", | ||
"type": ["object", "boolean"], | ||
"properties": { | ||
"$id": { | ||
"$ref": "#/$defs/iriReferenceString", | ||
"$comment": "Fragments not allowed.", | ||
"pattern": "^[^#]*$" | ||
}, | ||
"$schema": { "$ref": "#/$defs/iriString" }, | ||
"$ref": { "$ref": "#/$defs/iriReferenceString" }, | ||
"$anchor": { "$ref": "#/$defs/anchorString" }, | ||
"$dynamicRef": { "$ref": "#/$defs/iriReferenceString" }, | ||
"$dynamicAnchor": { "$ref": "#/$defs/anchorString" }, | ||
"$comment": { | ||
"type": "string" | ||
}, | ||
"$defs": { | ||
"type": "object", | ||
"additionalProperties": { "$dynamicRef": "#meta" } | ||
}, | ||
"title": { | ||
"type": "string" | ||
}, | ||
"description": { | ||
"type": "string" | ||
}, | ||
"default": true, | ||
"deprecated": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"readOnly": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"writeOnly": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"examples": { | ||
"type": "array", | ||
"items": true | ||
}, | ||
"prefixItems": { "$ref": "#/$defs/schemaArray" }, | ||
"items": { "$dynamicRef": "#meta" }, | ||
"maxContains": { "$ref": "#/$defs/nonNegativeInteger" }, | ||
"minContains": { | ||
"$ref": "#/$defs/nonNegativeInteger", | ||
"default": 1 | ||
}, | ||
"contains": { "$dynamicRef": "#meta" }, | ||
"additionalProperties": { "$dynamicRef": "#meta" }, | ||
"properties": { | ||
"type": "object", | ||
"additionalProperties": { "$dynamicRef": "#meta" }, | ||
"default": {} | ||
}, | ||
"patternProperties": { | ||
"type": "object", | ||
"additionalProperties": { "$dynamicRef": "#meta" }, | ||
"propertyNames": { "format": "regex" }, | ||
"default": {} | ||
}, | ||
"dependentSchemas": { | ||
"type": "object", | ||
"additionalProperties": { "$dynamicRef": "#meta" }, | ||
"default": {} | ||
}, | ||
"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": { "$dynamicRef": "#meta" }, | ||
"unevaluatedItems": { "$dynamicRef": "#meta" }, | ||
"unevaluatedProperties": { "$dynamicRef": "#meta" }, | ||
"type": { | ||
"anyOf": [ | ||
{ "$ref": "#/$defs/simpleTypes" }, | ||
{ | ||
"type": "array", | ||
"items": { "$ref": "#/$defs/simpleTypes" }, | ||
"minItems": 1, | ||
"uniqueItems": true | ||
} | ||
] | ||
}, | ||
"const": true, | ||
"enum": { | ||
"type": "array", | ||
"items": true | ||
}, | ||
"multipleOf": { | ||
"type": "number", | ||
"exclusiveMinimum": 0 | ||
}, | ||
"maximum": { | ||
"type": "number" | ||
}, | ||
"exclusiveMaximum": { | ||
"type": "number" | ||
}, | ||
"minimum": { | ||
"type": "number" | ||
}, | ||
"exclusiveMinimum": { | ||
"type": "number" | ||
}, | ||
"maxLength": { "$ref": "#/$defs/nonNegativeInteger" }, | ||
"minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" }, | ||
"pattern": { | ||
"type": "string", | ||
"format": "regex" | ||
}, | ||
"maxItems": { "$ref": "#/$defs/nonNegativeInteger" }, | ||
"minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" }, | ||
"uniqueItems": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"maxProperties": { "$ref": "#/$defs/nonNegativeInteger" }, | ||
"minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" }, | ||
"required": { "$ref": "#/$defs/stringArray" }, | ||
"dependentRequired": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"$ref": "#/$defs/stringArray" | ||
} | ||
}, | ||
"format": { "type": "string" }, | ||
"contentEncoding": { "type": "string" }, | ||
"contentMediaType": { "type": "string" }, | ||
"contentSchema": { "$dynamicRef": "#meta" }, | ||
|
||
"$vocabulary": { | ||
"$comment": "Proposed keyword: https://github.com/json-schema-org/json-schema-spec/blob/main/specs/proposals/vocabularies.md" | ||
}, | ||
"propertyDependencies": { | ||
"$comment": "Proposed keyword: https://github.com/json-schema-org/json-schema-spec/blob/main/specs/proposals/propertyDependencies.md" | ||
} | ||
}, | ||
"patternProperties": { | ||
"^x-": true, | ||
"^(?!(?:\\$id|\\$schema|\\$ref|\\$anchor|\\$dynamicRef|\\$dynamicAnchor|\\$comment|\\$defs)$)\\$.*": false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this superfluous? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Karen suggested an improvement. It's needed. The updated spec restricts the definition of custom |
||
}, | ||
"$defs": { | ||
"anchorString": { | ||
"type": "string", | ||
"pattern": "^[A-Za-z_][-A-Za-z0-9._]*$" | ||
}, | ||
"iriString": { | ||
"type": "string", | ||
"format": "iri" | ||
}, | ||
"iriReferenceString": { | ||
"type": "string", | ||
"format": "iri-reference" | ||
}, | ||
"nonNegativeInteger": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
"nonNegativeIntegerDefault0": { | ||
"$ref": "#/$defs/nonNegativeInteger", | ||
"default": 0 | ||
}, | ||
"schemaArray": { | ||
"type": "array", | ||
"minItems": 1, | ||
"items": { "$dynamicRef": "#meta" } | ||
}, | ||
"simpleTypes": { | ||
"enum": [ | ||
"array", | ||
"boolean", | ||
"integer", | ||
"null", | ||
"number", | ||
"object", | ||
"string" | ||
] | ||
} | ||
} | ||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's "meta"? (Sorry if it's something we discussed and I forgot.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, what's the reason for using a placeholder for "version" and "year"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was late. It should just be
/version/year
It's not published yet. Just wanted to communicate the idea.