Skip to main content

Module validation

Module validation 

Source
Expand description

Custom JSON extractor that emits ApiError::Validation on deserialization failure instead of axum’s default 422/400.

Use middleware::validation::Json<T> instead of axum::Json<T> in handlers that need the Python-shaped error envelope.

Re-exports§

pub use Query as ValidatedQuery;

Structs§

Json
Drop-in replacement for axum::Json that converts serde_json parse errors into ApiError::Validation with the Python-shaped {detail: [...], body: ...} envelope.
LoginForm
Path-scoped Form<T> extractor for POST /api/v1/auth/login.
Query
Query-string extractor that maps serde_urlencoded failures to ApiError::Validation with the same Python-shaped {detail: [...], body: ...} envelope used by Json<T>.