aboutsummaryrefslogtreecommitdiffstats
path: root/validator_derive/tests/run-pass/schema.rs
blob: e219698ac05b13254337720be426be1353408d54 (plain)
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
#![feature(attr_literals)]

#[macro_use] extern crate validator_derive;
extern crate validator;
use validator::{Validate, ValidationError};

#[derive(Validate)]
#[validate(schema(function = "hey"))]
struct Test {
    s: String,
}

fn hey(_: &Test) -> Result<(), ValidationError> {
    Ok(())
}

#[derive(Validate)]
#[validate(schema(function = "hey2", skip_on_field_errors = false))]
struct Test2 {
    s: String,
}

fn hey2(_: &Test2) -> Result<(), ValidationError> {
    Ok(())
}


fn main() {}