Skip to content

builtin validator for json request #9

@Kilerd

Description

@Kilerd

currently we have the Schematic derived macro to mark it can be described as a Parameter, but we wanna introduce a integrated way to validate the value coming from user input.
like the email must be match the email regex, like #[validation(regex="[a-zA-Z]+@[a-z]{2}.com")] , like the number must be in the range of 0-100 :#[validation(min=0, max=100)]

so it means that we need to inject into the trait FromRequest. add a new trait called Validator and then impl Validator for MyStruct then impl FromRequest for T where T: Validator

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions