Expand description
§vld-rama — Rama integration for the vld validation library
Provides extractors and a ValidateJsonLayer that validate HTTP request
data using vld schemas (no serde::Deserialize required):
| API | Source |
|---|---|
VldJson<T> | JSON request body |
VldQuery<T> | URL query parameters |
VldPath<T> | URL path parameters |
VldForm<T> | URL-encoded form body |
VldHeaders<T> | HTTP headers |
VldCookie<T> | Cookie values |
ValidateJsonLayer<T> | Middleware for Service stacks |
All extractors return 422 Unprocessable Entity on validation failure.
Requires Rust 1.96+ (Rama MSRV).
Modules§
- prelude
- Prelude — import everything you need.
Structs§
- Validate
Json Layer - A Rama
Layerthat validates JSON request bodies withvld. - Validate
Json Service - Service produced by
ValidateJsonLayer. - Validated
- Wrapper stored in Rama
Extensionsso validated values do not require a manualExtensionimpl onT. - VldCookie
- Rama extractor that validates cookie values from the
Cookieheader. - VldForm
- Rama extractor that validates URL-encoded form bodies.
- VldHeaders
- Rama extractor that validates HTTP headers.
- VldJson
- Rama extractor that validates JSON request bodies.
- VldPath
- Rama extractor that validates URL path parameters.
- VldQuery
- Rama extractor that validates URL query parameters.
- VldRejection
- Rejection returned when validation (or body parsing) fails.
Functions§
- try_
validated - Try to extract the validated value from request extensions.
- validated
- Extract the validated value from request extensions.