Skip to main content

Module api

Module api 

Source
Expand description

Type-safe API operation builder with compile-time guarantees

This module provides a type-state builder pattern that enforces at compile time that API operations cannot be registered unless both a handler and at least one response are specified.

Re-exports§

pub use error_layer::IntoProblem;
pub use error_layer::error_mapping_middleware;
pub use error_layer::extract_trace_id;
pub use error_layer::map_error_to_problem;
pub use openapi_registry::OpenApiInfo;
pub use openapi_registry::OpenApiRegistry;
pub use openapi_registry::OpenApiRegistryImpl;
pub use openapi_registry::ensure_schema;
pub use operation_builder::Missing;
pub use operation_builder::OperationBuilder;
pub use operation_builder::OperationSpec;
pub use operation_builder::ParamLocation;
pub use operation_builder::ParamSpec;
pub use operation_builder::Present;
pub use operation_builder::RateLimitSpec;
pub use operation_builder::ResponseSpec;
pub use operation_builder::state;
pub use problem::bad_request;
pub use problem::conflict;
pub use problem::internal_error;
pub use problem::not_found;
pub use select::apply_select;
pub use select::page_to_projected_json;
pub use select::project_json;
pub use trace_layer::WithRequestContext;
pub use trace_layer::WithTraceContext;

Modules§

api_dto
error_layer
Centralized error mapping for Axum
odata
openapi_registry
OpenAPI registry for schema and operation management
operation_builder
Type-safe API operation builder with compile-time guarantees
prelude
Prelude module that re-exports common API types and utilities for module authors
problem
Re-exports and convenience constructors for Problem types
response
select
Field projection support for $select OData queries.
trace_layer
Trace propagation utilities for Problem responses

Structs§

Problem
RFC 9457 Problem Details for HTTP APIs.
ValidationError
Collection of validation errors for 422 responses.

Constants§

APPLICATION_PROBLEM_JSON
Content type for Problem Details as per RFC 9457.