@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.
Files changed (202) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +459 -120
  3. package/draft-04/additionalItems.js +29 -0
  4. package/{lib/keywords → draft-04}/dependencies.js +9 -5
  5. package/draft-04/exclusiveMaximum.js +5 -0
  6. package/draft-04/exclusiveMinimum.js +5 -0
  7. package/draft-04/id.js +1 -0
  8. package/draft-04/index.d.ts +43 -0
  9. package/draft-04/index.js +69 -0
  10. package/draft-04/items.js +35 -0
  11. package/draft-04/maximum.js +26 -0
  12. package/draft-04/minimum.js +25 -0
  13. package/draft-04/ref.js +1 -0
  14. package/draft-04/schema.js +149 -0
  15. package/draft-06/contains.js +13 -0
  16. package/draft-06/index.d.ts +47 -0
  17. package/draft-06/index.js +66 -0
  18. package/draft-06/schema.js +154 -0
  19. package/{lib/draft-07.d.ts → draft-07/index.d.ts} +21 -19
  20. package/draft-07/index.js +72 -0
  21. package/draft-07/schema.js +172 -0
  22. package/{lib/keywords/contains-minContains-maxContains.js → draft-2019-09/contains.js} +14 -7
  23. package/{lib/draft-2019-09.d.ts → draft-2019-09/index.d.ts} +24 -22
  24. package/draft-2019-09/index.js +117 -0
  25. package/draft-2019-09/meta/applicator.js +55 -0
  26. package/draft-2019-09/meta/content.js +17 -0
  27. package/draft-2019-09/meta/core.js +57 -0
  28. package/draft-2019-09/meta/format.js +14 -0
  29. package/draft-2019-09/meta/meta-data.js +37 -0
  30. package/draft-2019-09/meta/validation.js +98 -0
  31. package/draft-2019-09/recursiveAnchor.js +1 -0
  32. package/draft-2019-09/recursiveRef.js +19 -0
  33. package/draft-2019-09/schema.js +42 -0
  34. package/draft-2020-12/dynamicAnchor.js +1 -0
  35. package/draft-2020-12/dynamicRef.js +35 -0
  36. package/draft-2020-12/index.d.ts +66 -0
  37. package/draft-2020-12/index.js +124 -0
  38. package/draft-2020-12/meta/applicator.js +46 -0
  39. package/draft-2020-12/meta/content.js +14 -0
  40. package/draft-2020-12/meta/core.js +54 -0
  41. package/draft-2020-12/meta/format-annotation.js +11 -0
  42. package/draft-2020-12/meta/format-assertion.js +11 -0
  43. package/draft-2020-12/meta/meta-data.js +34 -0
  44. package/draft-2020-12/meta/unevaluated.js +12 -0
  45. package/draft-2020-12/meta/validation.js +95 -0
  46. package/draft-2020-12/schema.js +44 -0
  47. package/lib/common.d.ts +5 -1
  48. package/lib/common.js +80 -9
  49. package/lib/configuration.d.ts +9 -0
  50. package/lib/configuration.js +18 -0
  51. package/lib/core.d.ts +48 -0
  52. package/lib/core.js +102 -0
  53. package/lib/experimental.d.ts +8 -0
  54. package/lib/experimental.js +4 -0
  55. package/lib/fetch.browser.js +1 -0
  56. package/lib/fetch.js +19 -0
  57. package/lib/index.d.ts +11 -42
  58. package/lib/index.js +130 -23
  59. package/lib/instance.d.ts +75 -0
  60. package/lib/instance.js +58 -0
  61. package/lib/invalid-schema-error.d.ts +8 -0
  62. package/lib/invalid-schema-error.js +7 -0
  63. package/lib/keywords/additionalProperties.js +19 -17
  64. package/lib/keywords/allOf.js +10 -7
  65. package/lib/keywords/anchor.js +1 -0
  66. package/lib/keywords/anyOf.js +10 -7
  67. package/lib/keywords/comment.js +4 -0
  68. package/lib/keywords/const.js +6 -3
  69. package/lib/keywords/contains.js +48 -5
  70. package/lib/keywords/contentEncoding.js +4 -0
  71. package/lib/keywords/contentMediaType.js +4 -0
  72. package/lib/keywords/contentSchema.js +4 -0
  73. package/lib/keywords/default.js +4 -0
  74. package/lib/keywords/definitions.js +7 -4
  75. package/lib/keywords/dependentRequired.js +6 -3
  76. package/lib/keywords/dependentSchemas.js +10 -6
  77. package/lib/keywords/deprecated.js +4 -0
  78. package/lib/keywords/description.js +4 -0
  79. package/lib/keywords/dynamicAnchor.js +1 -0
  80. package/lib/keywords/dynamicRef.js +13 -17
  81. package/lib/keywords/else.js +16 -11
  82. package/lib/keywords/enum.js +6 -3
  83. package/lib/keywords/examples.js +4 -0
  84. package/lib/keywords/exclusiveMaximum.js +5 -2
  85. package/lib/keywords/exclusiveMinimum.js +5 -2
  86. package/lib/keywords/format.js +4 -0
  87. package/lib/keywords/id.js +1 -0
  88. package/lib/keywords/if.js +8 -6
  89. package/lib/keywords/items.js +17 -19
  90. package/lib/keywords/maxContains.js +4 -0
  91. package/lib/keywords/maxItems.js +5 -2
  92. package/lib/keywords/maxLength.js +5 -2
  93. package/lib/keywords/maxProperties.js +5 -2
  94. package/lib/keywords/maximum.js +5 -2
  95. package/lib/keywords/meta-data.js +4 -0
  96. package/lib/keywords/minContains.js +4 -0
  97. package/lib/keywords/minItems.js +5 -2
  98. package/lib/keywords/minLength.js +5 -2
  99. package/lib/keywords/minProperties.js +5 -2
  100. package/lib/keywords/minimum.js +5 -2
  101. package/lib/keywords/multipleOf.js +5 -2
  102. package/lib/keywords/not.js +6 -4
  103. package/lib/keywords/oneOf.js +9 -6
  104. package/lib/keywords/pattern.js +5 -2
  105. package/lib/keywords/patternProperties.js +9 -5
  106. package/lib/keywords/prefixItems.js +28 -0
  107. package/lib/keywords/properties.js +11 -6
  108. package/lib/keywords/propertyDependencies.js +49 -0
  109. package/lib/keywords/propertyNames.js +7 -4
  110. package/lib/keywords/readOnly.js +4 -0
  111. package/lib/keywords/ref.js +9 -6
  112. package/lib/keywords/requireAllExcept.js +24 -0
  113. package/lib/keywords/required.js +5 -2
  114. package/lib/keywords/then.js +16 -11
  115. package/lib/keywords/title.js +4 -0
  116. package/lib/keywords/type.js +5 -2
  117. package/lib/keywords/unevaluatedItems.js +9 -5
  118. package/lib/keywords/unevaluatedProperties.js +9 -5
  119. package/lib/keywords/uniqueItems.js +6 -3
  120. package/lib/keywords/validation.js +123 -0
  121. package/lib/keywords/vocabulary.js +1 -0
  122. package/lib/keywords/writeOnly.js +4 -0
  123. package/lib/keywords.d.ts +19 -0
  124. package/lib/keywords.js +59 -0
  125. package/lib/media-types.d.ts +9 -0
  126. package/lib/media-types.js +26 -0
  127. package/lib/pubsub.js +42 -0
  128. package/lib/reference.d.ts +11 -0
  129. package/lib/reference.js +11 -0
  130. package/lib/schema.d.ts +64 -0
  131. package/lib/schema.js +308 -0
  132. package/package.json +31 -22
  133. package/{lib/draft-2020-12.d.ts → stable/index.d.ts} +26 -24
  134. package/stable/index.js +118 -0
  135. package/stable/meta/applicator.js +49 -0
  136. package/stable/meta/content.js +12 -0
  137. package/stable/meta/core.js +49 -0
  138. package/stable/meta/format-annotation.js +10 -0
  139. package/stable/meta/format-assertion.js +10 -0
  140. package/stable/meta/meta-data.js +16 -0
  141. package/stable/meta/unevaluated.js +11 -0
  142. package/stable/meta/validation.js +67 -0
  143. package/stable/validation.js +24 -0
  144. package/dist/json-schema-amd.js +0 -6602
  145. package/dist/json-schema-amd.js.map +0 -1
  146. package/dist/json-schema-amd.min.js +0 -3
  147. package/dist/json-schema-amd.min.js.map +0 -1
  148. package/dist/json-schema-cjs.js +0 -6600
  149. package/dist/json-schema-cjs.js.map +0 -1
  150. package/dist/json-schema-cjs.min.js +0 -3
  151. package/dist/json-schema-cjs.min.js.map +0 -1
  152. package/dist/json-schema-esm.js +0 -6596
  153. package/dist/json-schema-esm.js.map +0 -1
  154. package/dist/json-schema-esm.min.js +0 -3
  155. package/dist/json-schema-esm.min.js.map +0 -1
  156. package/dist/json-schema-iife.js +0 -6605
  157. package/dist/json-schema-iife.js.map +0 -1
  158. package/dist/json-schema-iife.min.js +0 -3
  159. package/dist/json-schema-iife.min.js.map +0 -1
  160. package/dist/json-schema-system.js +0 -6603
  161. package/dist/json-schema-system.js.map +0 -1
  162. package/dist/json-schema-system.min.js +0 -3
  163. package/dist/json-schema-system.min.js.map +0 -1
  164. package/dist/json-schema-umd.js +0 -6606
  165. package/dist/json-schema-umd.js.map +0 -1
  166. package/dist/json-schema-umd.min.js +0 -3
  167. package/dist/json-schema-umd.min.js.map +0 -1
  168. package/lib/draft-04.d.ts +0 -41
  169. package/lib/draft-04.js +0 -46
  170. package/lib/draft-06.d.ts +0 -45
  171. package/lib/draft-06.js +0 -51
  172. package/lib/draft-07.js +0 -55
  173. package/lib/draft-2019-09.js +0 -92
  174. package/lib/draft-2020-12.js +0 -103
  175. package/lib/index.mjs +0 -19
  176. package/lib/keywords/additionalItems.js +0 -27
  177. package/lib/keywords/additionalItems6.js +0 -23
  178. package/lib/keywords/additionalProperties6.js +0 -28
  179. package/lib/keywords/index.js +0 -53
  180. package/lib/keywords/items202012.js +0 -23
  181. package/lib/keywords/maximum-exclusiveMaximum.js +0 -20
  182. package/lib/keywords/minimum-exclusiveMinimum.js +0 -20
  183. package/lib/keywords/tupleItems.js +0 -24
  184. package/meta/draft/2019-09/meta/applicator.js +0 -55
  185. package/meta/draft/2019-09/meta/content.js +0 -17
  186. package/meta/draft/2019-09/meta/core.js +0 -57
  187. package/meta/draft/2019-09/meta/format.js +0 -14
  188. package/meta/draft/2019-09/meta/meta-data.js +0 -37
  189. package/meta/draft/2019-09/meta/validation.js +0 -98
  190. package/meta/draft/2019-09/schema.js +0 -42
  191. package/meta/draft/2020-12/meta/applicator.js +0 -49
  192. package/meta/draft/2020-12/meta/content.js +0 -17
  193. package/meta/draft/2020-12/meta/core.js +0 -57
  194. package/meta/draft/2020-12/meta/format-annotation.js +0 -14
  195. package/meta/draft/2020-12/meta/format-assertion.js +0 -14
  196. package/meta/draft/2020-12/meta/meta-data.js +0 -37
  197. package/meta/draft/2020-12/meta/unevaluated.js +0 -15
  198. package/meta/draft/2020-12/meta/validation.js +0 -98
  199. package/meta/draft/2020-12/schema.js +0 -44
  200. package/meta/draft-04/schema.js +0 -149
  201. package/meta/draft-06/schema.js +0 -154
  202. package/meta/draft-07/schema.js +0 -172
