You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently actively developing an application using tonic and have now encountered a task to validate input data.
Is there any built-in validation mechanism in tonic?
Something like this:
#[derive(Debug,Validate,Deserialize)]structSignupData{#[validate(email)]mail:String,#[validate(url)]site:String,#[validate(length(min = 1), custom(function = "validate_unique_username"))]#[serde(rename = "firstName")]first_name:String,#[validate(range(min = 18, max = 20))]age:u32,#[validate(range(exclusive_min = 0.0, max = 100.0))]height:f32,}
@imotai Which way preferred for validate requests models in tonic app at this moment without feature request to prost? Quick solution, writing code in each endpoint like this: is_valid(req)?.
@imotai Which way preferred for validate requests models in tonic app at this moment without feature request to prost? Quick solution, writing code in each endpoint like this: is_valid(req)?.
Hi,
I am currently actively developing an application using tonic and have now encountered a task to validate input data.
Is there any built-in validation mechanism in tonic?
Something like this:
Project: https://github.com/rdcm/news-board
Thanks
The text was updated successfully, but these errors were encountered: