Expand description
JSON body extractor with consistent error responses.
JsonBody<T> wraps Axum’s Json<T> extractor and converts
parse failures into the standard Aro JSON error envelope format,
rather than Axum’s default plain-text error responses.
§Example
ⓘ
use aro_web::json_body::JsonBody;
#[aro::post("/users")]
async fn create_user(JsonBody(payload): JsonBody<CreateUser>) -> Json<User> {
// payload is already deserialized; parse errors returned as JSON
Json(User { name: payload.name })
}Structs§
- Json
Body - A JSON body extractor that produces Aro-consistent error responses.
Enums§
- Json
Body Rejection - Rejection type for
JsonBodyextraction failures.