diff --git a/Makefile b/Makefile index d00081b8..39d67645 100644 --- a/Makefile +++ b/Makefile @@ -9,20 +9,19 @@ TIME ?= time include generated.mk all: common test node_modules - $(NODE) $(JSONSCHEMA) fmt schemas meta rules test + $(NODE) $(JSONSCHEMA) fmt schemas rules test .PHONY: common common: $(GENERATED) node_modules - $(TIME) $(NODE) $(JSONSCHEMA) metaschema schemas meta rules - $(TIME) $(NODE) $(JSONSCHEMA) lint schemas meta - $(TIME) $(NODE) $(JSONSCHEMA) validate meta/schemas-root.json schemas + $(TIME) $(NODE) $(JSONSCHEMA) metaschema schemas rules + $(TIME) $(NODE) $(JSONSCHEMA) lint schemas $(SHELLCHECK) scripts/*.sh ./scripts/quality-schemas-tests-mirror.sh ./scripts/quality-templates-xbrl-utr-mirror.sh .PHONY: lint lint: common node_modules - $(TIME) $(NODE) $(JSONSCHEMA) fmt schemas meta rules test --check + $(TIME) $(NODE) $(JSONSCHEMA) fmt schemas rules test --check .PHONY: test test: node_modules diff --git a/jsonschema.json b/jsonschema.json index c2c64519..748ab3d5 100644 --- a/jsonschema.json +++ b/jsonschema.json @@ -15,7 +15,8 @@ "./rules/license.json", "./rules/links.json", "./rules/single-line-text.json", - "./rules/symbol.json" + "./rules/symbol.json", + { "path": "./rules/root.json", "topLevel": true } ] } } diff --git a/meta/schemas-root.json b/meta/schemas-root.json deleted file mode 100644 index 7096546f..00000000 --- a/meta/schemas-root.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Root schema meta-schema", - "description": "Meta-schema for validating root-level schemas", - "examples": [ - { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "Example Schema", - "description": "An example schema conforming to the root meta-schema", - "examples": [ "foo", "bar", "baz" ], - "x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE", - "x-links": [ "https://example.com" ], - "type": "string" - } - ], - "x-lint-exclude": "required_properties_in_properties", - "type": "object", - "required": [ "$schema", "examples", "x-license", "x-links" ], - "properties": { - "examples": { - "type": "array", - "minItems": 1 - } - } -} diff --git a/package-lock.json b/package-lock.json index a888c73f..7dfcc7c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,13 +8,13 @@ "name": "@sourcemeta/std", "version": "0.0.0", "devDependencies": { - "@sourcemeta/jsonschema": "^16.1.0" + "@sourcemeta/jsonschema": "^16.2.0" } }, "node_modules/@sourcemeta/jsonschema": { - "version": "16.1.0", - "resolved": "https://registry.npmjs.org/@sourcemeta/jsonschema/-/jsonschema-16.1.0.tgz", - "integrity": "sha512-FBXyz/PxYQiPfE5bd/TFu+ZJA8I5ncG83ezCNE1J1FRN1xEYolJ83rWI88YMIZeG469uBvsE+pYL1OdNAPRrBg==", + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/@sourcemeta/jsonschema/-/jsonschema-16.2.0.tgz", + "integrity": "sha512-RUhiXdW+WnS8JNeU1ldYktZa7AOBQ+vYm2E+2Oi73zWf7xO6Ql5sfE8tdzq/jf9cWz2Un5ZPpUGX5pA5ofKE+g==", "cpu": [ "x64", "arm64" diff --git a/package.json b/package.json index 574f7f78..ad103355 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,6 @@ "version": "0.0.0", "private": true, "devDependencies": { - "@sourcemeta/jsonschema": "^16.1.0" + "@sourcemeta/jsonschema": "^16.2.0" } } diff --git a/rules/root.json b/rules/root.json new file mode 100644 index 00000000..c64122a0 --- /dev/null +++ b/rules/root.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "std/root", + "description": "Root schemas must declare a dialect, the license, and links to the corresponding standards", + "type": "object", + "required": [ "$schema", "x-license", "x-links" ] +}