Question: How validate generated by protoc models?
- Dominant language
- Rust
- Stars
- 12.5k
- Forks
- 1.3k
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 24
Description
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:
```rust
#[derive(Debug, Validate, Deserialize)]
struct SignupData {
#[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,
}
```
Project: https://github.com/rdcm/news-board
Thanks
Contributor guide
Assessment
This issue has not been assessed yet.