v0.1.397
·
55 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
[0.1.397] - 2026-02-26
Added
Compile-Time Extractor Safety (rustapi-macros)
- Body-consuming extractor ordering enforced at compile time:
Json<T>,Body,ValidatedJson<T>must now be the last handler parameter — otherwise you get a clear compiler error instead of a silent runtime failure. - Descriptive error messages:
"Body-consuming extractors must be the last parameter". - Detects multiple body-consuming extractors in the same handler.
Typed Error Responses — OpenAPI Integration (rustapi-macros, rustapi-core)
- New
#[errors(404 = "Not found", 403 = "Forbidden")]attribute macro for route handlers. - Error types are automatically reflected in the OpenAPI spec with
ErrorSchemareferences. Route::error_response()builder method for programmatic error response registration.- Swagger UI now displays all possible error responses per endpoint.
Pagination & HATEOAS Helpers (rustapi-core)
Paginateextractor:?page=2&per_page=20with sensible defaults (page=1, per_page=20, max=100).Paginated<T>response wrapper: JSON body withitems/meta/_links, RFC 8288Linkheader,X-Total-Count&X-Total-Pagesheaders.CursorPaginateextractor:?cursor=abc&limit=20for cursor-based pagination.CursorPaginated<T>response wrapper:items+next_cursor+has_more.- Helper methods:
offset(),limit(),paginate(),after(),is_first_page(). - All types re-exported in the
rustapi-rsprelude.
Built-in Caching Layer (rustapi-extras)
- Full rewrite of the caching system with production-grade features:
- In-memory response cache with LRU eviction and configurable
max_entries(default: 10,000). - ETag generation via FNV-1a hash + automatic
If-None-Match→ 304 Not Modified. Cache-Controlheader awareness (no-cache,no-store).Vary-by-header cache key strategy.CacheHandlefor programmatic invalidation (by path prefix, exact key, or clear all).CacheBuilderfor ergonomic middleware configuration.
- In-memory response cache with LRU eviction and configurable
Event System & Lifecycle Hooks (rustapi-core)
EventBus: In-process pub/sub with sync and async handlers.on()for sync handlers,on_async()for async handlers.emit()(fire-and-forget) andemit_await()(wait for all handlers).handler_count()andtopics()introspection.
- Lifecycle hooks on
RustApibuilder:.on_start(async { ... })— runs before the server starts accepting connections..on_shutdown(async { ... })— runs on graceful shutdown.- Integrated into both
run()andrun_with_shutdown().
EventBusre-exported in therustapi-rsprelude.
Native Hot Reload / Watch Mode (cargo-rustapi, rustapi-core)
- Complete rewrite of
cargo rustapi watchusingnotify+notify-debouncer-mini— no morecargo-watchdependency.- 300ms debounce, configurable extension filter, smart ignore paths.
- Build-before-restart: only restarts the server if
cargo buildsucceeds. - Graceful process shutdown (kill + 5s timeout), crash detection with "watching for changes" recovery.
.hot_reload(true)builder API onRustApi— prints a dev-mode banner with watcher hints.cargo rustapi run --watch/--reload/--hotdelegates to the native watcher.
gRPC Support Published (rustapi-grpc)
- First crates.io release of
rustapi-grpc v0.1.397. run_rustapi_and_grpc()for dual HTTP + gRPC server execution.- Re-exports
tonicandprostfor ergonomic proto service integration. protocol-grpcfeature flag inrustapi-rs.
What's Changed
- fix: address review feedback - validate pagination size and update doc status by @Copilot in #110
- docs: sync to v0.1.335, add pagination recipe, and improve learning path by @Tuntii in #109
- docs: enhance learning path and fix cookbook recipes by @Tuntii in #112
- Add optional rustapi-grpc crate (tonic/prost) by @Tuntii in #118
- docs: Add Background Jobs recipe and update Learning Path by @Tuntii in #120
- docs: Enterprise Learning Path & Testing Recipe by @Tuntii in #121
- core: stabilize facade API surface, feature taxonomy, and public-api CI gate by @Tuntii in #122
- docs: Add Phase 5 (Specialized Skills) and recipes for gRPC, SSR, and AI by @Tuntii in #123
- docs: Fix SSR recipe and update cookbook index by @Tuntii in #124
- docs: improve cookbook and learning path by @Tuntii in #125
- docs: Cookbook and Learning Path Improvements by @Tuntii in #126
- docs: continuous improvement and accuracy fixes by @Tuntii in #129
- docs: cookbook expansion and learning path improvements by @Tuntii in #132
- Fix review feedback: deduplication, pagination validation, lifecycle error handling, cache correctness by @Copilot in #140
- Add lifecycle hooks, pagination, and cache by @Tuntii in #139
Full Changelog: v0.1.335...v0.1.397