# Schemars

> Generate JSON Schema documents from Rust types, matching how Serde serializes them

Source: https://talira.ai/catalog/schemars-pscvp5y6
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / code generation](https://talira.ai/categories/developer-tools/code-generation), [libraries / validation / json schema](https://talira.ai/categories/libraries/validation/json-schema), [languages / rust](https://talira.ai/categories/languages/rust)
- Licence: MIT[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Supports: [JSON Schema](https://talira.ai/standards/json-schema.md)[^1]
- Backed by: [Graham Esau](https://talira.ai/orgs/graham-esau.md)

Schemars generates JSON Schema documents from Rust code: derive `JsonSchema` on your types and call `schema_for!`. Its schemas aim to match how [Serde](https://talira.ai/catalog/serde-4erjakm9.md) and serde_json serialize and deserialize your types, so it reads `#[serde(...)]` attributes (renames, defaults, tagging) and lets `#[schemars(...)]` override them. It can also build a less precise schema from a value of a type that only implements `Serialize`. Its output declares JSON Schema 2020-12 by default, and it implements `JsonSchema` for standard library types and, behind feature flags, for types from crates such as chrono, uuid, url, indexmap and bigdecimal. It works in `no_std` environments with the `std` feature off.

## Links

- Website: https://graham.cool/schemars/
- GitHub: https://github.com/GREsau/schemars
- Docs: https://docs.rs/schemars/latest

## Problems it solves

- generate a JSON Schema from my Rust structs
- keep my API's JSON Schema in sync with my Serde types
- publish a schema for my Rust config file format

## Features

- #[derive(JsonSchema)] and the schema_for! macro
- follows #[serde(...)] attributes, overridable with #[schemars(...)]
- schema from a value of a type that implements Serialize
- JSON Schema 2020-12 output by default
- optional JsonSchema impls for chrono, uuid, url, indexmap, bigdecimal and other crates
- no_std support

## Trust

Overall: 0.44 out of 1.
Signals: maintenance 0.48, adoption 0.63, momentum 0.37, community 0.64, backing 0.30, extensibility 0.00.

- last commit 48 days ago
- 5 commits in the last 90 days
- latest release v1.2.3 48 days ago
- 1.4k GitHub stars
- 38 contributors
- accepts sponsorship (Github)
- backed by Graham Esau

## Related

- Works with [Serde](https://talira.ai/catalog/serde-4erjakm9.md)

## Sources

[^1]: https://github.com/GREsau/schemars/blob/master/README.md (checked 28 Nov 2026)
[^2]: https://github.com/GREsau/schemars/blob/master/LICENSE (checked 28 Nov 2026)
