# GREsau/schemars

Generate JSON Schema documents from Rust code

Repository: https://github.com/GREsau/schemars
Canonical: https://ross.abutalabs.com/products/schemars
Homepage: https://graham.cool/schemars/
Language: Rust
License: MIT
License Family: permissive
Topics: json-schema, rust, serde
Last push: 2026-07-27T14:36:11+00:00

## Health v2 (maintenance only)
Score: 96/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 94, release rhythm 95, longevity 100
- inputs: {"age_days": 2586, "days_push": 37, "days_rel": 37, "gap_med": 27, "n_releases_24m": 12}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1403, forks 304 (observed 2026-08-28T04:04:37.851955+00:00)

## What it is
Schemars is a Rust library that generates JSON Schema documents from Rust types via a JsonSchema trait and #[derive(JsonSchema)] macro. It is designed to stay compatible with Serde, honoring #[serde(...)] attributes so generated schemas match serde_ serialization behavior.

## Use cases
- generate  schema from rust structs
- validate  payloads against rust types
- document serde serialization formats
- generate openapi schemas for rust api types
- produce  schema for config file formats
- keep  schema in sync with serde attributes

## When to choose
- you write Rust and need JSON Schema documents matching your serde types
- you want schema generation via a simple derive macro
- you need serde attribute compatibility (rename, skip, flatten, etc.)
- you need no_std support or integrations with chrono, uuid, bytes and similar crates

## When to avoid
- you need JSON Schema from non-Rust sources
- you need OpenAPI document generation itself rather than raw schemas
- your project is not in the Rust ecosystem

## Facets
- artifact type: library
- maturity: stable
- function: serialization, developer-tools
- domain: developer-tools, apis, backend
- platform: rust, cross-platform
- tags: -schema, serde, derive-macro, schema-generation

## Member repositories
- GREsau/schemars (main) score 96

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:37.851955+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:38:53.158898+00:00, confidence not recorded.
  - readme: https://github.com/GREsau/schemars (fetched 2026-08-28T04:04:37.851955+00:00, sha ed0162de81df)
  - homepage: https://graham.cool/schemars/ (fetched 2026-08-29T11:52:46.451134+00:00, sha 8a3a80c67d8e)
  - site_page: https://graham.cool/schemars/features (fetched 2026-08-29T11:52:46.460291+00:00, sha f44a4a8f9383)
  - site_page: https://graham.cool/schemars/v0/features (fetched 2026-08-29T11:52:46.462368+00:00, sha 58787425015b)
  - registry_crates: https://crates.io/api/v1/crates/schemars (fetched 2026-08-29T11:52:46.464088+00:00, sha ccca2b8795de)
- Data as of 2026-08-30T08:39:29.467469+00:00.
