#json-schema #axum #axum-json-schema

axum_json_schema

Request JSON schema validation for axum

1 unstable release

Uses new Rust 2024

new 0.1.0 Apr 23, 2025

#1300 in Parser implementations

40 downloads per month

MIT license

12KB
206 lines

axum_json_schema

A drop-in replacement for Json extractor and response that validates requests based on JSON schemas.


lib.rs:

A simple crate provides a drop-in replacement for axum::Json that uses jsonschema to validate requests schemas generated via schemars.

You might want to do this in order to provide a better experience for your clients and not leak serde's error messages.

All schemas are cached in a thread-local storage for the life of the application (or thread).

Features

  • aide: support for aide

Dependencies

~12–21MB
~290K SLoC