Expand description
Thin Axum routing and response conveniences.
Re-exports§
pub use schemars as schema;
Structs§
- ApiDocument
- Standard OpenAPI 3.1 document. Advanced applications can customize its JSON.
- ApiRoute
Info - Public metadata displayed by
capy routes --api. - Created
- A JSON response with HTTP 201 Created.
- Health
Response - JSON wire data for process liveness.
- Json
- Deserialize or return JSON, using Capy’s safe rejection envelope.
Put this extractor last because it consumes the body. Native extraction is
available as
capy::axum::Json. - NoContent
- An empty response with HTTP 204 No Content.
- Page
- A bounded collection response. The caller supplies a paginated query’s rows.
- Page
Meta - Conventional pagination metadata. Empty collections have one empty page.
- Pagination
- Validated, one-based page parameters. Use
Query<Pagination>in a handler. Defaults to page 1 and 20 items; page size must be 1..=100. - Path
- Deserialize path parameters with safe Capy JSON rejections.
Native extraction remains available as
capy::axum::extract::Path. - Query
- Deserialize a query string with safe Capy JSON rejections.
Native extraction remains available as
capy::axum::extract::Query. - Route
Info - A declared route, used by
capy routeswithout connecting to a database. - Routes
- A native Axum router together with a small, explicit route inventory.
Traits§
- ApiSchema
- A type which can be described as a JSON Schema document.
Functions§
- health
- The default health response; it deliberately performs no database query.
Type Aliases§
- Paginated
- JSON contract name for the existing bounded collection response.
- Pagination
Meta - JSON contract name for the existing pagination metadata.
Derive Macros§
- ApiSchema
- Derive macro for
JsonSchematrait.