Something went wrong. Try again.
Small, focused utilities for Rust HTTP APIs built with Axum and utoipa. The workspace favors types and generated code over runtime configura
Something went wrong. Try again.
README.md
tag_api_responses #
Common HTTP status wrappers for Axum. The wrapper sets the runtime status and
documents a JSON body through aide's OperationOutput (feature aide, the
maintained integration) or utoipa's IntoResponses (feature utoipa,
unmaintained). With aide, the response comes directly from the handler
return type:
use axum::Json;
use tag_api_responses::Created;
#[utoipa::path(
post,
path = "/users"
)]
async fn create_user() -> Created<Json<User>> {
Created(Json(create_user_in_database().await))
}
Okay, Created, Accepted, NoContent, and the remaining standard 2xx
wrappers are available. JSON response schemas require T: schemars::JsonSchema
with the aide feature or T: utoipa::ToSchema with the utoipa feature; the
Axum response implementation accepts any IntoResponse body.