Closed itsbalamurali closed 7 months ago
As far as I have tested/read, schemars::JsonSchema
have a #[validate(...)]
attribute that matches validator::Validate
, from the validator crate.
#[derive(JsonSchema)]
struct Example {
#[validate(length(min = 5))]
field: String,
#[validate(range(min = 18, max = 20))]
number: u32,
}
Was this what you needed?
Thanks @y-haidar !
How to define min / max for ints/numbers Query params?