json_skooma 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +22 -0
- data/LICENSE.txt +21 -0
- data/README.md +107 -0
- data/data/draft-2019-09/README.md +60 -0
- data/data/draft-2019-09/hyper-schema.json +26 -0
- data/data/draft-2019-09/links.json +91 -0
- data/data/draft-2019-09/meta/applicator.json +56 -0
- data/data/draft-2019-09/meta/content.json +17 -0
- data/data/draft-2019-09/meta/core.json +57 -0
- data/data/draft-2019-09/meta/format.json +14 -0
- data/data/draft-2019-09/meta/hyper-schema.json +29 -0
- data/data/draft-2019-09/meta/meta-data.json +37 -0
- data/data/draft-2019-09/meta/validation.json +98 -0
- data/data/draft-2019-09/output/hyper-schema.json +62 -0
- data/data/draft-2019-09/output/schema.json +86 -0
- data/data/draft-2019-09/output/verbose-example.json +130 -0
- data/data/draft-2019-09/schema.json +42 -0
- data/data/draft-2020-12/README.md +89 -0
- data/data/draft-2020-12/adr/README.md +15 -0
- data/data/draft-2020-12/archive/hyper-schema.json +28 -0
- data/data/draft-2020-12/archive/links.json +93 -0
- data/data/draft-2020-12/archive/meta/hyper-schema.json +30 -0
- data/data/draft-2020-12/hyper-schema.json +27 -0
- data/data/draft-2020-12/links.json +85 -0
- data/data/draft-2020-12/meta/applicator.json +48 -0
- data/data/draft-2020-12/meta/content.json +17 -0
- data/data/draft-2020-12/meta/core.json +51 -0
- data/data/draft-2020-12/meta/format-annotation.json +14 -0
- data/data/draft-2020-12/meta/format-assertion.json +14 -0
- data/data/draft-2020-12/meta/hyper-schema.json +29 -0
- data/data/draft-2020-12/meta/meta-data.json +37 -0
- data/data/draft-2020-12/meta/unevaluated.json +15 -0
- data/data/draft-2020-12/meta/validation.json +98 -0
- data/data/draft-2020-12/output/hyper-schema.json +62 -0
- data/data/draft-2020-12/output/schema.json +96 -0
- data/data/draft-2020-12/output/verbose-example.json +130 -0
- data/data/draft-2020-12/schema.json +58 -0
- data/lib/json_skooma/dialects/draft201909.rb +137 -0
- data/lib/json_skooma/dialects/draft202012.rb +146 -0
- data/lib/json_skooma/formatters.rb +135 -0
- data/lib/json_skooma/inflector.rb +13 -0
- data/lib/json_skooma/json_node.rb +100 -0
- data/lib/json_skooma/json_pointer.rb +79 -0
- data/lib/json_skooma/json_schema.rb +176 -0
- data/lib/json_skooma/keywords/applicator/additional_properties.rb +37 -0
- data/lib/json_skooma/keywords/applicator/all_of.rb +25 -0
- data/lib/json_skooma/keywords/applicator/any_of.rb +26 -0
- data/lib/json_skooma/keywords/applicator/contains.rb +31 -0
- data/lib/json_skooma/keywords/applicator/dependent_schemas.rb +35 -0
- data/lib/json_skooma/keywords/applicator/else.rb +22 -0
- data/lib/json_skooma/keywords/applicator/if.rb +17 -0
- data/lib/json_skooma/keywords/applicator/items.rb +36 -0
- data/lib/json_skooma/keywords/applicator/not.rb +19 -0
- data/lib/json_skooma/keywords/applicator/one_of.rb +35 -0
- data/lib/json_skooma/keywords/applicator/pattern_properties.rb +46 -0
- data/lib/json_skooma/keywords/applicator/prefix_items.rb +31 -0
- data/lib/json_skooma/keywords/applicator/properties.rb +34 -0
- data/lib/json_skooma/keywords/applicator/property_names.rb +25 -0
- data/lib/json_skooma/keywords/applicator/then.rb +22 -0
- data/lib/json_skooma/keywords/base.rb +74 -0
- data/lib/json_skooma/keywords/base_annotation.rb +12 -0
- data/lib/json_skooma/keywords/content/content_encoding.rb +12 -0
- data/lib/json_skooma/keywords/content/content_media_type.rb +12 -0
- data/lib/json_skooma/keywords/content/content_schema.rb +19 -0
- data/lib/json_skooma/keywords/core/anchor.rb +22 -0
- data/lib/json_skooma/keywords/core/comment.rb +12 -0
- data/lib/json_skooma/keywords/core/defs.rb +13 -0
- data/lib/json_skooma/keywords/core/dynamic_anchor.rb +22 -0
- data/lib/json_skooma/keywords/core/dynamic_ref.rb +67 -0
- data/lib/json_skooma/keywords/core/id.rb +28 -0
- data/lib/json_skooma/keywords/core/ref.rb +35 -0
- data/lib/json_skooma/keywords/core/schema.rb +26 -0
- data/lib/json_skooma/keywords/core/vocabulary.rb +34 -0
- data/lib/json_skooma/keywords/draft_2019_09/additional_items.rb +40 -0
- data/lib/json_skooma/keywords/draft_2019_09/items.rb +41 -0
- data/lib/json_skooma/keywords/draft_2019_09/recursive_anchor.rb +12 -0
- data/lib/json_skooma/keywords/draft_2019_09/recursive_ref.rb +46 -0
- data/lib/json_skooma/keywords/draft_2019_09/unevaluated_items.rb +56 -0
- data/lib/json_skooma/keywords/format_annotation/format.rb +27 -0
- data/lib/json_skooma/keywords/meta_data/default.rb +11 -0
- data/lib/json_skooma/keywords/meta_data/deprecated.rb +11 -0
- data/lib/json_skooma/keywords/meta_data/description.rb +11 -0
- data/lib/json_skooma/keywords/meta_data/examples.rb +11 -0
- data/lib/json_skooma/keywords/meta_data/read_only.rb +11 -0
- data/lib/json_skooma/keywords/meta_data/title.rb +11 -0
- data/lib/json_skooma/keywords/meta_data/write_only.rb +11 -0
- data/lib/json_skooma/keywords/unevaluated/unevaluated_items.rb +59 -0
- data/lib/json_skooma/keywords/unevaluated/unevaluated_properties.rb +43 -0
- data/lib/json_skooma/keywords/unknown.rb +21 -0
- data/lib/json_skooma/keywords/validation/const.rb +17 -0
- data/lib/json_skooma/keywords/validation/dependent_required.rb +24 -0
- data/lib/json_skooma/keywords/validation/enum.rb +19 -0
- data/lib/json_skooma/keywords/validation/exclusive_maximum.rb +18 -0
- data/lib/json_skooma/keywords/validation/exclusive_minimum.rb +18 -0
- data/lib/json_skooma/keywords/validation/max_contains.rb +24 -0
- data/lib/json_skooma/keywords/validation/max_items.rb +18 -0
- data/lib/json_skooma/keywords/validation/max_length.rb +18 -0
- data/lib/json_skooma/keywords/validation/max_properties.rb +18 -0
- data/lib/json_skooma/keywords/validation/maximum.rb +18 -0
- data/lib/json_skooma/keywords/validation/min_contains.rb +31 -0
- data/lib/json_skooma/keywords/validation/min_items.rb +18 -0
- data/lib/json_skooma/keywords/validation/min_length.rb +18 -0
- data/lib/json_skooma/keywords/validation/min_properties.rb +18 -0
- data/lib/json_skooma/keywords/validation/minimum.rb +18 -0
- data/lib/json_skooma/keywords/validation/multiple_of.rb +20 -0
- data/lib/json_skooma/keywords/validation/pattern.rb +23 -0
- data/lib/json_skooma/keywords/validation/required.rb +19 -0
- data/lib/json_skooma/keywords/validation/type.rb +26 -0
- data/lib/json_skooma/keywords/validation/unique_items.rb +20 -0
- data/lib/json_skooma/keywords/value_schemas.rb +87 -0
- data/lib/json_skooma/memoizable.rb +21 -0
- data/lib/json_skooma/metaschema.rb +32 -0
- data/lib/json_skooma/registry.rb +130 -0
- data/lib/json_skooma/result.rb +125 -0
- data/lib/json_skooma/sources.rb +55 -0
- data/lib/json_skooma/validators/base.rb +31 -0
- data/lib/json_skooma/validators/date.rb +18 -0
- data/lib/json_skooma/validators/date_time.rb +24 -0
- data/lib/json_skooma/validators/duration.rb +25 -0
- data/lib/json_skooma/validators/email.rb +36 -0
- data/lib/json_skooma/validators/hostname.rb +17 -0
- data/lib/json_skooma/validators/idn_email.rb +30 -0
- data/lib/json_skooma/validators/idn_hostname.rb +15 -0
- data/lib/json_skooma/validators/ipv4.rb +20 -0
- data/lib/json_skooma/validators/ipv6.rb +16 -0
- data/lib/json_skooma/validators/iri.rb +47 -0
- data/lib/json_skooma/validators/iri_reference.rb +15 -0
- data/lib/json_skooma/validators/json_pointer.rb +19 -0
- data/lib/json_skooma/validators/regex.rb +15 -0
- data/lib/json_skooma/validators/relative_json_pointer.rb +18 -0
- data/lib/json_skooma/validators/time.rb +32 -0
- data/lib/json_skooma/validators/uri.rb +60 -0
- data/lib/json_skooma/validators/uri_reference.rb +15 -0
- data/lib/json_skooma/validators/uri_template.rb +26 -0
- data/lib/json_skooma/validators/uuid.rb +15 -0
- data/lib/json_skooma/validators.rb +17 -0
- data/lib/json_skooma/version.rb +5 -0
- data/lib/json_skooma/vocabulary.rb +12 -0
- data/lib/json_skooma.rb +39 -0
- metadata +244 -0
@@ -0,0 +1,85 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
3
|
+
"$id": "https://json-schema.org/draft/2020-12/links",
|
4
|
+
"title": "Link Description Object",
|
5
|
+
|
6
|
+
"type": "object",
|
7
|
+
"properties": {
|
8
|
+
"anchor": {
|
9
|
+
"type": "string",
|
10
|
+
"format": "uri-template"
|
11
|
+
},
|
12
|
+
"anchorPointer": {
|
13
|
+
"type": "string",
|
14
|
+
"anyOf": [
|
15
|
+
{ "format": "json-pointer" },
|
16
|
+
{ "format": "relative-json-pointer" }
|
17
|
+
]
|
18
|
+
},
|
19
|
+
"rel": {
|
20
|
+
"anyOf": [
|
21
|
+
{ "type": "string" },
|
22
|
+
{
|
23
|
+
"type": "array",
|
24
|
+
"items": { "type": "string" },
|
25
|
+
"minItems": 1
|
26
|
+
}
|
27
|
+
]
|
28
|
+
},
|
29
|
+
"href": {
|
30
|
+
"type": "string",
|
31
|
+
"format": "uri-template"
|
32
|
+
},
|
33
|
+
"hrefSchema": {
|
34
|
+
"$dynamicRef": "https://json-schema.org/draft/2020-12/hyper-schema#meta",
|
35
|
+
"default": false
|
36
|
+
},
|
37
|
+
"templatePointers": {
|
38
|
+
"type": "object",
|
39
|
+
"additionalProperties": {
|
40
|
+
"type": "string",
|
41
|
+
"anyOf": [
|
42
|
+
{ "format": "json-pointer" },
|
43
|
+
{ "format": "relative-json-pointer" }
|
44
|
+
]
|
45
|
+
}
|
46
|
+
},
|
47
|
+
"templateRequired": {
|
48
|
+
"type": "array",
|
49
|
+
"items": {
|
50
|
+
"type": "string"
|
51
|
+
},
|
52
|
+
"uniqueItems": true
|
53
|
+
},
|
54
|
+
"title": {
|
55
|
+
"type": "string"
|
56
|
+
},
|
57
|
+
"description": {
|
58
|
+
"type": "string"
|
59
|
+
},
|
60
|
+
"targetSchema": {
|
61
|
+
"$dynamicRef": "https://json-schema.org/draft/2020-12/hyper-schema#meta",
|
62
|
+
"default": true
|
63
|
+
},
|
64
|
+
"targetMediaType": {
|
65
|
+
"type": "string"
|
66
|
+
},
|
67
|
+
"targetHints": {},
|
68
|
+
"headerSchema": {
|
69
|
+
"$dynamicRef": "https://json-schema.org/draft/2020-12/hyper-schema#meta",
|
70
|
+
"default": true
|
71
|
+
},
|
72
|
+
"submissionMediaType": {
|
73
|
+
"type": "string",
|
74
|
+
"default": "application/json"
|
75
|
+
},
|
76
|
+
"submissionSchema": {
|
77
|
+
"$dynamicRef": "https://json-schema.org/draft/2020-12/hyper-schema#meta",
|
78
|
+
"default": true
|
79
|
+
},
|
80
|
+
"$comment": {
|
81
|
+
"type": "string"
|
82
|
+
}
|
83
|
+
},
|
84
|
+
"required": [ "rel", "href" ]
|
85
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
3
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/applicator",
|
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": { "$dynamicRef": "#meta" },
|
30
|
+
"default": {}
|
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
|
+
"$defs": {
|
42
|
+
"schemaArray": {
|
43
|
+
"type": "array",
|
44
|
+
"minItems": 1,
|
45
|
+
"items": { "$dynamicRef": "#meta" }
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
3
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/content",
|
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
|
+
"contentEncoding": { "type": "string" },
|
14
|
+
"contentMediaType": { "type": "string" },
|
15
|
+
"contentSchema": { "$dynamicRef": "#meta" }
|
16
|
+
}
|
17
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
3
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/core",
|
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
|
+
"$ref": "#/$defs/uriReferenceString",
|
14
|
+
"$comment": "Non-empty fragments not allowed.",
|
15
|
+
"pattern": "^[^#]*#?$"
|
16
|
+
},
|
17
|
+
"$schema": { "$ref": "#/$defs/uriString" },
|
18
|
+
"$ref": { "$ref": "#/$defs/uriReferenceString" },
|
19
|
+
"$anchor": { "$ref": "#/$defs/anchorString" },
|
20
|
+
"$dynamicRef": { "$ref": "#/$defs/uriReferenceString" },
|
21
|
+
"$dynamicAnchor": { "$ref": "#/$defs/anchorString" },
|
22
|
+
"$vocabulary": {
|
23
|
+
"type": "object",
|
24
|
+
"propertyNames": { "$ref": "#/$defs/uriString" },
|
25
|
+
"additionalProperties": {
|
26
|
+
"type": "boolean"
|
27
|
+
}
|
28
|
+
},
|
29
|
+
"$comment": {
|
30
|
+
"type": "string"
|
31
|
+
},
|
32
|
+
"$defs": {
|
33
|
+
"type": "object",
|
34
|
+
"additionalProperties": { "$dynamicRef": "#meta" }
|
35
|
+
}
|
36
|
+
},
|
37
|
+
"$defs": {
|
38
|
+
"anchorString": {
|
39
|
+
"type": "string",
|
40
|
+
"pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"
|
41
|
+
},
|
42
|
+
"uriString": {
|
43
|
+
"type": "string",
|
44
|
+
"format": "uri"
|
45
|
+
},
|
46
|
+
"uriReferenceString": {
|
47
|
+
"type": "string",
|
48
|
+
"format": "uri-reference"
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
3
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/format-annotation",
|
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
|
+
{
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
3
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/format-assertion",
|
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,29 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/hyper-schema",
|
3
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/hyper-schema",
|
4
|
+
"$vocabulary": {
|
5
|
+
"https://json-schema.org/draft/2019-09/vocab/hyper-schema": true
|
6
|
+
},
|
7
|
+
"$dynamicAnchor": "meta",
|
8
|
+
|
9
|
+
"title": "JSON Hyper-Schema Vocabulary Schema",
|
10
|
+
"type": ["object", "boolean"],
|
11
|
+
"properties": {
|
12
|
+
"base": {
|
13
|
+
"type": "string",
|
14
|
+
"format": "uri-template"
|
15
|
+
},
|
16
|
+
"links": {
|
17
|
+
"type": "array",
|
18
|
+
"items": {
|
19
|
+
"$ref": "https://json-schema.org/draft/2020-12/links"
|
20
|
+
}
|
21
|
+
}
|
22
|
+
},
|
23
|
+
"links": [
|
24
|
+
{
|
25
|
+
"rel": "self",
|
26
|
+
"href": "{+%24id}"
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
3
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/meta-data",
|
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
|
+
{
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
3
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/unevaluated",
|
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
|
+
{
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
3
|
+
"$id": "https://json-schema.org/draft/2020-12/meta/validation",
|
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
|
+
"type": {
|
13
|
+
"anyOf": [
|
14
|
+
{ "$ref": "#/$defs/simpleTypes" },
|
15
|
+
{
|
16
|
+
"type": "array",
|
17
|
+
"items": { "$ref": "#/$defs/simpleTypes" },
|
18
|
+
"minItems": 1,
|
19
|
+
"uniqueItems": true
|
20
|
+
}
|
21
|
+
]
|
22
|
+
},
|
23
|
+
"const": true,
|
24
|
+
"enum": {
|
25
|
+
"type": "array",
|
26
|
+
"items": true
|
27
|
+
},
|
28
|
+
"multipleOf": {
|
29
|
+
"type": "number",
|
30
|
+
"exclusiveMinimum": 0
|
31
|
+
},
|
32
|
+
"maximum": {
|
33
|
+
"type": "number"
|
34
|
+
},
|
35
|
+
"exclusiveMaximum": {
|
36
|
+
"type": "number"
|
37
|
+
},
|
38
|
+
"minimum": {
|
39
|
+
"type": "number"
|
40
|
+
},
|
41
|
+
"exclusiveMinimum": {
|
42
|
+
"type": "number"
|
43
|
+
},
|
44
|
+
"maxLength": { "$ref": "#/$defs/nonNegativeInteger" },
|
45
|
+
"minLength": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
|
46
|
+
"pattern": {
|
47
|
+
"type": "string",
|
48
|
+
"format": "regex"
|
49
|
+
},
|
50
|
+
"maxItems": { "$ref": "#/$defs/nonNegativeInteger" },
|
51
|
+
"minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
|
52
|
+
"uniqueItems": {
|
53
|
+
"type": "boolean",
|
54
|
+
"default": false
|
55
|
+
},
|
56
|
+
"maxContains": { "$ref": "#/$defs/nonNegativeInteger" },
|
57
|
+
"minContains": {
|
58
|
+
"$ref": "#/$defs/nonNegativeInteger",
|
59
|
+
"default": 1
|
60
|
+
},
|
61
|
+
"maxProperties": { "$ref": "#/$defs/nonNegativeInteger" },
|
62
|
+
"minProperties": { "$ref": "#/$defs/nonNegativeIntegerDefault0" },
|
63
|
+
"required": { "$ref": "#/$defs/stringArray" },
|
64
|
+
"dependentRequired": {
|
65
|
+
"type": "object",
|
66
|
+
"additionalProperties": {
|
67
|
+
"$ref": "#/$defs/stringArray"
|
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,62 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://json-schema.org/draft/2019-09/schema",
|
3
|
+
"$id": "https://json-schema.org/draft/2019-09/output/hyper-schema",
|
4
|
+
"title": "JSON Hyper-Schema Output",
|
5
|
+
"type": "array",
|
6
|
+
"items": {
|
7
|
+
"allOf": [
|
8
|
+
{"$ref": "https://json-schema.org/draft/2019-09/links#/$defs/noRequiredFields" }
|
9
|
+
],
|
10
|
+
"type": "object",
|
11
|
+
"required": [
|
12
|
+
"contextUri",
|
13
|
+
"contextPointer",
|
14
|
+
"rel",
|
15
|
+
"attachmentPointer"
|
16
|
+
],
|
17
|
+
"if": { "required": [ "hrefSchema" ] },
|
18
|
+
"then": { "required": [ "hrefInputTemplates", "hrefPrepopulatedInput" ] },
|
19
|
+
"else": { "required": [ "targetUri" ] },
|
20
|
+
"properties": {
|
21
|
+
"contextUri": {
|
22
|
+
"$comment": "The fully resolved URI of the link context, including a fragment if it is possible to construct one for the given media type and instance",
|
23
|
+
"type": "string",
|
24
|
+
"format": "uri"
|
25
|
+
},
|
26
|
+
"contextPointer": {
|
27
|
+
"$comment": "The absolute JSON Pointer to the location in the instance that is the context of the link. If the context resource supports JSON Pointer fragments, this will the string form of the identical JSON Pointer",
|
28
|
+
"type": "string",
|
29
|
+
"format": "json-pointer"
|
30
|
+
},
|
31
|
+
"rel": {
|
32
|
+
"type": "string"
|
33
|
+
},
|
34
|
+
"targetUri": {
|
35
|
+
"$comment": "The fully resolved target URI",
|
36
|
+
"type": "string",
|
37
|
+
"format": "uri"
|
38
|
+
},
|
39
|
+
"hrefInputTemplates": {
|
40
|
+
"$comment": "The list of partially resolved URI Templates, starting with \"href\", followed by applicable \"base\" values from nearest to furthest.",
|
41
|
+
"type": "array",
|
42
|
+
"items": {
|
43
|
+
"type": "string",
|
44
|
+
"format": "uri-template"
|
45
|
+
}
|
46
|
+
},
|
47
|
+
"hrefPrepopulatedInput": {
|
48
|
+
"$comment": "The initial data set to be presented with the input form when URI Template input is accepted.",
|
49
|
+
"type": "object",
|
50
|
+
"propertyNames": {
|
51
|
+
"$comment": "These are all URI Template variable names, specifically the 'varname' production from RFC 6570, Section 2.3",
|
52
|
+
"pattern": "^(?:\\w|(?:%[a-f\\d]{2}))+(?:\\.(?:\\w|(?:%[a-f\\d]{2})))*$"
|
53
|
+
}
|
54
|
+
},
|
55
|
+
"attachmentPointer": {
|
56
|
+
"$comment": "The absolute JSON Pointer, in string form, of the position to which this resolved link applies",
|
57
|
+
"type": "string",
|
58
|
+
"format": "json-pointer"
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
@@ -0,0 +1,96 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
3
|
+
"$id": "https://json-schema.org/draft/2020-12/output/schema",
|
4
|
+
"description": "A schema that validates the minimum requirements for validation output",
|
5
|
+
|
6
|
+
"anyOf": [
|
7
|
+
{ "$ref": "#/$defs/flag" },
|
8
|
+
{ "$ref": "#/$defs/basic" },
|
9
|
+
{ "$ref": "#/$defs/detailed" },
|
10
|
+
{ "$ref": "#/$defs/verbose" }
|
11
|
+
],
|
12
|
+
"$defs": {
|
13
|
+
"outputUnit":{
|
14
|
+
"properties": {
|
15
|
+
"valid": { "type": "boolean" },
|
16
|
+
"keywordLocation": {
|
17
|
+
"type": "string",
|
18
|
+
"format": "json-pointer"
|
19
|
+
},
|
20
|
+
"absoluteKeywordLocation": {
|
21
|
+
"type": "string",
|
22
|
+
"format": "uri"
|
23
|
+
},
|
24
|
+
"instanceLocation": {
|
25
|
+
"type": "string",
|
26
|
+
"format": "json-pointer"
|
27
|
+
},
|
28
|
+
"error": {
|
29
|
+
"type": "string"
|
30
|
+
},
|
31
|
+
"errors": {
|
32
|
+
"$ref": "#/$defs/outputUnitArray"
|
33
|
+
},
|
34
|
+
"annotations": {
|
35
|
+
"$ref": "#/$defs/outputUnitArray"
|
36
|
+
}
|
37
|
+
},
|
38
|
+
"required": [ "valid", "keywordLocation", "instanceLocation" ],
|
39
|
+
"allOf": [
|
40
|
+
{
|
41
|
+
"if": {
|
42
|
+
"properties": {
|
43
|
+
"valid": { "const": false }
|
44
|
+
}
|
45
|
+
},
|
46
|
+
"then": {
|
47
|
+
"anyOf": [
|
48
|
+
{
|
49
|
+
"required": [ "error" ]
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"required": [ "errors" ]
|
53
|
+
}
|
54
|
+
]
|
55
|
+
}
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"if": {
|
59
|
+
"anyOf": [
|
60
|
+
{
|
61
|
+
"properties": {
|
62
|
+
"keywordLocation": {
|
63
|
+
"pattern": "/\\$ref/"
|
64
|
+
}
|
65
|
+
}
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"properties": {
|
69
|
+
"keywordLocation": {
|
70
|
+
"pattern": "/\\$dynamicRef/"
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
74
|
+
]
|
75
|
+
},
|
76
|
+
"then": {
|
77
|
+
"required": [ "absoluteKeywordLocation" ]
|
78
|
+
}
|
79
|
+
}
|
80
|
+
]
|
81
|
+
},
|
82
|
+
"outputUnitArray": {
|
83
|
+
"type": "array",
|
84
|
+
"items": { "$ref": "#/$defs/outputUnit" }
|
85
|
+
},
|
86
|
+
"flag": {
|
87
|
+
"properties": {
|
88
|
+
"valid": { "type": "boolean" }
|
89
|
+
},
|
90
|
+
"required": [ "valid" ]
|
91
|
+
},
|
92
|
+
"basic": { "$ref": "#/$defs/outputUnit" },
|
93
|
+
"detailed": { "$ref": "#/$defs/outputUnit" },
|
94
|
+
"verbose": { "$ref": "#/$defs/outputUnit" }
|
95
|
+
}
|
96
|
+
}
|