Skip to content

Commit 3f8746f

Browse files
authored
Upgrade JSON Schema CLI to v13.2.0 (#84)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent 516cee6 commit 3f8746f

6 files changed

Lines changed: 54 additions & 28 deletions

File tree

meta/schemas-root.json

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,31 @@
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"title": "Root schema meta-schema",
44
"description": "Meta-schema for validating root-level schemas",
5-
"type": "object",
6-
"anyOf": [
7-
{
8-
"properties": {
9-
"examples": {
10-
"type": "array",
11-
"minItems": 1
12-
},
13-
"const": true
14-
}
15-
},
5+
"examples": [
166
{
17-
"properties": {
18-
"examples": {
19-
"type": "array",
20-
"minItems": 3
21-
},
22-
"const": false
23-
}
7+
"$schema": "https://json-schema.org/draft/2020-12/schema",
8+
"title": "Example Schema",
9+
"description": "An example schema conforming to the root meta-schema",
10+
"examples": [ "example value" ],
11+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
12+
"x-links": [ "https://example.com" ],
13+
"type": "string"
2414
}
2515
],
26-
"required": [ "x-license", "examples", "x-links", "$schema" ],
16+
"type": "object",
17+
"if": {
18+
"properties": {
19+
"const": true
20+
}
21+
},
22+
"else": {
23+
"properties": {
24+
"examples": {
25+
"minItems": 3
26+
}
27+
}
28+
},
29+
"required": [ "x-license", "x-links", "$schema" ],
2730
"properties": {
2831
"$schema": {
2932
"const": "https://json-schema.org/draft/2020-12/schema"
@@ -46,9 +49,6 @@
4649
"items": {
4750
"$ref": "../schemas/2020-12/ietf/http/https-url.json"
4851
}
49-
},
50-
"examples": {
51-
"type": "array"
5252
}
5353
}
5454
}

meta/schemas.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
"$dynamicAnchor": "meta",
44
"title": "Schema meta-schema",
55
"description": "Meta-schema for validating all schemas",
6+
"examples": [
7+
{
8+
"$schema": "https://json-schema.org/draft/2020-12/schema",
9+
"title": "Example Schema",
10+
"description": "An example valid schema",
11+
"type": "string"
12+
}
13+
],
614
"$ref": "https://json-schema.org/draft/2020-12/schema",
715
"properties": {
816
"$id": false,

meta/test.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"title": "Test meta-schema",
44
"description": "Meta-schema for validating test files",
5+
"examples": [
6+
{
7+
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
8+
"target": "../schemas/example.json",
9+
"tests": [
10+
{
11+
"description": "Valid input",
12+
"data": "test",
13+
"valid": true
14+
},
15+
{
16+
"description": "Invalid input",
17+
"data": 123,
18+
"valid": false
19+
}
20+
]
21+
}
22+
],
523
"type": "object",
624
"required": [ "x-license", "tests" ],
725
"properties": {

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@
5151
"access": "public"
5252
},
5353
"devDependencies": {
54-
"@sourcemeta/jsonschema": "^13.1.0"
54+
"@sourcemeta/jsonschema": "^13.2.0"
5555
}
5656
}

schemas/2020-12/xbrl/instance/2003/boolean-item-type.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"title": "XBRL booleanItemType",
44
"description": "XBRL item type for boolean values (true or false). Based on W3C XML Schema boolean",
5-
"examples": [ true, false, true ],
5+
"examples": [ true, false ],
66
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
77
"x-links": [
88
"https://www.xbrl.org/Specification/XBRL-2.1/REC-2003-12-31/XBRL-2.1-REC-2003-12-31+corrected-errata-2013-02-20.html#_5.1.1.3",

0 commit comments

Comments
 (0)