gengteng / axum-valid

axum-valid is a library that provides data validation extractors for the Axum web framework. It integrates validator, garde and validify, three popular validation crates in the Rust ecosystem, to offer convenient validation and data handling extractors for Axum applications.
MIT License
100 stars 4 forks source link

Validating enums #26

Closed afroozeh closed 1 month ago

afroozeh commented 1 month ago

I have an enum that would like to define the Validate on it. All the variants have Validate on. I'm getting this error. Unsupported shape 'enum'. Expected struct with named fields. Without the Validate, Rust compiler complains about the signature of the handlers. Any workaround here?

afroozeh commented 1 month ago

It's actually related to validator, saw a solution here: https://github.com/Keats/validator/issues/77#issuecomment-534794958