JSON Schema validation CLI and pre-commit hooks
open sourceApache-2.0free
check-jsonschema is a command-line tool and set of pre-commit hooks for validating JSON and YAML files against a JSON Schema, built on the Python jsonschema library. The schema can be a local file or one fetched over HTTP or HTTPS, and remote schemas are downloaded and cached. Ready-made hooks validate common config files against their published schemas, including GitHub Workflows, Azure Pipelines, Bitbucket Pipelines, Buildkite, CircleCI and Renovate, and another checks schema files against their metaschema. It installs with pipx or Homebrew.
Ways to install
Package managers
Problems it solves
- validate my GitHub Actions workflow files before I push
- check JSON and YAML config files against a schema in pre-commit
- catch a broken CI config in a git hook instead of on the CI server
Features
- validate JSON or YAML files against a local or remote JSON Schema
- downloads and caches remote schemas
- pre-commit hooks for GitHub Workflows, Azure Pipelines, Bitbucket Pipelines, Buildkite, CircleCI and more
- check-metaschema hook validates schema files against their metaschema
Alternatives
The same job
These do what check-jsonschema does.
- json_schemer JSON Schema validator. Supports drafts 4, 6, 7, 2019-09, 2020-12, OpenAPI 3.0, and OpenAPI 3.1.
- JSON Schema for PHP (justinrainbow/json-schema) Validate JSON structures against a JSON Schema in PHP
