Thank you for your interest in contributing to jsonschema! We welcome contributions from everyone in the form of suggestions, bug reports, pull requests, and feedback. This document provides guidance if you're thinking of helping out.
When reporting a bug or asking for help, please include enough details so that others can reproduce the behavior you're seeing.
To open an issue, follow this link and fill out the appropriate template.
When making a feature request, please make it clear what problem you intend to solve with the feature and provide some ideas on how to implement it.
NOTE: Many commands are available via a Justfile located in the root of the repository.
The tests in jsonschema depend on the JSON Schema Test Suite. Before running the tests, you need to download the suite.
Initialize and update the git submodules:
$ git submodule init
$ git submodule update
This will clone the JSON Schema Test Suite to crates/jsonschema/tests/suite/
.
Then follow instructions below to run the tests either for the Rust Core or Python Bindings.
jsonschema targets Rust 1.71.1 as its Minimum Supported Rust Version (MSRV). Please ensure your contributions are compatible with this version.
You can use rustup to manage your installed toolchains. To set up the correct version for the jsonschema project:
$ rustup override set 1.71.1
Run the tests with:
$ cargo test --all-features
Make sure all tests pass before submitting your pull request. If you've added new functionality, please include appropriate tests.
Format your code using:
$ cargo fmt --all
And lint it using:
$ cargo clippy --all-targets --all-features -- -D warnings
The Python bindings are located in the crates/jsonschema-py
directory. If you're working on or testing the Python bindings, follow these steps:
We recommend using uv for managing the Python environment. To set up the environment:
-
Navigate to the
crates/jsonschema-py
directory:$ cd crates/jsonschema-py
-
Create a virtual environment and install the package in editable mode with test dependencies:
$ uv venv $ uv pip install -e ".[tests]"
To run the Python tests:
$ uv run pytest tests-py
Make sure all Python tests pass before submitting your pull request. If you've added new functionality to the Python bindings, please include appropriate Python tests as well.
Format your code using:
$ uvx ruff format benches python tests-py
$ cargo fmt --all
And lint it using:
$ uvx ruff check benches python tests-py
$ cargo clippy --all-targets --all-features -- -D warnings
For small changes (e.g., bug fixes), feel free to submit a PR directly.
For larger changes (e.g., new functionality or configuration options), please create an issue first to discuss your proposed change.
Contributions to documentation are always welcome. If you find any part of the documentation unclear or incomplete, please open an issue or submit a pull request.
If you're looking to contribute code, implementing missing keywords for newer JSON Schema drafts is a great place to start. Check the compliance badges to see which drafts might need work.
Another way to contribute is by fixing failing test cases from the JSON Schema Test Suite. You can check the current status on the Bowtie Report.
- Ensure your code passes all tests and lint checks.
- Update the documentation as necessary.
- Add or update tests as appropriate.
- If you're adding new functionality, please include a description in the README.
- If your change affects users, add an entry to the CHANGELOG.
If you need help with contributing to jsonschema, you can:
- Open a GitHub Discussion.
- Ask in the pull request or issue if you've already opened one.
Thank you for contributing to jsonschema!