Skip to content

Commit

Permalink
Add JSON Schema 2020-12 meta-schemas
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti committed Jan 13, 2025
1 parent 52b5943 commit 55b57d0
Show file tree
Hide file tree
Showing 16 changed files with 611 additions and 0 deletions.
1 change: 1 addition & 0 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ cloudevents-1-0-1 https://github.com/cloudevents/spec v1.0.1
cloudevents-1-0-2 https://github.com/cloudevents/spec v1.0.2
riskine-ontology-1-0-0 https://github.com/riskine/ontology v1.0.0
jsr https://github.com/jsr-io/jsr 0e218a1d98b52f4c67b99a5c00742ffc3a3dda7d
jsonschema-2020-12 https://github.com/json-schema-org/json-schema-spec 769daad75a9553562333a8937a187741cb708c72
10 changes: 10 additions & 0 deletions configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@
"email": "[email protected]",
"github": "jsr-io",
"website": "https://jsr.io"
},
"jsonschema": {
"title": "JSON Schema",
"description": "The organisation responsible for the JSON Schema specification",
"github": "json-schema-org",
"website": "https://json-schema.org"
}
},
"schemas": {
Expand Down Expand Up @@ -256,6 +262,10 @@
"jsr": {
"base": "https://jsr.io/schema",
"path": "./vendor/jsr"
},
"jsonschema/2020-12": {
"base": "https://json-schema.org/draft/2020-12",
"path": "./vendor/jsonschema-2020-12"
}
}
}
11 changes: 11 additions & 0 deletions vendor/jsonschema-2020-12.mask
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
adr
archive
.travis.yml
CONTRIBUTING.md
jsonschema-core.xml
jsonschema-validation.xml
Makefile
README.md
relative-json-pointer.xml
output/verbose-example.json
output/hyper-schema.json
27 changes: 27 additions & 0 deletions vendor/jsonschema-2020-12/hyper-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://json-schema.org/draft/2020-12/hyper-schema",
"$id": "https://json-schema.org/draft/2020-12/hyper-schema",
"$vocabulary": {
"https://json-schema.org/draft/2020-12/vocab/core": true,
"https://json-schema.org/draft/2020-12/vocab/applicator": true,
"https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
"https://json-schema.org/draft/2020-12/vocab/validation": true,
"https://json-schema.org/draft/2020-12/vocab/meta-data": true,
"https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
"https://json-schema.org/draft/2020-12/vocab/content": true,
"https://json-schema.org/draft/2019-09/vocab/hyper-schema": true
},
"$dynamicAnchor": "meta",

"title": "JSON Hyper-Schema",
"allOf": [
{ "$ref": "https://json-schema.org/draft/2020-12/schema" },
{ "$ref": "https://json-schema.org/draft/2020-12/meta/hyper-schema" }
],
"links": [
{
"rel": "self",
"href": "{+%24id}"
}
]
}
85 changes: 85 additions & 0 deletions vendor/jsonschema-2020-12/links.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/links",
"title": "Link Description Object",

"type": "object",
"properties": {
"anchor": {
"type": "string",
"format": "uri-template"
},
"anchorPointer": {
"type": "string",
"anyOf": [
{ "format": "json-pointer" },
{ "format": "relative-json-pointer" }
]
},
"rel": {
"anyOf": [
{ "type": "string" },
{
"type": "array",
"items": { "type": "string" },
"minItems": 1
}
]
},
"href": {
"type": "string",
"format": "uri-template"
},
"hrefSchema": {
"$dynamicRef": "https://json-schema.org/draft/2020-12/hyper-schema#meta",
"default": false
},
"templatePointers": {
"type": "object",
"additionalProperties": {
"type": "string",
"anyOf": [
{ "format": "json-pointer" },
{ "format": "relative-json-pointer" }
]
}
},
"templateRequired": {
"type": "array",
"items": {
"type": "string"
},
"uniqueItems": true
},
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"targetSchema": {
"$dynamicRef": "https://json-schema.org/draft/2020-12/hyper-schema#meta",
"default": true
},
"targetMediaType": {
"type": "string"
},
"targetHints": {},
"headerSchema": {
"$dynamicRef": "https://json-schema.org/draft/2020-12/hyper-schema#meta",
"default": true
},
"submissionMediaType": {
"type": "string",
"default": "application/json"
},
"submissionSchema": {
"$dynamicRef": "https://json-schema.org/draft/2020-12/hyper-schema#meta",
"default": true
},
"$comment": {
"type": "string"
}
},
"required": [ "rel", "href" ]
}
48 changes: 48 additions & 0 deletions vendor/jsonschema-2020-12/meta/applicator.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/applicator",
"$vocabulary": {
"https://json-schema.org/draft/2020-12/vocab/applicator": true
},
"$dynamicAnchor": "meta",

