JSON Schema Toolkit

v0.22.0
io.github.samdidos/json-schema-toolkit Checked 2 days ago Published 7 days ago

Deterministic JSON Schema tools: validate, lint, diff with a compatibility verdict, bundle, infer.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

jsonschema_validate

Validate a JSON, YAML, JSONL or TOML data file against a JSON Schema and return the errors with their line numbers. Use this instead of judging validity by reading the documents.

ParameterTypeDescription
dataFile *stringPath to the data file to validate.
schemaFile *stringPath to the JSON Schema to validate against.

jsonschema_lint

Report schema-quality findings for a JSON Schema file: unknown keywords, missing descriptions, duplicate enum values, examples and defaults that contradict their own subschema.

ParameterTypeDescription
schemaFile *stringPath to the JSON Schema to lint.

jsonschema_diff

Compare two versions of a JSON Schema and return a backward-compatibility verdict plus every classified change. Use this to decide whether a schema change is breaking — do not infer it from the diff text.

ParameterTypeDescription
newSchemaFile *stringPath to the proposed (newer) schema.
oldSchemaFile *stringPath to the baseline (older) schema.
strictbooleanAlso treat changes the classifier cannot prove safe as blocking.

jsonschema_bundle

Flatten a multi-file schema into one self-contained document, either bundling external refs into $defs or dereferencing them inline.

ParameterTypeDescription
schemaFile *stringPath to the root schema.
dereferencebooleanInline ref targets instead of collecting them into $defs.

jsonschema_infer

Infer a JSON Schema from an existing data file (JSON, JSONC, JSONL, YAML or TOML). Use this to bootstrap a schema from real documents.

ParameterTypeDescription
dataFile *stringPath to the data file to infer from.
draftstringTarget draft (default 2020-12).

jsonschema_sample

Generate a valid example instance from a JSON Schema. The output is validated against the schema before being returned.

ParameterTypeDescription
schemaFile *stringPath to the JSON Schema.

jsonschema_coverage

Report which properties a schema declares that the given data files never exercise — the unused-in-data surface of a contract.

ParameterTypeDescription
dataFiles *arrayOne or more data files to measure coverage from.
schemaFile *stringPath to the JSON Schema.

jsonschema_test

Run declarative schema test suites (*.schema.test.json), which pin the documents a schema must accept and must reject. Use this to check a schema change against its contract.

ParameterTypeDescription
suiteFiles *arrayOne or more *.schema.test.json suite files.