#web #axum #json

axum-jsonschema

Request JSON schema validation for axum

8 releases (5 breaking)

0.6.0 Apr 30, 2023
0.5.0 Jan 15, 2023
0.4.1 Nov 29, 2022
0.3.0 Nov 14, 2022
0.1.0 Sep 6, 2022

#65 in #axum

Download history 121/week @ 2023-05-29 73/week @ 2023-06-05 193/week @ 2023-06-12 153/week @ 2023-06-19 230/week @ 2023-06-26 303/week @ 2023-07-03 91/week @ 2023-07-10 120/week @ 2023-07-17 55/week @ 2023-07-24 49/week @ 2023-07-31 98/week @ 2023-08-07 246/week @ 2023-08-14 177/week @ 2023-08-21 223/week @ 2023-08-28 206/week @ 2023-09-04 99/week @ 2023-09-11

720 downloads per month
Used in 2 crates

MIT/Apache

330KB
2K SLoC

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

axum-jsonschema

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

~15–24MB
~384K SLoC