"title": "Applicator vocabulary meta-schema",
"type": ["object", "boolean"],
"properties": {
"prefixItems": { "$ref": "#/$defs/schemaArray" },
"items": { "$dynamicRef": "#meta" },
"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" }
},
"$defs": {
"schemaArray": {
"type": "array",
"minItems": 1,
"items": { "$dynamicRef": "#meta" }
}
}
}
17 changes: 17 additions & 0 deletions vendor/jsonschema-2020-12/meta/content.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/content",
"$vocabulary": {
"https://json-schema.org/draft/2020-12/vocab/content": true
},
"$dynamicAnchor": "meta",

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

"type": ["object", "boolean"],
"properties": {
"contentEncoding": { "type": "string" },
"contentMediaType": { "type": "string" },
"contentSchema": { "$dynamicRef": "#meta" }
}
}
51 changes: 51 additions & 0 deletions vendor/jsonschema-2020-12/meta/core.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/core",
"$vocabulary": {
"https://json-schema.org/draft/2020-12/vocab/core": true
},
"$dynamicAnchor": "meta",

"title": "Core vocabulary meta-schema",
"type": ["object", "boolean"],
"properties": {
"$id": {
"$ref": "#/$defs/uriReferenceString",
"$comment": "Non-empty fragments not allowed.",
"pattern": "^[^#]*#?$"
},
"$schema": { "$ref": "#/$defs/uriString" },
"$ref": { "$ref": "#/$defs/uriReferenceString" },
"$anchor": { "$ref": "#/$defs/anchorString" },
"$dynamicRef": { "$ref": "#/$defs/uriReferenceString" },
"$dynamicAnchor": { "$ref": "#/$defs/anchorString" },
"$vocabulary": {
"type": "object",
"propertyNames": { "$ref": "#/$defs/uriString" },
"additionalProperties": {
"type": "boolean"
}
},
"$comment": {
"type": "string"
},
"$defs": {
"type": "object",
"additionalProperties": { "$dynamicRef": "#meta" }
}
},
"$defs": {
"anchorString": {
"type": "string",
"pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"
},
"uriString": {
"type": "string",
"format": "uri"
},
"uriReferenceString": {
"type": "string",
"format": "uri-reference"
}
}
}
14 changes: 14 additions & 0 deletions vendor/jsonschema-2020-12/meta/format-annotation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/format-annotation",
"$vocabulary": {
"https://json-schema.org/draft/2020-12/vocab/format-annotation": true
},
"$dynamicAnchor": "meta",

"title": "Format vocabulary meta-schema for annotation results",
"type": ["object", "boolean"],
"properties": {
"format": { "type": "string" }
}
}
14 changes: 14 additions & 0 deletions vendor/jsonschema-2020-12/meta/format-assertion.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/format-assertion",
"$vocabulary": {
"https://json-schema.org/draft/2020-12/vocab/format-assertion": true
},
"$dynamicAnchor": "meta",

"title": "Format vocabulary meta-schema for assertion results",
"type": ["object", "boolean"],
"properties": {
"format": { "type": "string" }
}
}
29 changes: 29 additions & 0 deletions vendor/jsonschema-2020-12/meta/hyper-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://json-schema.org/draft/2020-12/hyper-schema",
"$id": "https://json-schema.org/draft/2020-12/meta/hyper-schema",
"$vocabulary": {
"https://json-schema.org/draft/2019-09/vocab/hyper-schema": true
},
"$dynamicAnchor": "meta",

"title": "JSON Hyper-Schema Vocabulary Schema",
"type": ["object", "boolean"],
"properties": {
"base": {
"type": "string",
"format": "uri-template"
},
"links": {
"type": "array",
"items": {
"$ref": "https://json-schema.org/draft/2020-12/links"
}
}
},
"links": [
{
"rel": "self",
"href": "{+%24id}"
}
]
}
37 changes: 37 additions & 0 deletions vendor/jsonschema-2020-12/meta/meta-data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/meta-data",
"$vocabulary": {
"https://json-schema.org/draft/2020-12/vocab/meta-data": true
},
"$dynamicAnchor": "meta",

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

"type": ["object", "boolean"],
"properties": {
"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
}
}
}
15 changes: 15 additions & 0 deletions vendor/jsonschema-2020-12/meta/unevaluated.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/unevaluated",
"$vocabulary": {
"https://json-schema.org/draft/2020-12/vocab/unevaluated": true
},
"$dynamicAnchor": "meta",

"title": "Unevaluated applicator vocabulary meta-schema",
"type": ["object", "boolean"],
"properties": {
"unevaluatedItems": { "$dynamicRef": "#meta" },
"unevaluatedProperties": { "$dynamicRef": "#meta" }
}
}
Loading

0 comments on commit 55b57d0

Please sign in to comment.