All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- New
rustapi-tooncrate: TOON (Token-Oriented Object Notation) format support- LLM-optimized data serialization format
- Content negotiation via
Acceptheader (application/toon,application/json) Toon<T>extractor and responderToonNegotiate<T>for automatic format selectionLlmResponse<T>for AI-friendly structured responses- OpenAPI integration with TOON schema support
toonfeature flag inrustapi-rsfor opt-in TOON supporttoon-apiexample demonstrating TOON format usage- Improved cookie extraction test for duplicate cookie names
- Updated
rustapi-rsto re-export toon module when feature enabled
0.1.2 - 2024-12-31
skip_pathsmethod for JwtLayer to exclude paths from JWT validationdocs_with_authmethod for Basic Auth protected Swagger UIdocs_with_auth_and_infomethod for customized protected docs
- auth-api example now demonstrates protected docs with Basic Auth
- JWT middleware can now skip validation for public endpoints
0.1.1 - 2024-12-31
- Body size limit middleware with configurable limits
.body_limit(size)builder method on RustApi (default: 1MB)- 413 Payload Too Large response for oversized requests
- Production error masking (
RUSTAPI_ENV=production) - Development error details (
RUSTAPI_ENV=development) - Unique error IDs (
err_{uuid}) for log correlation - Enhanced tracing layer with request_id, status, and duration
- Custom span field support via
.with_field(key, value) - Prometheus metrics middleware (feature-gated)
http_requests_totalcounter with method, path, status labelshttp_request_duration_secondshistogramrustapi_infogauge with version information/metricsendpoint handler- TestClient for integration testing without network binding
- TestRequest builder with method, header, and body support
- TestResponse with assertion helpers
RUSTAPI_DEBUG=1macro expansion output support- Improved route path validation at compile time
- Enhanced route conflict detection messages
- Error responses now include
error_idfield - TracingLayer enhanced with additional span fields
0.1.0 - 2024-12-01
- Core HTTP server built on tokio and hyper 1.0
- Radix-tree based routing with matchit
- Request extractors:
Json<T>,Query<T>,Path<T> - Response types with automatic serialization
- Async handler support
- Basic error handling with
ApiError #[rustapi::get],#[rustapi::post]route macros#[rustapi::main]async main macro
- Automatic OpenAPI spec generation
- Swagger UI at
/docsendpoint - Request validation with validator crate
#[validate]attribute support- 422 Unprocessable Entity for validation errors
#[rustapi::tag]and#[rustapi::summary]macros- Schema derivation for request/response types
- JWT authentication middleware (
jwtfeature) AuthUser<T>extractor for authenticated routes- CORS middleware with builder pattern (
corsfeature) - IP-based rate limiting (
rate-limitfeature) - Configuration management with
.envsupport (configfeature) - Cookie parsing extractor (
cookiesfeature) - SQLx error conversion (
sqlxfeature) - Request ID middleware
- Middleware layer trait for custom middleware
extrasmeta-feature for common optional featuresfullfeature for all optional features