Registry / web-framework / actix-web-validator

actix-web-validator

JSON →
library7.0.0rscratesunverified

Validation mechanism for actix-web using validator derive macros.

# Cargo.toml [dependencies] actix-web-validator = "7.0.0"
INSTALL
IMPORT
SIG · ACTIX-WEB-VALIDATO
A
actix-web-validator
web-frameworkrustv7.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Validated
use actix_web_validator::Validated;

Validate incoming form data using Validated extractor.

use actix_web::{web, App, HttpServer}; use actix_web_validator::Validated; use serde::Deserialize; use validator::Validate; #[derive(Deserialize, Validate)] struct FormData { #[validate(email)] email: String, } async fn handler(form: Validated<FormData>) -> String { format!("Valid email: {}", form.email) } #[actix_web::main] async fn main() -> std::io::Result<()> { HttpServer::new(|| App::new().route("/", web::post().to(handler))) .bind("127.0.0.1:8080")? .run() .await }
Debug
Known issues
gotchaRequires the `validator` crate and its derive feature
fix
Add `validator = { version = "0.16", features = ["derive"] }` to Cargo.toml
affects: >=7.0.0
Upgrade
Version history
7.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
45 hits · last 30 days
node
34
OpenAI (training)
1
Resources
actix-web-validator — cargo add actix-web-validator · libregistry