Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to validate Vec and inner values? #353

Open
t3ned opened this issue Oct 26, 2024 · 1 comment
Open

How to validate Vec and inner values? #353

t3ned opened this issue Oct 26, 2024 · 1 comment

Comments

@t3ned
Copy link

t3ned commented Oct 26, 2024

Is it possible to validate the length of a Vec, and the inner value such as an integer?

Given this example, this Vec must have a length of 1-10, and the inner u32 must fall within the range of 1-100. The code below is invalid

#[derive(Debug, Deserialize, Validate)]
struct Data {
    #[validate(length(min = 1, max = 10), range(min = 1, max = 100))]
    ids: Vec<u32>
}
@Keats
Copy link
Owner

Keats commented Nov 1, 2024

Not right now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants