1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
use schemars::JsonSchema;
#[derive(JsonSchema)]
pub struct Struct1(#[validate(regex = 0, foo, length(min = 1, equal = 2, bar))] String);
#[derive(JsonSchema)]
pub struct Struct2(#[schemars(regex = 0, foo, length(min = 1, equal = 2, bar))] String);
#[derive(JsonSchema)]
pub struct Struct3(
#[validate(
regex = "foo",
contains = "bar",
regex(path = "baz"),
phone,
email,
url
)]
String,
);
#[derive(JsonSchema)]
pub struct Struct4(
#[schemars(
regex = "foo",
contains = "bar",
regex(path = "baz"),
phone,
email,
url
)]
String,
);
fn main() {}
|