Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions meta/schemas-root.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,31 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Root schema meta-schema",
"description": "Meta-schema for validating root-level schemas",
"type": "object",
"anyOf": [
{
"properties": {
"examples": {
"type": "array",
"minItems": 1
},
"const": true
}
},
"examples": [
{
"properties": {
"examples": {
"type": "array",
"minItems": 3
},
"const": false
}
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Example Schema",
"description": "An example schema conforming to the root meta-schema",
"examples": [ "example value" ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://example.com" ],
"type": "string"
}
],
"required": [ "x-license", "examples", "x-links", "$schema" ],
"type": "object",
"if": {
"properties": {
"const": true
}
},
"else": {
"properties": {
"examples": {
"minItems": 3
}
}
},
"required": [ "x-license", "x-links", "$schema" ],
"properties": {
"$schema": {
"const": "https://json-schema.org/draft/2020-12/schema"
Expand All @@ -46,9 +49,6 @@
"items": {
"$ref": "../schemas/2020-12/ietf/http/https-url.json"
}
},
"examples": {
"type": "array"
}
}
}
8 changes: 8 additions & 0 deletions meta/schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
"$dynamicAnchor": "meta",
"title": "Schema meta-schema",
"description": "Meta-schema for validating all schemas",
"examples": [
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Example Schema",
"description": "An example valid schema",
"type": "string"
}
],
"$ref": "https://json-schema.org/draft/2020-12/schema",
"properties": {
"$id": false,
Expand Down
18 changes: 18 additions & 0 deletions meta/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Test meta-schema",
"description": "Meta-schema for validating test files",
"examples": [
{
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"target": "../schemas/example.json",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example introduces a top-level target, but meta/test.json doesn’t currently describe or require target, so schema validation won’t catch missing/invalid targets even though the test suite appears to use them.

🤖 Was this useful? React with 👍 or 👎

"tests": [
{
"description": "Valid input",
"data": "test",
"valid": true
},
{
"description": "Invalid input",
"data": 123,
"valid": false
}
]
}
],
"type": "object",
"required": [ "x-license", "tests" ],
"properties": {
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@
"access": "public"
},
"devDependencies": {
"@sourcemeta/jsonschema": "^13.1.0"
"@sourcemeta/jsonschema": "^13.2.0"
}
}
2 changes: 1 addition & 1 deletion schemas/2020-12/xbrl/instance/2003/boolean-item-type.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "XBRL booleanItemType",
"description": "XBRL item type for boolean values (true or false). Based on W3C XML Schema boolean",
"examples": [ true, false, true ],
"examples": [ true, false ],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [
"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",
Expand Down