vld-rocket
Deprecated.
vld-rocketis not developed any more. Since vld 0.8 it is part ofvld-web:vld_web::rocket.= { = "0.8", = ["rocket"] }Migration guide: https://s00d.github.io/vld/guides/migration#from-07-to-08. This version (0.7.1) is 0.7.0 unchanged, with this notice.
Rocket 0.5 guards that validate JSON bodies, query strings, path segments, forms, headers and cookies with vld schemas, plus catchers that answer with JSON errors.
Install
[]
= "0.5"
= "0.5"
= { = "0.5", = ["json"] }
Example
use *;
schema!
Invalid input is answered with 422 and {"error": "Validation failed", "issues": [{"path": ".name", "message": "...", "code": "too_small"}]}; a wrong Content-Type is 415, a body over the limit is 413. Bodies are limited by Rocket's json / form limits; while those are at Rocket's built-in defaults, 2 MiB applies.
Guards: VldJson, VldForm, VldQuery, VldPath, VldHeaders, VldCookie.
Documentation
- Guide: https://s00d.github.io/vld/integrations/web/rocket
- Shared adapter rules: https://s00d.github.io/vld/integrations/web/overview
- API: https://docs.rs/vld-rocket
MSRV: 1.85 (MSRV.md).
License
MIT