@@ -1,9 +1,9 @@
1
- import type { Json } from "@hyperjump/json-schema-core";
2
- import type { JsonSchemaType } from "./common";
1
+ import type { Json } from "@hyperjump/json-pointer";
2
+ import type { JsonSchemaType } from "../lib/common.js";
3
3
 
4
4
 
5
- export type Draft202012Schema = boolean | {
6
- $schema?: "https://json-schema.org/draft/2020-12/schema";
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, Draft202012Schema>;
15
- additionalItems?: Draft202012Schema;
16
- unevaluatedItems?: Draft202012Schema;
17
- prefixItems?: Draft202012Schema[];
18
- items?: Draft202012Schema;
19
- contains?: Draft202012Schema;
20
- additionalProperties?: Draft202012Schema;
21
- unevaluatedProperties?: Draft202012Schema;
22
- properties?: Record<string, Draft202012Schema>;
23
- patternProperties?: Record<string, Draft202012Schema>;
24
- dependentSchemas?: Record<string, Draft202012Schema>;
25
- propertyNames?: Draft202012Schema;
26
- if?: Draft202012Schema;
27
- then?: Draft202012Schema;
28
- else?: Draft202012Schema;
29
- allOf?: Draft202012Schema[];
30
- anyOf?: Draft202012Schema[];
31
- oneOf?: Draft202012Schema[];
32
- not?: Draft202012Schema;
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?: Draft202012Schema;
63
+ contentSchema?: JsonSchema;
64
64
  };
65
+
66
+ export * from "../lib/index.js";
@@ -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,10 @@
1
+ export default {
2
+ "$id": "https://json-schema.org/meta/format-annotation",
3
+ "title": "Format vocabulary meta-schema for annotation results",
4
+
5
+ "$dynamicAnchor": "meta",
6
+
7
+ "properties": {
8
+ "format": { "type": "string" }
9
+ }
10
+ };
@@ -0,0 +1,10 @@
1
+ export default {
2
+ "$id": "https://json-schema.org/meta/format-assertion",
3
+ "title": "Format vocabulary meta-schema for assertion results",
4
+
5
+ "$dynamicAnchor": "meta",
6
+
7
+ "properties": {
8
+ "format": { "type": "string" }
9
+ }
10
+ };
@@ -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
+ };