@hyperjump/json-schema 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +176 -0
- package/dist/json-schema-amd.js +4710 -0
- package/dist/json-schema-amd.js.map +1 -0
- package/dist/json-schema-amd.min.js +2 -0
- package/dist/json-schema-amd.min.js.map +1 -0
- package/dist/json-schema-cjs.js +4708 -0
- package/dist/json-schema-cjs.js.map +1 -0
- package/dist/json-schema-cjs.min.js +2 -0
- package/dist/json-schema-cjs.min.js.map +1 -0
- package/dist/json-schema-esm.js +4691 -0
- package/dist/json-schema-esm.js.map +1 -0
- package/dist/json-schema-esm.min.js +2 -0
- package/dist/json-schema-esm.min.js.map +1 -0
- package/dist/json-schema-iife.js +4713 -0
- package/dist/json-schema-iife.js.map +1 -0
- package/dist/json-schema-iife.min.js +2 -0
- package/dist/json-schema-iife.min.js.map +1 -0
- package/dist/json-schema-system.js +4698 -0
- package/dist/json-schema-system.js.map +1 -0
- package/dist/json-schema-system.min.js +2 -0
- package/dist/json-schema-system.min.js.map +1 -0
- package/dist/json-schema-umd.js +4714 -0
- package/dist/json-schema-umd.js.map +1 -0
- package/dist/json-schema-umd.min.js +2 -0
- package/dist/json-schema-umd.min.js.map +1 -0
- package/lib/common.js +13 -0
- package/lib/draft-04.d.ts +40 -0
- package/lib/draft-04.js +94 -0
- package/lib/draft-06.d.ts +44 -0
- package/lib/draft-06.js +51 -0
- package/lib/draft-07.d.ts +52 -0
- package/lib/draft-07.js +55 -0
- package/lib/draft-2019-09.d.ts +62 -0
- package/lib/draft-2019-09.js +92 -0
- package/lib/draft-2020-12.d.ts +62 -0
- package/lib/draft-2020-12.js +103 -0
- package/lib/index.d.ts +28 -0
- package/lib/index.js +26 -0
- package/lib/index.mjs +18 -0
- package/lib/keywords/additionalItems.js +27 -0
- package/lib/keywords/additionalItems6.js +23 -0
- package/lib/keywords/additionalProperties.js +33 -0
- package/lib/keywords/additionalProperties6.js +28 -0
- package/lib/keywords/allOf.js +28 -0
- package/lib/keywords/anyOf.js +29 -0
- package/lib/keywords/const.js +8 -0
- package/lib/keywords/contains-minContains-maxContains.js +33 -0
- package/lib/keywords/contains.js +10 -0
- package/lib/keywords/definitions.js +15 -0
- package/lib/keywords/dependencies.js +29 -0
- package/lib/keywords/dependentRequired.js +19 -0
- package/lib/keywords/dependentSchemas.js +30 -0
- package/lib/keywords/dynamicRef.js +24 -0
- package/lib/keywords/else.js +43 -0
- package/lib/keywords/enum.js +8 -0
- package/lib/keywords/exclusiveMaximum.js +7 -0
- package/lib/keywords/exclusiveMinimum.js +7 -0
- package/lib/keywords/if.js +19 -0
- package/lib/keywords/index.js +55 -0
- package/lib/keywords/items.js +31 -0
- package/lib/keywords/items202012.js +23 -0
- package/lib/keywords/maxItems.js +7 -0
- package/lib/keywords/maxLength.js +7 -0
- package/lib/keywords/maxLength6.js +7 -0
- package/lib/keywords/maxProperties.js +7 -0
- package/lib/keywords/maximum-exclusiveMaximum.js +20 -0
- package/lib/keywords/maximum.js +7 -0
- package/lib/keywords/minItems.js +7 -0
- package/lib/keywords/minLength.js +7 -0
- package/lib/keywords/minLength6.js +7 -0
- package/lib/keywords/minProperties.js +7 -0
- package/lib/keywords/minimum-exclusiveMinimum.js +20 -0
- package/lib/keywords/minimum.js +7 -0
- package/lib/keywords/multipleOf.js +17 -0
- package/lib/keywords/not.js +7 -0
- package/lib/keywords/oneOf.js +48 -0
- package/lib/keywords/pattern.js +7 -0
- package/lib/keywords/patternProperties.js +23 -0
- package/lib/keywords/properties.js +25 -0
- package/lib/keywords/propertyNames.js +11 -0
- package/lib/keywords/ref.js +13 -0
- package/lib/keywords/required.js +10 -0
- package/lib/keywords/then.js +43 -0
- package/lib/keywords/tupleItems.js +24 -0
- package/lib/keywords/type.js +7 -0
- package/lib/keywords/unevaluatedItems.js +23 -0
- package/lib/keywords/unevaluatedProperties.js +24 -0
- package/lib/keywords/uniqueItems.js +16 -0
- package/meta/draft/2019-09/meta/applicator.js +55 -0
- package/meta/draft/2019-09/meta/content.js +17 -0
- package/meta/draft/2019-09/meta/core.js +57 -0
- package/meta/draft/2019-09/meta/format.js +14 -0
- package/meta/draft/2019-09/meta/meta-data.js +37 -0
- package/meta/draft/2019-09/meta/validation.js +98 -0
- package/meta/draft/2019-09/schema.js +42 -0
- package/meta/draft/2020-12/meta/applicator.js +49 -0
- package/meta/draft/2020-12/meta/content.js +17 -0
- package/meta/draft/2020-12/meta/core.js +57 -0
- package/meta/draft/2020-12/meta/format-annotation.js +14 -0
- package/meta/draft/2020-12/meta/format-assertion.js +14 -0
- package/meta/draft/2020-12/meta/meta-data.js +37 -0
- package/meta/draft/2020-12/meta/unevaluated.js +15 -0
- package/meta/draft/2020-12/meta/validation.js +98 -0
- package/meta/draft/2020-12/schema.js +44 -0
- package/meta/draft-04/hyper-schema.js +136 -0
- package/meta/draft-04/schema.js +149 -0
- package/meta/draft-06/schema.js +154 -0
- package/meta/draft-07/schema.js +172 -0
- package/package.json +57 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
module.exports = `{
|
|
2
|
+
"$id": "https://json-schema.org/draft/2019-09/meta/validation",
|
|
3
|
+
"$schema": "https://json-schema.org/draft/2019-09/schema",
|
|
4
|
+
"$vocabulary": {
|
|
5
|
+
"https://json-schema.org/draft/2019-09/vocab/validation": true
|
|
6
|
+
},
|
|
7
|
+
"$recursiveAnchor": true,
|
|
8
|
+
|
|
9
|
+
"title": "Validation vocabulary meta-schema",
|
|
10
|
+
"type": ["object", "boolean"],
|
|
11
|
+
"properties": {
|
|
12
|
+
"multipleOf": {
|
|
13
|
+
"type": "number",
|
|
14
|
+
"exclusiveMinimum": 0
|
|
15
|
+
},
|
|
16
|
+
"maximum": {
|
|
17
|
+
"type": "number"
|
|
18
|
+
},
|
|
19
|
+
"exclusiveMaximum": {
|
|
20
|
+
"type": "number"
|
|
21
|
+
},
|
|
22
|
+
"minimum": {
|
|
23
|
+
"type": "number"
|
|
24
|
+
},
|
|
25
|
+
"exclusiveMinimum": {
|
|
26
|
+
"type": "number"
|
|
27
|
+
},
|
|
28
|
+
"maxLength": { "$ref": "#/$defs/nonNegativeInteger" },
|
|
29
|
+
"minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
|
|
30
|
+
"pattern": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"format": "regex"
|
|
33
|
+
},
|
|
34
|
+
"maxItems": { "$ref": "#/$defs/nonNegativeInteger" },
|
|
35
|
+
"minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
|
|
36
|
+
"uniqueItems": {
|
|
37
|
+
"type": "boolean",
|
|
38
|
+
"default": false
|
|
39
|
+
},
|
|
40
|
+
"maxContains": { "$ref": "#/$defs/nonNegativeInteger" },
|
|
41
|
+
"minContains": {
|
|
42
|
+
"$ref": "#/$defs/nonNegativeInteger",
|
|
43
|
+
"default": 1
|
|
44
|
+
},
|
|
45
|
+
"maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },
|
|
46
|
+
"minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
|
|
47
|
+
"required": { "$ref": "#/$defs/stringArray" },
|
|
48
|
+
"dependentRequired": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"additionalProperties": {
|
|
51
|
+
"$ref": "#/$defs/stringArray"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"const": true,
|
|
55
|
+
"enum": {
|
|
56
|
+
"type": "array",
|
|
57
|
+
"items": true
|
|
58
|
+
},
|
|
59
|
+
"type": {
|
|
60
|
+
"anyOf": [
|
|
61
|
+
{ "$ref": "#/$defs/simpleTypes" },
|
|
62
|
+
{
|
|
63
|
+
"type": "array",
|
|
64
|
+
"items": { "$ref": "#/$defs/simpleTypes" },
|
|
65
|
+
"minItems": 1,
|
|
66
|
+
"uniqueItems": true
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"$defs": {
|
|
72
|
+
"nonNegativeInteger": {
|
|
73
|
+
"type": "integer",
|
|
74
|
+
"minimum": 0
|
|
75
|
+
},
|
|
76
|
+
"nonNegativeIntegerDefault0": {
|
|
77
|
+
"$ref": "#/$defs/nonNegativeInteger",
|
|
78
|
+
"default": 0
|
|
79
|
+
},
|
|
80
|
+
"simpleTypes": {
|
|
81
|
+
"enum": [
|
|
82
|
+
"array",
|
|
83
|
+
"boolean",
|
|
84
|
+
"integer",
|
|
85
|
+
"null",
|
|
86
|
+
"number",
|
|
87
|
+
"object",
|
|
88
|
+
"string"
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"stringArray": {
|
|
92
|
+
"type": "array",
|
|
93
|
+
"items": { "type": "string" },
|
|
94
|
+
"uniqueItems": true,
|
|
95
|
+
"default": []
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}`;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
module.exports = `{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2019-09/schema",
|
|
3
|
+
"$id": "https://json-schema.org/draft/2019-09/schema",
|
|
4
|
+
"$vocabulary": {
|
|
5
|
+
"https://json-schema.org/draft/2019-09/vocab/core": true,
|
|
6
|
+
"https://json-schema.org/draft/2019-09/vocab/applicator": true,
|
|
7
|
+
"https://json-schema.org/draft/2019-09/vocab/validation": true,
|
|
8
|
+
"https://json-schema.org/draft/2019-09/vocab/meta-data": true,
|
|
9
|
+
"https://json-schema.org/draft/2019-09/vocab/format": false,
|
|
10
|
+
"https://json-schema.org/draft/2019-09/vocab/content": true
|
|
11
|
+
},
|
|
12
|
+
"$recursiveAnchor": true,
|
|
13
|
+
|
|
14
|
+
"title": "Core and Validation specifications meta-schema",
|
|
15
|
+
"allOf": [
|
|
16
|
+
{"$ref": "meta/core"},
|
|
17
|
+
{"$ref": "meta/applicator"},
|
|
18
|
+
{"$ref": "meta/validation"},
|
|
19
|
+
{"$ref": "meta/meta-data"},
|
|
20
|
+
{"$ref": "meta/format"},
|
|
21
|
+
{"$ref": "meta/content"}
|
|
22
|
+
],
|
|
23
|
+
"type": ["object", "boolean"],
|
|
24
|
+
"properties": {
|
|
25
|
+
"definitions": {
|
|
26
|
+
"$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.",
|
|
27
|
+
"type": "object",
|
|
28
|
+
"additionalProperties": { "$recursiveRef": "#" },
|
|
29
|
+
"default": {}
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"$comment": "\\"dependencies\\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \\"dependentSchemas\\" and \\"dependentRequired\\"",
|
|
33
|
+
"type": "object",
|
|
34
|
+
"additionalProperties": {
|
|
35
|
+
"anyOf": [
|
|
36
|
+
{ "$recursiveRef": "#" },
|
|
37
|
+
{ "$ref": "meta/validation#/$defs/stringArray" }
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}`;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
module.exports = `{
|
|
2
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/applicator",
|
|
3
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"$vocabulary": {
|
|
5
|
+
"https://json-schema.org/draft/2020-12/vocab/applicator": true
|
|
6
|
+
},
|
|
7
|
+
"$dynamicAnchor": "meta",
|
|
8
|
+
|
|
9
|
+
"title": "Applicator vocabulary meta-schema",
|
|
10
|
+
"type": ["object", "boolean"],
|
|
11
|
+
"properties": {
|
|
12
|
+
"prefixItems": { "$ref": "#/$defs/schemaArray" },
|
|
13
|
+
"items": { "$dynamicRef": "#meta" },
|
|
14
|
+
"contains": { "$dynamicRef": "#meta" },
|
|
15
|
+
"additionalProperties": { "$dynamicRef": "#meta" },
|
|
16
|
+
"properties": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"additionalProperties": { "$dynamicRef": "#meta" },
|
|
19
|
+
"default": {}
|
|
20
|
+
},
|
|
21
|
+
"patternProperties": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"additionalProperties": { "$dynamicRef": "#meta" },
|
|
24
|
+
"propertyNames": { "format": "regex" },
|
|
25
|
+
"default": {}
|
|
26
|
+
},
|
|
27
|
+
"dependentSchemas": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"additionalProperties": {
|
|
30
|
+
"$dynamicRef": "#meta"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"propertyNames": { "$dynamicRef": "#meta" },
|
|
34
|
+
"if": { "$dynamicRef": "#meta" },
|
|
35
|
+
"then": { "$dynamicRef": "#meta" },
|
|
36
|
+
"else": { "$dynamicRef": "#meta" },
|
|
37
|
+
"allOf": { "$ref": "#/$defs/schemaArray" },
|
|
38
|
+
"anyOf": { "$ref": "#/$defs/schemaArray" },
|
|
39
|
+
"oneOf": { "$ref": "#/$defs/schemaArray" },
|
|
40
|
+
"not": { "$dynamicRef": "#meta" }
|
|
41
|
+
},
|
|
42
|
+
"$defs": {
|
|
43
|
+
"schemaArray": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"minItems": 1,
|
|
46
|
+
"items": { "$dynamicRef": "#meta" }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}`;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module.exports = `{
|
|
2
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/content",
|
|
3
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"$vocabulary": {
|
|
5
|
+
"https://json-schema.org/draft/2020-12/vocab/content": true
|
|
6
|
+
},
|
|
7
|
+
"$dynamicAnchor": "meta",
|
|
8
|
+
|
|
9
|
+
"title": "Content vocabulary meta-schema",
|
|
10
|
+
|
|
11
|
+
"type": ["object", "boolean"],
|
|
12
|
+
"properties": {
|
|
13
|
+
"contentMediaType": { "type": "string" },
|
|
14
|
+
"contentEncoding": { "type": "string" },
|
|
15
|
+
"contentSchema": { "$dynamicRef": "#meta" }
|
|
16
|
+
}
|
|
17
|
+
}`;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
module.exports = `{
|
|
2
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/core",
|
|
3
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"$vocabulary": {
|
|
5
|
+
"https://json-schema.org/draft/2020-12/vocab/core": true
|
|
6
|
+
},
|
|
7
|
+
"$dynamicAnchor": "meta",
|
|
8
|
+
|
|
9
|
+
"title": "Core vocabulary meta-schema",
|
|
10
|
+
"type": ["object", "boolean"],
|
|
11
|
+
"properties": {
|
|
12
|
+
"$id": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"format": "uri-reference",
|
|
15
|
+
"$comment": "Non-empty fragments not allowed.",
|
|
16
|
+
"pattern": "^[^#]*#?$"
|
|
17
|
+
},
|
|
18
|
+
"$schema": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"format": "uri"
|
|
21
|
+
},
|
|
22
|
+
"$anchor": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"
|
|
25
|
+
},
|
|
26
|
+
"$ref": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"format": "uri-reference"
|
|
29
|
+
},
|
|
30
|
+
"$dynamicRef": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"format": "uri-reference"
|
|
33
|
+
},
|
|
34
|
+
"$dynamicAnchor": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"
|
|
37
|
+
},
|
|
38
|
+
"$vocabulary": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"propertyNames": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"format": "uri"
|
|
43
|
+
},
|
|
44
|
+
"additionalProperties": {
|
|
45
|
+
"type": "boolean"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"$comment": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"$defs": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"additionalProperties": { "$dynamicRef": "#meta" },
|
|
54
|
+
"default": {}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module.exports = `{
|
|
2
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/format-annotation",
|
|
3
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"$vocabulary": {
|
|
5
|
+
"https://json-schema.org/draft/2020-12/vocab/format-annotation": true
|
|
6
|
+
},
|
|
7
|
+
"$dynamicAnchor": "meta",
|
|
8
|
+
|
|
9
|
+
"title": "Format vocabulary meta-schema for annotation results",
|
|
10
|
+
"type": ["object", "boolean"],
|
|
11
|
+
"properties": {
|
|
12
|
+
"format": { "type": "string" }
|
|
13
|
+
}
|
|
14
|
+
}`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module.exports = `{
|
|
2
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/format-assertion",
|
|
3
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"$vocabulary": {
|
|
5
|
+
"https://json-schema.org/draft/2020-12/vocab/format-assertion": true
|
|
6
|
+
},
|
|
7
|
+
"$dynamicAnchor": "meta",
|
|
8
|
+
|
|
9
|
+
"title": "Format vocabulary meta-schema for assertion results",
|
|
10
|
+
"type": ["object", "boolean"],
|
|
11
|
+
"properties": {
|
|
12
|
+
"format": { "type": "string" }
|
|
13
|
+
}
|
|
14
|
+
}`;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module.exports = `{
|
|
2
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/meta-data",
|
|
3
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"$vocabulary": {
|
|
5
|
+
"https://json-schema.org/draft/2020-12/vocab/meta-data": true
|
|
6
|
+
},
|
|
7
|
+
"$dynamicAnchor": "meta",
|
|
8
|
+
|
|
9
|
+
"title": "Meta-data vocabulary meta-schema",
|
|
10
|
+
|
|
11
|
+
"type": ["object", "boolean"],
|
|
12
|
+
"properties": {
|
|
13
|
+
"title": {
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"description": {
|
|
17
|
+
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
"default": true,
|
|
20
|
+
"deprecated": {
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"default": false
|
|
23
|
+
},
|
|
24
|
+
"readOnly": {
|
|
25
|
+
"type": "boolean",
|
|
26
|
+
"default": false
|
|
27
|
+
},
|
|
28
|
+
"writeOnly": {
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"default": false
|
|
31
|
+
},
|
|
32
|
+
"examples": {
|
|
33
|
+
"type": "array",
|
|
34
|
+
"items": true
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module.exports = `{
|
|
2
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/unevaluated",
|
|
3
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"$vocabulary": {
|
|
5
|
+
"https://json-schema.org/draft/2020-12/vocab/unevaluated": true
|
|
6
|
+
},
|
|
7
|
+
"$dynamicAnchor": "meta",
|
|
8
|
+
|
|
9
|
+
"title": "Unevaluated applicator vocabulary meta-schema",
|
|
10
|
+
"type": ["object", "boolean"],
|
|
11
|
+
"properties": {
|
|
12
|
+
"unevaluatedItems": { "$dynamicRef": "#meta" },
|
|
13
|
+
"unevaluatedProperties": { "$dynamicRef": "#meta" }
|
|
14
|
+
}
|
|
15
|
+
}`;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
module.exports = `{
|
|
2
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/validation",
|
|
3
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"$vocabulary": {
|
|
5
|
+
"https://json-schema.org/draft/2020-12/vocab/validation": true
|
|
6
|
+
},
|
|
7
|
+
"$dynamicAnchor": "meta",
|
|
8
|
+
|
|
9
|
+
"title": "Validation vocabulary meta-schema",
|
|
10
|
+
"type": ["object", "boolean"],
|
|
11
|
+
"properties": {
|
|
12
|
+
"multipleOf": {
|
|
13
|
+
"type": "number",
|
|
14
|
+
"exclusiveMinimum": 0
|
|
15
|
+
},
|
|
16
|
+
"maximum": {
|
|
17
|
+
"type": "number"
|
|
18
|
+
},
|
|
19
|
+
"exclusiveMaximum": {
|
|
20
|
+
"type": "number"
|
|
21
|
+
},
|
|
22
|
+
"minimum": {
|
|
23
|
+
"type": "number"
|
|
24
|
+
},
|
|
25
|
+
"exclusiveMinimum": {
|
|
26
|
+
"type": "number"
|
|
27
|
+
},
|
|
28
|
+
"maxLength": { "$ref": "#/$defs/nonNegativeInteger" },
|
|
29
|
+
"minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
|
|
30
|
+
"pattern": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"format": "regex"
|
|
33
|
+
},
|
|
34
|
+
"maxItems": { "$ref": "#/$defs/nonNegativeInteger" },
|
|
35
|
+
"minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
|
|
36
|
+
"uniqueItems": {
|
|
37
|
+
"type": "boolean",
|
|
38
|
+
"default": false
|
|
39
|
+
},
|
|
40
|
+
"maxContains": { "$ref": "#/$defs/nonNegativeInteger" },
|
|
41
|
+
"minContains": {
|
|
42
|
+
"$ref": "#/$defs/nonNegativeInteger",
|
|
43
|
+
"default": 1
|
|
44
|
+
},
|
|
45
|
+
"maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },
|
|
46
|
+
"minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
|
|
47
|
+
"required": { "$ref": "#/$defs/stringArray" },
|
|
48
|
+
"dependentRequired": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"additionalProperties": {
|
|
51
|
+
"$ref": "#/$defs/stringArray"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"const": true,
|
|
55
|
+
"enum": {
|
|
56
|
+
"type": "array",
|
|
57
|
+
"items": true
|
|
58
|
+
},
|
|
59
|
+
"type": {
|
|
60
|
+
"anyOf": [
|
|
61
|
+
{ "$ref": "#/$defs/simpleTypes" },
|
|
62
|
+
{
|
|
63
|
+
"type": "array",
|
|
64
|
+
"items": { "$ref": "#/$defs/simpleTypes" },
|
|
65
|
+
"minItems": 1,
|
|
66
|
+
"uniqueItems": true
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"$defs": {
|
|
72
|
+
"nonNegativeInteger": {
|
|
73
|
+
"type": "integer",
|
|
74
|
+
"minimum": 0
|
|
75
|
+
},
|
|
76
|
+
"nonNegativeIntegerDefault0": {
|
|
77
|
+
"$ref": "#/$defs/nonNegativeInteger",
|
|
78
|
+
"default": 0
|
|
79
|
+
},
|
|
80
|
+
"simpleTypes": {
|
|
81
|
+
"enum": [
|
|
82
|
+
"array",
|
|
83
|
+
"boolean",
|
|
84
|
+
"integer",
|
|
85
|
+
"null",
|
|
86
|
+
"number",
|
|
87
|
+
"object",
|
|
88
|
+
"string"
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"stringArray": {
|
|
92
|
+
"type": "array",
|
|
93
|
+
"items": { "type": "string" },
|
|
94
|
+
"uniqueItems": true,
|
|
95
|
+
"default": []
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}`;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
module.exports = `{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"$vocabulary": {
|
|
5
|
+
"https://json-schema.org/draft/2020-12/vocab/core": true,
|
|
6
|
+
"https://json-schema.org/draft/2020-12/vocab/applicator": true,
|
|
7
|
+
"https://json-schema.org/draft/2020-12/vocab/unevaluated": true,
|
|
8
|
+
"https://json-schema.org/draft/2020-12/vocab/validation": true,
|
|
9
|
+
"https://json-schema.org/draft/2020-12/vocab/meta-data": true,
|
|
10
|
+
"https://json-schema.org/draft/2020-12/vocab/format-annotation": true,
|
|
11
|
+
"https://json-schema.org/draft/2020-12/vocab/content": true
|
|
12
|
+
},
|
|
13
|
+
"$dynamicAnchor": "meta",
|
|
14
|
+
|
|
15
|
+
"title": "Core and Validation specifications meta-schema",
|
|
16
|
+
"allOf": [
|
|
17
|
+
{"$ref": "meta/core"},
|
|
18
|
+
{"$ref": "meta/applicator"},
|
|
19
|
+
{"$ref": "meta/unevaluated"},
|
|
20
|
+
{"$ref": "meta/validation"},
|
|
21
|
+
{"$ref": "meta/meta-data"},
|
|
22
|
+
{"$ref": "meta/format-annotation"},
|
|
23
|
+
{"$ref": "meta/content"}
|
|
24
|
+
],
|
|
25
|
+
"type": ["object", "boolean"],
|
|
26
|
+
"properties": {
|
|
27
|
+
"definitions": {
|
|
28
|
+
"$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.",
|
|
29
|
+
"type": "object",
|
|
30
|
+
"additionalProperties": { "$dynamicRef": "#meta" },
|
|
31
|
+
"default": {}
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"$comment": "\\"dependencies\\" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to \\"dependentSchemas\\" and \\"dependentRequired\\"",
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": {
|
|
37
|
+
"anyOf": [
|
|
38
|
+
{ "$dynamicRef": "#meta" },
|
|
39
|
+
{ "$ref": "meta/validation#/$defs/stringArray" }
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}`;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
module.exports = `{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-04/hyper-schema#",
|
|
3
|
+
"id": "http://json-schema.org/draft-04/hyper-schema#",
|
|
4
|
+
"title": "JSON Hyper-Schema",
|
|
5
|
+
"allOf": [
|
|
6
|
+
{"$ref": "http://json-schema.org/draft-04/schema#"}
|
|
7
|
+
],
|
|
8
|
+
"properties": {
|
|
9
|
+
"additionalItems": {
|
|
10
|
+
"anyOf": [
|
|
11
|
+
{"type": "boolean"},
|
|
12
|
+
{"$ref": "#"}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
"additionalProperties": {
|
|
16
|
+
"anyOf": [
|
|
17
|
+
{"type": "boolean"},
|
|
18
|
+
{"$ref": "#"}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"additionalProperties": {
|
|
23
|
+
"anyOf": [
|
|
24
|
+
{"$ref": "#"},
|
|
25
|
+
{"type": "array"}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"items": {
|
|
30
|
+
"anyOf": [
|
|
31
|
+
{"$ref": "#"},
|
|
32
|
+
{"$ref": "#/definitions/schemaArray"}
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"definitions": {
|
|
36
|
+
"additionalProperties": {"$ref": "#"}
|
|
37
|
+
},
|
|
38
|
+
"patternProperties": {
|
|
39
|
+
"additionalProperties": {"$ref": "#"}
|
|
40
|
+
},
|
|
41
|
+
"properties": {
|
|
42
|
+
"additionalProperties": {"$ref": "#"}
|
|
43
|
+
},
|
|
44
|
+
"allOf": {"$ref": "#/definitions/schemaArray"},
|
|
45
|
+
"anyOf": {"$ref": "#/definitions/schemaArray"},
|
|
46
|
+
"oneOf": {"$ref": "#/definitions/schemaArray"},
|
|
47
|
+
"not": { "$ref": "#" },
|
|
48
|
+
|
|
49
|
+
"links": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"items": {"$ref": "#/definitions/linkDescription"}
|
|
52
|
+
},
|
|
53
|
+
"fragmentResolution": {
|
|
54
|
+
"type": "string"
|
|
55
|
+
},
|
|
56
|
+
"media": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"properties": {
|
|
59
|
+
"type": {
|
|
60
|
+
"description": "A media type, as described in RFC 2046",
|
|
61
|
+
"type": "string"
|
|
62
|
+
},
|
|
63
|
+
"binaryEncoding": {
|
|
64
|
+
"description": "A content encoding scheme, as described in RFC 2045",
|
|
65
|
+
"type": "string"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"pathStart": {
|
|
70
|
+
"description": "Instances' URIs must start with this value for this schema to apply to them",
|
|
71
|
+
"type": "string",
|
|
72
|
+
"format": "uri"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"definitions": {
|
|
76
|
+
"schemaArray": {
|
|
77
|
+
"type": "array",
|
|
78
|
+
"items": {"$ref": "#"}
|
|
79
|
+
},
|
|
80
|
+
"linkDescription": {
|
|
81
|
+
"title": "Link Description Object",
|
|
82
|
+
"type": "object",
|
|
83
|
+
"required": ["href", "rel"],
|
|
84
|
+
"properties": {
|
|
85
|
+
"href": {
|
|
86
|
+
"description": "a URI template, as defined by RFC 6570, with the addition of the $, ( and ) characters for pre-processing",
|
|
87
|
+
"type": "string"
|
|
88
|
+
},
|
|
89
|
+
"rel": {
|
|
90
|
+
"description": "relation to the target resource of the link",
|
|
91
|
+
"type": "string"
|
|
92
|
+
},
|
|
93
|
+
"title": {
|
|
94
|
+
"description": "a title for the link",
|
|
95
|
+
"type": "string"
|
|
96
|
+
},
|
|
97
|
+
"targetSchema": {
|
|
98
|
+
"description": "JSON Schema describing the link target",
|
|
99
|
+
"$ref": "#"
|
|
100
|
+
},
|
|
101
|
+
"mediaType": {
|
|
102
|
+
"description": "media type (as defined by RFC 2046) describing the link target",
|
|
103
|
+
"type": "string"
|
|
104
|
+
},
|
|
105
|
+
"method": {
|
|
106
|
+
"description": "method for requesting the target of the link (e.g. for HTTP this might be \\"GET\\" or \\"DELETE\\")",
|
|
107
|
+
"type": "string"
|
|
108
|
+
},
|
|
109
|
+
"encType": {
|
|
110
|
+
"description": "The media type in which to submit data along with the request",
|
|
111
|
+
"type": "string",
|
|
112
|
+
"default": "application/json"
|
|
113
|
+
},
|
|
114
|
+
"schema": {
|
|
115
|
+
"description": "Schema describing the data to submit along with the request",
|
|
116
|
+
"$ref": "#"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"readOnly": {
|
|
121
|
+
"description": "If true, indicates that the value of this property is controlled by the server.",
|
|
122
|
+
"type": "boolean",
|
|
123
|
+
"default": false
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"links": [
|
|
127
|
+
{
|
|
128
|
+
"rel": "self",
|
|
129
|
+
"href": "{+id}"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"rel": "full",
|
|
133
|
+
"href": "{+($ref)}"
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
}`;
|