vld-web 0.9.0

Web framework integrations for the vld validation library: axum, actix-web, ntex, poem, Rocket, salvo, warp, rama, Tower, tonic, async-graphql, WebSocket (tungstenite, axum), AWS Lambda
Documentation

Crates.io Downloads docs.rs Guide License Donate

vld-web

Request extractors and JSON error responses that validate with vld schemas, one module per web framework.

[dependencies]
vld = "0.8"
vld-web = { version = "0.8", features = ["axum"] }
use axum::{routing::post, Router};
use vld_web::axum::VldJson;

vld::schema! {
    #[derive(Debug)]
    pub struct CreateUser {
        pub name: String => vld::string().min(2).max(50),
        pub email: String => vld::string().email(),
    }
}

async fn create(VldJson(user): VldJson<CreateUser>) -> String {
    format!("created {}", user.name) // invalid bodies never get here: 422 / 415 / 413
}

let app: Router = Router::new().route("/users", post(create));
Module Feature Framework
axum axum axum 0.8 (also loco-rs controllers: guide)
actix actix actix-web 4
ntex3 / ntex4 ntex-3 / ntex-4 (+ ntex-compress) ntex 3 / 4
poem poem poem 3
rocket rocket Rocket 0.5
salvo salvo salvo 1
warp warp warp 0.3 – 0.4
rama rama rama 0.4
tower tower any Tower service
tonic tonic tonic 0.12 – 0.14
async_graphql async-graphql async-graphql 7
tungstenite tungstenite tungstenite 0.26 – 0.30 WebSocket messages (tokio-/async-tungstenite)
axum::ws axum-ws axum WebSocket messages
lambda lambda AWS Lambda (lambda_http 1, raw lambda_runtime events)
rmcp rmcp MCP tools (rmcp 3): vld-validated arguments, isError results with model feedback
rig rig rig 0.47 tools: vld-validated arguments, schema per LLM provider
common — framework-agnostic helpers for custom adapters

No feature is on by default; any set can be enabled together.

Support

If vld helps you, you can support it via DonationAlerts. Bugs and ideas: issues.

License

MIT