diff --git a/meta/schemas-root.json b/meta/schemas-root.json index 33406a24..a0695c95 100644 --- a/meta/schemas-root.json +++ b/meta/schemas-root.json @@ -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" @@ -46,9 +49,6 @@ "items": { "$ref": "../schemas/2020-12/ietf/http/https-url.json" } - }, - "examples": { - "type": "array" } } } diff --git a/meta/schemas.json b/meta/schemas.json index 76e5b759..0ddb9c44 100644 --- a/meta/schemas.json +++ b/meta/schemas.json @@ -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, diff --git a/meta/test.json b/meta/test.json index cac6f505..f1aea1e1 100644 --- a/meta/test.json +++ b/meta/test.json @@ -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", + "tests": [ + { + "description": "Valid input", + "data": "test", + "valid": true + }, + { + "description": "Invalid input", + "data": 123, + "valid": false + } + ] + } + ], "type": "object", "required": [ "x-license", "tests" ], "properties": { diff --git a/package-lock.json b/package-lock.json index 73c76523..5c49c8a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,16 +9,16 @@ "version": "0.3.1", "license": "UNLICENSED", "devDependencies": { - "@sourcemeta/jsonschema": "^13.1.0" + "@sourcemeta/jsonschema": "^13.2.0" }, "funding": { "url": "https://github.com/sponsors/sourcemeta" } }, "node_modules/@sourcemeta/jsonschema": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/@sourcemeta/jsonschema/-/jsonschema-13.1.0.tgz", - "integrity": "sha512-jTubqHrW2+bt0bjUcI8TNAIToNKH0T6k54ERoC93+yB2EMgQ2mWMvB2f5eIia/IC4XYOkz5zChWKo5mv09+T+w==", + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/@sourcemeta/jsonschema/-/jsonschema-13.2.0.tgz", + "integrity": "sha512-jUKD6q1Wjys70wyXzd6goXV0HRM/rN2QR8rYHtkp6PzZkSdSgddtsnBNDu5j23JZdaE3VrjRUGJKaPLpdhuTDg==", "cpu": [ "x64", "arm64" diff --git a/package.json b/package.json index 114cda26..df132a6f 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,6 @@ "access": "public" }, "devDependencies": { - "@sourcemeta/jsonschema": "^13.1.0" + "@sourcemeta/jsonschema": "^13.2.0" } } diff --git a/schemas/2020-12/xbrl/instance/2003/boolean-item-type.json b/schemas/2020-12/xbrl/instance/2003/boolean-item-type.json index ed1a9c0a..deda0c98 100644 --- a/schemas/2020-12/xbrl/instance/2003/boolean-item-type.json +++ b/schemas/2020-12/xbrl/instance/2003/boolean-item-type.json @@ -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",