@hyperjump/json-schema 0.23.3 → 1.0.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 +1 -1
- package/README.md +459 -120
- package/draft-04/additionalItems.js +29 -0
- package/{lib/keywords → draft-04}/dependencies.js +9 -5
- package/draft-04/exclusiveMaximum.js +5 -0
- package/draft-04/exclusiveMinimum.js +5 -0
- package/draft-04/id.js +1 -0
- package/draft-04/index.d.ts +43 -0
- package/draft-04/index.js +69 -0
- package/draft-04/items.js +35 -0
- package/draft-04/maximum.js +26 -0
- package/draft-04/minimum.js +25 -0
- package/draft-04/ref.js +1 -0
- package/draft-04/schema.js +149 -0
- package/draft-06/contains.js +13 -0
- package/draft-06/index.d.ts +47 -0
- package/draft-06/index.js +66 -0
- package/draft-06/schema.js +154 -0
- package/{lib/draft-07.d.ts → draft-07/index.d.ts} +21 -19
- package/draft-07/index.js +72 -0
- package/draft-07/schema.js +172 -0
- package/{lib/keywords/contains-minContains-maxContains.js → draft-2019-09/contains.js} +14 -7
- package/{lib/draft-2019-09.d.ts → draft-2019-09/index.d.ts} +24 -22
- package/draft-2019-09/index.js +117 -0
- package/draft-2019-09/meta/applicator.js +55 -0
- package/draft-2019-09/meta/content.js +17 -0
- package/draft-2019-09/meta/core.js +57 -0
- package/draft-2019-09/meta/format.js +14 -0
- package/draft-2019-09/meta/meta-data.js +37 -0
- package/draft-2019-09/meta/validation.js +98 -0
- package/draft-2019-09/recursiveAnchor.js +1 -0
- package/draft-2019-09/recursiveRef.js +19 -0
- package/draft-2019-09/schema.js +42 -0
- package/draft-2020-12/dynamicAnchor.js +1 -0
- package/draft-2020-12/dynamicRef.js +35 -0
- package/draft-2020-12/index.d.ts +66 -0
- package/draft-2020-12/index.js +124 -0
- package/draft-2020-12/meta/applicator.js +46 -0
- package/draft-2020-12/meta/content.js +14 -0
- package/draft-2020-12/meta/core.js +54 -0
- package/draft-2020-12/meta/format-annotation.js +11 -0
- package/draft-2020-12/meta/format-assertion.js +11 -0
- package/draft-2020-12/meta/meta-data.js +34 -0
- package/draft-2020-12/meta/unevaluated.js +12 -0
- package/draft-2020-12/meta/validation.js +95 -0
- package/draft-2020-12/schema.js +44 -0
- package/lib/common.d.ts +5 -1
- package/lib/common.js +80 -9
- package/lib/configuration.d.ts +9 -0
- package/lib/configuration.js +18 -0
- package/lib/core.d.ts +48 -0
- package/lib/core.js +102 -0
- package/lib/experimental.d.ts +8 -0
- package/lib/experimental.js +4 -0
- package/lib/fetch.browser.js +1 -0
- package/lib/fetch.js +19 -0
- package/lib/index.d.ts +11 -42
- package/lib/index.js +130 -23
- package/lib/instance.d.ts +75 -0
- package/lib/instance.js +58 -0
- package/lib/invalid-schema-error.d.ts +8 -0
- package/lib/invalid-schema-error.js +7 -0
- package/lib/keywords/additionalProperties.js +19 -17
- package/lib/keywords/allOf.js +10 -7
- package/lib/keywords/anchor.js +1 -0
- package/lib/keywords/anyOf.js +10 -7
- package/lib/keywords/comment.js +4 -0
- package/lib/keywords/const.js +6 -3
- package/lib/keywords/contains.js +48 -5
- package/lib/keywords/contentEncoding.js +4 -0
- package/lib/keywords/contentMediaType.js +4 -0
- package/lib/keywords/contentSchema.js +4 -0
- package/lib/keywords/default.js +4 -0
- package/lib/keywords/definitions.js +7 -4
- package/lib/keywords/dependentRequired.js +6 -3
- package/lib/keywords/dependentSchemas.js +10 -6
- package/lib/keywords/deprecated.js +4 -0
- package/lib/keywords/description.js +4 -0
- package/lib/keywords/dynamicAnchor.js +1 -0
- package/lib/keywords/dynamicRef.js +13 -17
- package/lib/keywords/else.js +16 -11
- package/lib/keywords/enum.js +6 -3
- package/lib/keywords/examples.js +4 -0
- package/lib/keywords/exclusiveMaximum.js +5 -2
- package/lib/keywords/exclusiveMinimum.js +5 -2
- package/lib/keywords/format.js +4 -0
- package/lib/keywords/id.js +1 -0
- package/lib/keywords/if.js +8 -6
- package/lib/keywords/items.js +17 -19
- package/lib/keywords/maxContains.js +4 -0
- package/lib/keywords/maxItems.js +5 -2
- package/lib/keywords/maxLength.js +5 -2
- package/lib/keywords/maxProperties.js +5 -2
- package/lib/keywords/maximum.js +5 -2
- package/lib/keywords/meta-data.js +4 -0
- package/lib/keywords/minContains.js +4 -0
- package/lib/keywords/minItems.js +5 -2
- package/lib/keywords/minLength.js +5 -2
- package/lib/keywords/minProperties.js +5 -2
- package/lib/keywords/minimum.js +5 -2
- package/lib/keywords/multipleOf.js +5 -2
- package/lib/keywords/not.js +6 -4
- package/lib/keywords/oneOf.js +9 -6
- package/lib/keywords/pattern.js +5 -2
- package/lib/keywords/patternProperties.js +9 -5
- package/lib/keywords/prefixItems.js +28 -0
- package/lib/keywords/properties.js +11 -6
- package/lib/keywords/propertyDependencies.js +49 -0
- package/lib/keywords/propertyNames.js +7 -4
- package/lib/keywords/readOnly.js +4 -0
- package/lib/keywords/ref.js +9 -6
- package/lib/keywords/requireAllExcept.js +24 -0
- package/lib/keywords/required.js +5 -2
- package/lib/keywords/then.js +16 -11
- package/lib/keywords/title.js +4 -0
- package/lib/keywords/type.js +5 -2
- package/lib/keywords/unevaluatedItems.js +9 -5
- package/lib/keywords/unevaluatedProperties.js +9 -5
- package/lib/keywords/uniqueItems.js +6 -3
- package/lib/keywords/validation.js +123 -0
- package/lib/keywords/vocabulary.js +1 -0
- package/lib/keywords/writeOnly.js +4 -0
- package/lib/keywords.d.ts +19 -0
- package/lib/keywords.js +59 -0
- package/lib/media-types.d.ts +9 -0
- package/lib/media-types.js +26 -0
- package/lib/pubsub.js +42 -0
- package/lib/reference.d.ts +11 -0
- package/lib/reference.js +11 -0
- package/lib/schema.d.ts +64 -0
- package/lib/schema.js +308 -0
- package/package.json +31 -22
- package/{lib/draft-2020-12.d.ts → stable/index.d.ts} +26 -24
- package/stable/index.js +118 -0
- package/stable/meta/applicator.js +49 -0
- package/stable/meta/content.js +12 -0
- package/stable/meta/core.js +49 -0
- package/stable/meta/format-annotation.js +10 -0
- package/stable/meta/format-assertion.js +10 -0
- package/stable/meta/meta-data.js +16 -0
- package/stable/meta/unevaluated.js +11 -0
- package/stable/meta/validation.js +67 -0
- package/stable/validation.js +24 -0
- package/dist/json-schema-amd.js +0 -6602
- package/dist/json-schema-amd.js.map +0 -1
- package/dist/json-schema-amd.min.js +0 -3
- package/dist/json-schema-amd.min.js.map +0 -1
- package/dist/json-schema-cjs.js +0 -6600
- package/dist/json-schema-cjs.js.map +0 -1
- package/dist/json-schema-cjs.min.js +0 -3
- package/dist/json-schema-cjs.min.js.map +0 -1
- package/dist/json-schema-esm.js +0 -6596
- package/dist/json-schema-esm.js.map +0 -1
- package/dist/json-schema-esm.min.js +0 -3
- package/dist/json-schema-esm.min.js.map +0 -1
- package/dist/json-schema-iife.js +0 -6605
- package/dist/json-schema-iife.js.map +0 -1
- package/dist/json-schema-iife.min.js +0 -3
- package/dist/json-schema-iife.min.js.map +0 -1
- package/dist/json-schema-system.js +0 -6603
- package/dist/json-schema-system.js.map +0 -1
- package/dist/json-schema-system.min.js +0 -3
- package/dist/json-schema-system.min.js.map +0 -1
- package/dist/json-schema-umd.js +0 -6606
- package/dist/json-schema-umd.js.map +0 -1
- package/dist/json-schema-umd.min.js +0 -3
- package/dist/json-schema-umd.min.js.map +0 -1
- package/lib/draft-04.d.ts +0 -41
- package/lib/draft-04.js +0 -46
- package/lib/draft-06.d.ts +0 -45
- package/lib/draft-06.js +0 -51
- package/lib/draft-07.js +0 -55
- package/lib/draft-2019-09.js +0 -92
- package/lib/draft-2020-12.js +0 -103
- package/lib/index.mjs +0 -19
- package/lib/keywords/additionalItems.js +0 -27
- package/lib/keywords/additionalItems6.js +0 -23
- package/lib/keywords/additionalProperties6.js +0 -28
- package/lib/keywords/index.js +0 -53
- package/lib/keywords/items202012.js +0 -23
- package/lib/keywords/maximum-exclusiveMaximum.js +0 -20
- package/lib/keywords/minimum-exclusiveMinimum.js +0 -20
- package/lib/keywords/tupleItems.js +0 -24
- package/meta/draft/2019-09/meta/applicator.js +0 -55
- package/meta/draft/2019-09/meta/content.js +0 -17
- package/meta/draft/2019-09/meta/core.js +0 -57
- package/meta/draft/2019-09/meta/format.js +0 -14
- package/meta/draft/2019-09/meta/meta-data.js +0 -37
- package/meta/draft/2019-09/meta/validation.js +0 -98
- package/meta/draft/2019-09/schema.js +0 -42
- package/meta/draft/2020-12/meta/applicator.js +0 -49
- package/meta/draft/2020-12/meta/content.js +0 -17
- package/meta/draft/2020-12/meta/core.js +0 -57
- package/meta/draft/2020-12/meta/format-annotation.js +0 -14
- package/meta/draft/2020-12/meta/format-assertion.js +0 -14
- package/meta/draft/2020-12/meta/meta-data.js +0 -37
- package/meta/draft/2020-12/meta/unevaluated.js +0 -15
- package/meta/draft/2020-12/meta/validation.js +0 -98
- package/meta/draft/2020-12/schema.js +0 -44
- package/meta/draft-04/schema.js +0 -149
- package/meta/draft-06/schema.js +0 -154
- package/meta/draft-07/schema.js +0 -172
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Json } from "@hyperjump/json-
|
|
2
|
-
import type { JsonSchemaType } from "
|
|
1
|
+
import type { Json } from "@hyperjump/json-pointer";
|
|
2
|
+
import type { JsonSchemaType } from "../lib/common.js";
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
export type
|
|
6
|
-
$schema?: "https://json-schema.org/
|
|
5
|
+
export type JsonSchema = boolean | {
|
|
6
|
+
$schema?: "https://json-schema.org/validation";
|
|
7
7
|
$id?: string;
|
|
8
8
|
$anchor?: string;
|
|
9
9
|
$ref?: string;
|
|
@@ -11,25 +11,25 @@ export type Draft202012Schema = boolean | {
|
|
|
11
11
|
$dynamicAnchor?: string;
|
|
12
12
|
$vocabulary?: Record<string, boolean>;
|
|
13
13
|
$comment?: string;
|
|
14
|
-
$defs?: Record<string,
|
|
15
|
-
additionalItems?:
|
|
16
|
-
unevaluatedItems?:
|
|
17
|
-
prefixItems?:
|
|
18
|
-
items?:
|
|
19
|
-
contains?:
|
|
20
|
-
additionalProperties?:
|
|
21
|
-
unevaluatedProperties?:
|
|
22
|
-
properties?: Record<string,
|
|
23
|
-
patternProperties?: Record<string,
|
|
24
|
-
dependentSchemas?: Record<string,
|
|
25
|
-
propertyNames?:
|
|
26
|
-
if?:
|
|
27
|
-
then?:
|
|
28
|
-
else?:
|
|
29
|
-
allOf?:
|
|
30
|
-
anyOf?:
|
|
31
|
-
oneOf?:
|
|
32
|
-
not?:
|
|
14
|
+
$defs?: Record<string, JsonSchema>;
|
|
15
|
+
additionalItems?: JsonSchema;
|
|
16
|
+
unevaluatedItems?: JsonSchema;
|
|
17
|
+
prefixItems?: JsonSchema[];
|
|
18
|
+
items?: JsonSchema;
|
|
19
|
+
contains?: JsonSchema;
|
|
20
|
+
additionalProperties?: JsonSchema;
|
|
21
|
+
unevaluatedProperties?: JsonSchema;
|
|
22
|
+
properties?: Record<string, JsonSchema>;
|
|
23
|
+
patternProperties?: Record<string, JsonSchema>;
|
|
24
|
+
dependentSchemas?: Record<string, JsonSchema>;
|
|
25
|
+
propertyNames?: JsonSchema;
|
|
26
|
+
if?: JsonSchema;
|
|
27
|
+
then?: JsonSchema;
|
|
28
|
+
else?: JsonSchema;
|
|
29
|
+
allOf?: JsonSchema[];
|
|
30
|
+
anyOf?: JsonSchema[];
|
|
31
|
+
oneOf?: JsonSchema[];
|
|
32
|
+
not?: JsonSchema;
|
|
33
33
|
multipleOf?: number;
|
|
34
34
|
maximum?: number;
|
|
35
35
|
exclusiveMaximum?: number;
|
|
@@ -60,5 +60,7 @@ export type Draft202012Schema = boolean | {
|
|
|
60
60
|
format?: "date-time" | "date" | "time" | "duration" | "email" | "idn-email" | "hostname" | "idn-hostname" | "ipv4" | "ipv6" | "uri" | "uri-reference" | "iri" | "iri-reference" | "uuid" | "uri-template" | "json-pointer" | "relative-json-pointer" | "regex";
|
|
61
61
|
contentMediaType?: string;
|
|
62
62
|
contentEncoding?: string;
|
|
63
|
-
contentSchema?:
|
|
63
|
+
contentSchema?: JsonSchema;
|
|
64
64
|
};
|
|
65
|
+
|
|
66
|
+
export * from "../lib/index.js";
|
package/stable/index.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { defineVocabulary, loadDialect } from "../lib/keywords.js";
|
|
2
|
+
import { addSchema } from "../lib/core.js";
|
|
3
|
+
|
|
4
|
+
import metaSchema from "./validation.js";
|
|
5
|
+
import coreMetaSchema from "./meta/core.js";
|
|
6
|
+
import applicatorMetaSchema from "./meta/applicator.js";
|
|
7
|
+
import validationMetaSchema from "./meta/validation.js";
|
|
8
|
+
import metaDataMetaSchema from "./meta/meta-data.js";
|
|
9
|
+
import formatAnnotationMetaSchema from "./meta/format-annotation.js";
|
|
10
|
+
import formatAssertionMetaSchema from "./meta/format-assertion.js";
|
|
11
|
+
import contentMetaSchema from "./meta/content.js";
|
|
12
|
+
import unevaluatedMetaSchema from "./meta/unevaluated.js";
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
defineVocabulary("https://json-schema.org/vocab/core", {
|
|
16
|
+
"$anchor": "https://json-schema.org/keyword/anchor",
|
|
17
|
+
"$comment": "https://json-schema.org/keyword/comment",
|
|
18
|
+
"$defs": "https://json-schema.org/keyword/definitions",
|
|
19
|
+
"$dynamicAnchor": "https://json-schema.org/keyword/dynamicAnchor",
|
|
20
|
+
"$dynamicRef": "https://json-schema.org/keyword/dynamicRef",
|
|
21
|
+
"$id": "https://json-schema.org/keyword/id",
|
|
22
|
+
"$ref": "https://json-schema.org/keyword/ref",
|
|
23
|
+
"$vocabulary": "https://json-schema.org/keyword/vocabulary"
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
defineVocabulary("https://json-schema.org/vocab/applicator", {
|
|
27
|
+
"additionalProperties": "https://json-schema.org/keyword/additionalProperties",
|
|
28
|
+
"allOf": "https://json-schema.org/keyword/allOf",
|
|
29
|
+
"anyOf": "https://json-schema.org/keyword/anyOf",
|
|
30
|
+
"contains": "https://json-schema.org/keyword/contains",
|
|
31
|
+
"minContains": "https://json-schema.org/keyword/minContains",
|
|
32
|
+
"maxContains": "https://json-schema.org/keyword/maxContains",
|
|
33
|
+
"dependentSchemas": "https://json-schema.org/keyword/dependentSchemas",
|
|
34
|
+
"if": "https://json-schema.org/keyword/if",
|
|
35
|
+
"then": "https://json-schema.org/keyword/then",
|
|
36
|
+
"else": "https://json-schema.org/keyword/else",
|
|
37
|
+
"items": "https://json-schema.org/keyword/items",
|
|
38
|
+
"not": "https://json-schema.org/keyword/not",
|
|
39
|
+
"oneOf": "https://json-schema.org/keyword/oneOf",
|
|
40
|
+
"patternProperties": "https://json-schema.org/keyword/patternProperties",
|
|
41
|
+
"prefixItems": "https://json-schema.org/keyword/prefixItems",
|
|
42
|
+
"properties": "https://json-schema.org/keyword/properties",
|
|
43
|
+
"propertyDependencies": "https://json-schema.org/keyword/propertyDependencies",
|
|
44
|
+
"propertyNames": "https://json-schema.org/keyword/propertyNames"
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
defineVocabulary("https://json-schema.org/vocab/validation", {
|
|
48
|
+
"const": "https://json-schema.org/keyword/const",
|
|
49
|
+
"dependentRequired": "https://json-schema.org/keyword/dependentRequired",
|
|
50
|
+
"enum": "https://json-schema.org/keyword/enum",
|
|
51
|
+
"exclusiveMaximum": "https://json-schema.org/keyword/exclusiveMaximum",
|
|
52
|
+
"exclusiveMinimum": "https://json-schema.org/keyword/exclusiveMinimum",
|
|
53
|
+
"maxItems": "https://json-schema.org/keyword/maxItems",
|
|
54
|
+
"maxLength": "https://json-schema.org/keyword/maxLength",
|
|
55
|
+
"maxProperties": "https://json-schema.org/keyword/maxProperties",
|
|
56
|
+
"maximum": "https://json-schema.org/keyword/maximum",
|
|
57
|
+
"minItems": "https://json-schema.org/keyword/minItems",
|
|
58
|
+
"minLength": "https://json-schema.org/keyword/minLength",
|
|
59
|
+
"minProperties": "https://json-schema.org/keyword/minProperties",
|
|
60
|
+
"minimum": "https://json-schema.org/keyword/minimum",
|
|
61
|
+
"multipleOf": "https://json-schema.org/keyword/multipleOf",
|
|
62
|
+
"requireAllExcept": "https://json-schema.org/keyword/requireAllExcept",
|
|
63
|
+
"pattern": "https://json-schema.org/keyword/pattern",
|
|
64
|
+
"required": "https://json-schema.org/keyword/required",
|
|
65
|
+
"type": "https://json-schema.org/keyword/type",
|
|
66
|
+
"uniqueItems": "https://json-schema.org/keyword/uniqueItems"
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
defineVocabulary("https://json-schema.org/vocab/meta-data", {
|
|
70
|
+
"default": "https://json-schema.org/keyword/default",
|
|
71
|
+
"deprecated": "https://json-schema.org/keyword/deprecated",
|
|
72
|
+
"description": "https://json-schema.org/keyword/description",
|
|
73
|
+
"examples": "https://json-schema.org/keyword/examples",
|
|
74
|
+
"readOnly": "https://json-schema.org/keyword/readOnly",
|
|
75
|
+
"title": "https://json-schema.org/keyword/title",
|
|
76
|
+
"writeOnly": "https://json-schema.org/keyword/writeOnly"
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
defineVocabulary("https://json-schema.org/vocab/format-annotation", {
|
|
80
|
+
"format": "https://json-schema.org/keyword/format"
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
defineVocabulary("https://json-schema.org/vocab/format-assertion", {
|
|
84
|
+
"format": "https://json-schema.org/keyword/format-assertion"
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
defineVocabulary("https://json-schema.org/vocab/content", {
|
|
88
|
+
"contentEncoding": "https://json-schema.org/keyword/contentEncoding",
|
|
89
|
+
"contentMediaType": "https://json-schema.org/keyword/contentMediaType",
|
|
90
|
+
"contentSchema": "https://json-schema.org/keyword/contentSchema"
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
defineVocabulary("https://json-schema.org/vocab/unevaluated", {
|
|
94
|
+
"unevaluatedItems": "https://json-schema.org/keyword/unevaluatedItems",
|
|
95
|
+
"unevaluatedProperties": "https://json-schema.org/keyword/unevaluatedProperties"
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
loadDialect("https://json-schema.org/validation", {
|
|
99
|
+
"https://json-schema.org/vocab/core": true,
|
|
100
|
+
"https://json-schema.org/vocab/applicator": true,
|
|
101
|
+
"https://json-schema.org/vocab/validation": true,
|
|
102
|
+
"https://json-schema.org/vocab/meta-data": true,
|
|
103
|
+
"https://json-schema.org/vocab/format-annotation": true,
|
|
104
|
+
"https://json-schema.org/vocab/content": true,
|
|
105
|
+
"https://json-schema.org/vocab/unevaluated": true
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
addSchema(metaSchema);
|
|
109
|
+
addSchema(coreMetaSchema);
|
|
110
|
+
addSchema(applicatorMetaSchema);
|
|
111
|
+
addSchema(validationMetaSchema);
|
|
112
|
+
addSchema(metaDataMetaSchema);
|
|
113
|
+
addSchema(formatAnnotationMetaSchema);
|
|
114
|
+
addSchema(formatAssertionMetaSchema);
|
|
115
|
+
addSchema(contentMetaSchema);
|
|
116
|
+
addSchema(unevaluatedMetaSchema);
|
|
117
|
+
|
|
118
|
+
export * from "../lib/index.js";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"$id": "https://json-schema.org/meta/applicator",
|
|
3
|
+
"title": "Applicator vocabulary meta-schema",
|
|
4
|
+
|
|
5
|
+
"$dynamicAnchor": "meta",
|
|
6
|
+
|
|
7
|
+
"properties": {
|
|
8
|
+
"prefixItems": { "$ref": "#/$defs/schemaArray" },
|
|
9
|
+
"items": { "$dynamicRef": "meta" },
|
|
10
|
+
"contains": { "$dynamicRef": "meta" },
|
|
11
|
+
"additionalProperties": { "$dynamicRef": "meta" },
|
|
12
|
+
"properties": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": { "$dynamicRef": "meta" }
|
|
15
|
+
},
|
|
16
|
+
"patternProperties": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"additionalProperties": { "$dynamicRef": "meta" },
|
|
19
|
+
"propertyNames": { "format": "regex" }
|
|
20
|
+
},
|
|
21
|
+
"dependentSchemas": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"additionalProperties": { "$dynamicRef": "meta" }
|
|
24
|
+
},
|
|
25
|
+
"propertyDependencies": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"additionalProperties": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"additionalProperties": { "$dynamicRef": "meta" }
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"propertyNames": { "$dynamicRef": "meta" },
|
|
33
|
+
"if": { "$dynamicRef": "meta" },
|
|
34
|
+
"then": { "$dynamicRef": "meta" },
|
|
35
|
+
"else": { "$dynamicRef": "meta" },
|
|
36
|
+
"allOf": { "$ref": "#/$defs/schemaArray" },
|
|
37
|
+
"anyOf": { "$ref": "#/$defs/schemaArray" },
|
|
38
|
+
"oneOf": { "$ref": "#/$defs/schemaArray" },
|
|
39
|
+
"not": { "$dynamicRef": "meta" }
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
"$defs": {
|
|
43
|
+
"schemaArray": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"minItems": 1,
|
|
46
|
+
"items": { "$dynamicRef": "meta" }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"$id": "https://json-schema.org/meta/content",
|
|
3
|
+
"title": "Content vocabulary meta-schema",
|
|
4
|
+
|
|
5
|
+
"$dynamicAnchor": "meta",
|
|
6
|
+
|
|
7
|
+
"properties": {
|
|
8
|
+
"contentMediaType": { "type": "string" },
|
|
9
|
+
"contentEncoding": { "type": "string" },
|
|
10
|
+
"contentSchema": { "$dynamicRef": "meta" }
|
|
11
|
+
}
|
|
12
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"$id": "https://json-schema.org/meta/core",
|
|
3
|
+
"title": "Core vocabulary meta-schema",
|
|
4
|
+
|
|
5
|
+
"$dynamicAnchor": "meta",
|
|
6
|
+
|
|
7
|
+
"type": ["object", "boolean"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"$id": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"format": "uri-reference",
|
|
12
|
+
"$comment": "Non-empty fragments not allowed.",
|
|
13
|
+
"pattern": "^[^#]*#?$"
|
|
14
|
+
},
|
|
15
|
+
"$schema": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"format": "uri"
|
|
18
|
+
},
|
|
19
|
+
"$anchor": { "$ref": "#/$defs/anchor" },
|
|
20
|
+
"$ref": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"format": "uri-reference"
|
|
23
|
+
},
|
|
24
|
+
"$dynamicRef": { "$ref": "#/$defs/anchor" },
|
|
25
|
+
"$dynamicAnchor": { "$ref": "#/$defs/anchor" },
|
|
26
|
+
"$vocabulary": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"propertyNames": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"format": "uri"
|
|
31
|
+
},
|
|
32
|
+
"additionalProperties": {
|
|
33
|
+
"type": "boolean"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"$comment": { "type": "string" },
|
|
37
|
+
"$defs": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"additionalProperties": { "$dynamicRef": "meta" }
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
"$defs": {
|
|
44
|
+
"anchor": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"$id": "https://json-schema.org/meta/meta-data",
|
|
3
|
+
"title": "Meta-data vocabulary meta-schema",
|
|
4
|
+
|
|
5
|
+
"$dynamicAnchor": "meta",
|
|
6
|
+
|
|
7
|
+
"properties": {
|
|
8
|
+
"title": { "type": "string" },
|
|
9
|
+
"description": { "type": "string" },
|
|
10
|
+
"default": true,
|
|
11
|
+
"deprecated": { "type": "boolean" },
|
|
12
|
+
"readOnly": { "type": "boolean" },
|
|
13
|
+
"writeOnly": { "type": "boolean" },
|
|
14
|
+
"examples": { "type": "array" }
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"$id": "https://json-schema.org/meta/unevaluated",
|
|
3
|
+
"title": "Unevaluated applicator vocabulary meta-schema",
|
|
4
|
+
|
|
5
|
+
"$dynamicAnchor": "meta",
|
|
6
|
+
|
|
7
|
+
"properties": {
|
|
8
|
+
"unevaluatedItems": { "$dynamicRef": "meta" },
|
|
9
|
+
"unevaluatedProperties": { "$dynamicRef": "meta" }
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"$id": "https://json-schema.org/meta/validation",
|
|
3
|
+
"title": "Validation vocabulary meta-schema",
|
|
4
|
+
|
|
5
|
+
"$dynamicAnchor": "meta",
|
|
6
|
+
|
|
7
|
+
"properties": {
|
|
8
|
+
"multipleOf": {
|
|
9
|
+
"type": "number",
|
|
10
|
+
"exclusiveMinimum": 0
|
|
11
|
+
},
|
|
12
|
+
"maximum": { "type": "number" },
|
|
13
|
+
"exclusiveMaximum": { "type": "number" },
|
|
14
|
+
"minimum": { "type": "number" },
|
|
15
|
+
"exclusiveMinimum": { "type": "number" },
|
|
16
|
+
"maxLength": { "$ref": "#/$defs/nonNegativeInteger" },
|
|
17
|
+
"minLength": { "$ref": "#/$defs/nonNegativeInteger" },
|
|
18
|
+
"pattern": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"format": "regex"
|
|
21
|
+
},
|
|
22
|
+
"maxItems": { "$ref": "#/$defs/nonNegativeInteger" },
|
|
23
|
+
"minItems": { "$ref": "#/$defs/nonNegativeInteger" },
|
|
24
|
+
"uniqueItems": { "type": "boolean" },
|
|
25
|
+
"maxContains": { "$ref": "#/$defs/nonNegativeInteger" },
|
|
26
|
+
"minContains": { "$ref": "#/$defs/nonNegativeInteger" },
|
|
27
|
+
"maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },
|
|
28
|
+
"minProperties": { "$ref": "#/$defs/nonNegativeInteger" },
|
|
29
|
+
"required": { "$ref": "#/$defs/stringArray" },
|
|
30
|
+
"optional": { "$ref": "#/$defs/stringArray" },
|
|
31
|
+
"dependentRequired": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"additionalProperties": { "$ref": "#/$defs/stringArray" }
|
|
34
|
+
},
|
|
35
|
+
"const": true,
|
|
36
|
+
"enum": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": true
|
|
39
|
+
},
|
|
40
|
+
"type": {
|
|
41
|
+
"anyOf": [
|
|
42
|
+
{ "$ref": "#/$defs/simpleTypes" },
|
|
43
|
+
{
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": { "$ref": "#/$defs/simpleTypes" },
|
|
46
|
+
"minItems": 1,
|
|
47
|
+
"uniqueItems": true
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
"$defs": {
|
|
54
|
+
"nonNegativeInteger": {
|
|
55
|
+
"type": "integer",
|
|
56
|
+
"minimum": 0
|
|
57
|
+
},
|
|
58
|
+
"simpleTypes": {
|
|
59
|
+
"enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
|
|
60
|
+
},
|
|
61
|
+
"stringArray": {
|
|
62
|
+
"type": "array",
|
|
63
|
+
"items": { "type": "string" },
|
|
64
|
+
"uniqueItems": true
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"$id": "https://json-schema.org/validation",
|
|
3
|
+
"$vocabulary": {
|
|
4
|
+
"https://json-schema.org/vocab/core": true,
|
|
5
|
+
"https://json-schema.org/vocab/applicator": true,
|
|
6
|
+
"https://json-schema.org/vocab/unevaluated": true,
|
|
7
|
+
"https://json-schema.org/vocab/validation": true,
|
|
8
|
+
"https://json-schema.org/vocab/meta-data": true,
|
|
9
|
+
"https://json-schema.org/vocab/format-annotation": true,
|
|
10
|
+
"https://json-schema.org/vocab/content": true
|
|
11
|
+
},
|
|
12
|
+
"title": "Core and Validation specifications meta-schema",
|
|
13
|
+
|
|
14
|
+
"$dynamicAnchor": "meta",
|
|
15
|
+
|
|
16
|
+
"allOf": [
|
|
17
|
+
{ "$ref": "meta/core" },
|
|
18
|
+
{ "$ref": "meta/applicator" },
|
|
19
|
+
{ "$ref": "meta/validation" },
|
|
20
|
+
{ "$ref": "meta/meta-data" },
|
|
21
|
+
{ "$ref": "meta/format-annotation" },
|
|
22
|
+
{ "$ref": "meta/content" }
|
|
23
|
+
]
|
|
24
|
+
};
|