#json-schema #axum #web

axum-jsonschema

Request JSON schema validation for axum

10 releases (breaking)

0.8.0 Dec 9, 2023
0.7.0 Oct 18, 2023
0.6.0 Apr 30, 2023
0.5.0 Jan 15, 2023
0.1.0 Sep 6, 2022

#141 in #json-schema

Download history 839/week @ 2025-04-07 902/week @ 2025-04-14 740/week @ 2025-04-21 871/week @ 2025-04-28 663/week @ 2025-05-05 921/week @ 2025-05-12 737/week @ 2025-05-19 598/week @ 2025-05-26 422/week @ 2025-06-02 442/week @ 2025-06-09 512/week @ 2025-06-16 610/week @ 2025-06-23 683/week @ 2025-06-30 873/week @ 2025-07-07 937/week @ 2025-07-14 824/week @ 2025-07-21

3,352 downloads per month
Used in 8 crates (4 directly)

MIT/Apache

1.5MB
2K SLoC

Rust 1.5K SLoC // 0.0% comments JavaScript 421 SLoC // 0.0% comments

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

axum-jsonschema

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

Dependencies

~14–23MB
~323K SLoC