{"id":15012917,"url":"https://github.com/sourcemeta/jsonschema","last_synced_at":"2026-05-11T22:04:52.288Z","repository":{"id":242555438,"uuid":"802599802","full_name":"sourcemeta/jsonschema","owner":"sourcemeta","description":"The CLI for working with JSON Schema. Covers formatting, linting, testing, bundling, and more for both local development and CI/CD pipelines","archived":false,"fork":false,"pushed_at":"2026-05-08T23:15:49.000Z","size":20514,"stargazers_count":276,"open_issues_count":25,"forks_count":36,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-09T01:02:58.443Z","etag":null,"topics":["asyncapi","cpp","json","json-schema","json-schemas","jsonschema","openapi","schema","schemas","schemastore","tooling","tools"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sourcemeta.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":"CONTRIBUTING.markdown","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"sourcemeta"}},"created_at":"2024-05-18T18:43:27.000Z","updated_at":"2026-05-08T22:46:25.000Z","dependencies_parsed_at":"2026-05-09T01:02:23.064Z","dependency_job_id":null,"html_url":"https://github.com/sourcemeta/jsonschema","commit_stats":{"total_commits":247,"total_committers":4,"mean_commits":61.75,"dds":0.01619433198380571,"last_synced_commit":"a5b92bb44a499f0d5ae3fc12e3509e6e8001cd71"},"previous_names":["intelligence-ai/jsonschema","sourcemeta/jsonschema"],"tags_count":193,"template":false,"template_full_name":null,"purl":"pkg:github/sourcemeta/jsonschema","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcemeta%2Fjsonschema","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcemeta%2Fjsonschema/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcemeta%2Fjsonschema/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcemeta%2Fjsonschema/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourcemeta","download_url":"https://codeload.github.com/sourcemeta/jsonschema/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourcemeta%2Fjsonschema/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32914557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-11T17:09:15.040Z","status":"ssl_error","status_checked_at":"2026-05-11T17:08:45.420Z","response_time":120,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asyncapi","cpp","json","json-schema","json-schemas","jsonschema","openapi","schema","schemas","schemastore","tooling","tools"],"created_at":"2024-09-24T19:43:24.665Z","updated_at":"2026-05-11T22:04:52.243Z","avatar_url":"https://github.com/sourcemeta.png","language":"Shell","funding_links":["https://github.com/sponsors/sourcemeta"],"categories":["Shell"],"sub_categories":[],"readme":"![JSON Schema](./assets/banner.png)\n\n[![GitHub Release](https://img.shields.io/github/v/release/sourcemeta/jsonschema)](https://github.com/sourcemeta/jsonschema/releases)\n[![NPM Version](https://img.shields.io/npm/v/@sourcemeta/jsonschema)](https://www.npmjs.com/package/@sourcemeta/jsonschema)\n[![NPM Downloads](https://img.shields.io/npm/dm/%40sourcemeta%2Fjsonschema)](https://www.npmjs.com/package/@sourcemeta/jsonschema)\n[![PyPI Version](https://img.shields.io/pypi/v/sourcemeta-jsonschema.svg)](https://pypi.org/project/sourcemeta-jsonschema)\n[![GitHub Actions](https://github.com/sourcemeta/jsonschema/actions/workflows/test.yml/badge.svg)](https://github.com/sourcemeta/jsonschema/actions)\n[![GitHub contributors](https://img.shields.io/github/contributors/sourcemeta/jsonschema.svg)](https://github.com/sourcemeta/jsonschema/graphs/contributors/)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)](https://github.com/sourcemeta/jsonschema/blob/main/.pre-commit-hooks.yaml)\n[![DOI](https://zenodo.org/badge/802599802.svg)](https://doi.org/10.5281/zenodo.20086212)\n\n[![Get it from the Snap Store](https://snapcraft.io/en/light/install.svg)](https://snapcraft.io/jsonschema)\n\nThe command-line tool for working with [JSON Schema](https://json-schema.org),\nthe world most popular schema language. It is a comprehensive solution for\nmaintaining **repositories of schemas** and ensuring their quality, both during\nlocal development and when running on CI/CD pipelines. For example:\n\n- Ensure your schemas are valid\n- Debug unexpected schema validation results\n- Unit test your schemas against valid and invalid instances\n- Enforce consistent indentation and keyword ordering in your schema files\n- Detect and fix common JSON Schema anti-patterns\n- Inline external references for conveniently distributing your schemas\n\n[**Check out the documentation to learn more**](#usage)\n\nPairs with [Sourcemeta One](https://www.sourcemeta.com) for a complete schema\nregistry workflow.\n\n***\n\n\u003e [!TIP]\n\u003e Do you want to level up your JSON Schema skills? Check out\n\u003e [learnjsonschema.com](https://www.learnjsonschema.com), our growing JSON\n\u003e Schema documentation website, our [JSON Schema for\n\u003e OpenAPI](https://www.sourcemeta.com/courses/jsonschema-for-openapi) video\n\u003e course, and our O'Reilly book [Unifying Business, Data, and Code: Designing\n\u003e Data Products with JSON\n\u003e Schema](https://www.oreilly.com/library/view/unifying-business-data/9781098144999/).\n\n***\n\n![JSON Schema CLI Example](./assets/example.png)\n\nVersion support\n---------------\n\nWe aim to fully support _every_ version of JSON Schema and combinations between them.\n\n| Dialect             | Support                                                                             |\n|---------------------|-------------------------------------------------------------------------------------|\n| JSON Schema 2020-12 | **Full**                                                                            |\n| JSON Schema 2019-09 | **Full**                                                                            |\n| JSON Schema Draft 7 | **Full**                                                                            |\n| JSON Schema Draft 6 | **Full**                                                                            |\n| JSON Schema Draft 4 | **Full**                                                                            |\n| JSON Schema Draft 3 | Partial (except `codegen`)                                               |\n| JSON Schema Draft 2 | Partial (except `validate`, `test`, `metaschema`, `upgrade`, `codegen`, and `lint`) |\n| JSON Schema Draft 1 | Partial (except `validate`, `test`, `metaschema`, `upgrade`, `codegen`, and `lint`) |\n| JSON Schema Draft 0 | Partial (except `validate`, `test`, `metaschema`, `upgrade`, `codegen`, and `lint`) |\n\nWhat our users are saying\n-------------------------\n\n\u003e Amazing product. Very useful for formatting and bundling my schemas, plus it\n\u003e surfaced various referencing issues. 10 out of 10!\n\n[@alombarte](https://github.com/alombarte), co-founder of the\n[KrakenD](https://www.krakend.io) API Gateway.\n\n\u003e Huge shout out to this tool. Our governance pipeline uses it to produce\n\u003e better analysis of the examples in our OpenAPI documents. While Spectral does\n\u003e some basic validation of examples, the diagnostics from this tool are far\n\u003e superior.\n\n[@DavidBiesack](https://github.com/DavidBiesack), Chief API Officer at\n[Apiture](https://www.apiture.com).\n\nUsage\n-----\n\nThe functionality provided by the JSON Schema CLI is divided into commands. The\nfollowing pages describe each feature in detail. Additionally, running the JSON\nSchema CLI without passing a command will print convenient reference\ndocumentation:\n\n- [`jsonschema version`](./docs/version.markdown)\n- [`jsonschema validate`](./docs/validate.markdown)\n- [`jsonschema metaschema`](./docs/metaschema.markdown) (ensure a schema is valid)\n- [`jsonschema compile`](./docs/compile.markdown) (for pre-compiling schemas)\n- [`jsonschema test`](./docs/test.markdown) (write unit tests for your schemas)\n- [`jsonschema fmt`](./docs/format.markdown)\n- [`jsonschema lint`](./docs/lint.markdown)\n- [`jsonschema bundle`](./docs/bundle.markdown) (for inlining remote references in a schema)\n- [`jsonschema upgrade`](./docs/upgrade.markdown) (for upgrading schemas to a newer JSON Schema dialect)\n- [`jsonschema inspect`](./docs/inspect.markdown) (for debugging references)\n- [`jsonschema codegen`](./docs/codegen.markdown) (for generating code from schemas)\n- [`jsonschema encode`](./docs/encode.markdown) (for binary compression)\n- [`jsonschema decode`](./docs/decode.markdown)\n- [`jsonschema install`](./docs/install.markdown) (for fetching external schema dependencies)\n\n\u003e See [`jsonschema.json`](./docs/configuration.markdown) for an _experimental_\nmanifest for describing JSON Schema data models inspired by NPM's\n`package.json`, including dependency management.\n\nNote that YAML is supported in most commands!\n\nWe also support a growing amount of [`pre-commit`](https://pre-commit.com)\nhooks. Take a look at the\n[`.pre-commit-hooks.yaml`](https://github.com/sourcemeta/jsonschema/blob/main/.pre-commit-hooks.yaml)\nconfiguration file for what's available right now. Keep in mind that to use the\n`pre-commit` hooks, you need to install the CLI first.\n\n***\n\nIf you are looking for more of a tutorial and overview of what the CLI is\ncapable of, take a look at the [Applying software engineering practices to JSON\nSchemas](https://www.youtube.com/watch?v=wJ7bK22n3IU) talk from the 2024 [JSON\nSchema Conference](https://conference.json-schema.org). It covers advise on\nontology design, linting, unit testing, CI/CD integration, and more:\n\n[![JSON Schema Conference 2024 - Applying software engineering practices to JSON Schemas](https://img.youtube.com/vi/wJ7bK22n3IU/0.jpg)](https://www.youtube.com/watch?v=wJ7bK22n3IU)\n\nInstallation\n------------\n\nThe JSON Schema CLI is written using C++ and [CMake](https://cmake.org/), and\nsupports macOS, Windows, and GNU/Linux.\n\n### From Homebrew\n\n```sh\nbrew install sourcemeta/apps/jsonschema\n```\n\n### From GitHub Actions\n\n```yaml\n- uses: sourcemeta/jsonschema@vX.Y.Z\n```\n\nWhere `X.Y.Z` is replaced with the desired version. For example:\n\n```yaml\n- name: Checkout Repository\n  uses: actions/checkout@v4\n\n- name: Install the JSON Schema CLI\n  uses: sourcemeta/jsonschema@v15.6.0\n\n# Then use as usual\n- run: jsonschema fmt path/to/schemas --check\n```\n\n### From npm\n\n```sh\nnpm install --global @sourcemeta/jsonschema\n```\n\n### From PyPI\n\n```sh\npip install sourcemeta-jsonschema\n```\n\n### From mise\n\n```sh\nmise use jsonschema\n```\n\n### From GitHub Releases\n\nWe publish precompiled binaries for every supported platform to [GitHub\nReleases](https://github.com/sourcemeta/jsonschema/releases), including a\n[continuous](https://github.com/sourcemeta/jsonschema/releases/tag/continuous)\nthat is updated on every commit from the main branch.\n\nFor convenience, we also provide a POSIX shell script capable of installing the\nlatest pre-built binaries, which you can run as follows:\n\n```sh\ncurl -fsSL https://raw.githubusercontent.com/sourcemeta/jsonschema/main/install -H 'Cache-Control: no-cache, no-store, must-revalidate' | /bin/sh\n```\n\nKeep in mind that it is hard to provide binaries that work across GNU/Linux\ndistributions. We conservatively target Ubuntu and Alpine, but you might need\nto build from source if your distribution of choice is different.\n\nTo verify the GPG signature of the checksums file:\n\n```sh\ncurl --silent --show-error --location 'https://www.sourcemeta.com/gpg.asc' | gpg --import\ngpg --verify CHECKSUMS.txt.asc CHECKSUMS.txt\n```\n\n### From Dockerfile\n\nStarting from v7.2.1, we publish a Docker image to [GitHub\nPackages](https://github.com/sourcemeta/jsonschema/pkgs/container/jsonschema)\n(`amd64` and `arm64`), which you can use as follows:\n\n```sh\ndocker run --interactive --volume \"$PWD:/workspace\" \\\n  ghcr.io/sourcemeta/jsonschema:vX.Y.Z lint --verbose myschema.json\n```\n\nReplace `vX.Y.Z` with your desired version. You can mount any directory as `/workspace`.\n\n\u003e [!WARNING]\n\u003e Make sure to NOT allocate a pseudo-TTY when running the CLI through Docker\n\u003e (i.e. the `--tty`/`-t` option) as it might result in line ending\n\u003e incompatibilities between the container and host, which will affect\n\u003e formatting. Plus a TTY is not required for running a tool like the JSON\n\u003e Schema CLI.\n\n### From Snap\n\nStarting from v10.0.0, we publish to the Snap store:\n\n```sh\nsudo snap install jsonschema\n```\n\nKeep in mind that due to [Snap\nconfinement](https://snapcraft.io/docs/snap-confinement) requirements, the Snap\nis only able to access files under your `$HOME` directory.\n\n### With gah\n\nIf you are using [gah](https://github.com/marverix/gah):\n\n```sh\ngah install jsonschema\n```\n\ngah does not require sudo, but you need to have `$HOME/.local/bin/` in your `PATH`.\n\n### Building from source\n\n```sh\ngit clone https://github.com/sourcemeta/jsonschema\ncd jsonschema\ncmake -S . -B ./build -DCMAKE_BUILD_TYPE:STRING=Release\ncmake --build ./build --config Release --parallel 4\ncmake --install ./build --prefix \u003cprefix\u003e \\\n  --config Release --verbose --component sourcemeta_jsonschema\n```\n\nWhere `\u003cprefix\u003e` can be any destination prefix of your choosing, such as `/opt`\nor `/usr/local`.\n\nFor performance reasons, the build will take as much advantage of your specific\nmachine capabilities. If you desire to build a portable binary, or if the\naggressive processor-specific optimisations cause any issues (we heard of some\n`Illegal instruction` cases), then configure the project with\n`-DJSONSCHEMA_PORTABLE:BOOL=ON`.\n\nGoing Further\n-------------\n\nThe JSON Schema CLI handles the local development and CI/CD side of schema\nmanagement. For teams that need to publish, discover, and govern schemas across\nan organisation, [Sourcemeta One](https://www.sourcemeta.com) is a self-hosted\nJSON Schema registry that pairs directly with this CLI. It is designed by the\nsame team, requires no database, deploys as a single Docker container, and is\nfree to deploy.\n\nLicense\n-------\n\nThis project is released under the terms of the [GNU Affero General Public\nLicense v3.0](./LICENSE).\n\n**A note for enterprises:** Using the JSON Schema CLI as a tool during local\ndevelopment or as part of your CI/CD pipelines does not trigger the AGPL\ncopyleft requirements. Your schemas, data, and surrounding code remain entirely\nyours. This is the same way that managing your proprietary code with\n[Git](https://git-scm.com) does not make your code subject to the\n[GPL](https://www.gnu.org/licenses/gpl-3.0.en.html). For any other use, please\nrefer to the full [license](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcemeta%2Fjsonschema","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourcemeta%2Fjsonschema","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourcemeta%2Fjsonschema/lists"}