rambler-digital-solutions / actix-web-validator

Rust library for providing validation mechanism to actix-web with Validator crate.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Validator version issues cause Compiler Error

c650 opened this issue · comments

commented

Hi, I was using validator 0.11 in my own project and yours uses validator 0.12. This for some strange reason I encountered a build error where the validator::traits::Validate trait was not satisfied for one of my structs.

The issue ended up being that I was deriving validator 0.11's Validate, while FromRequest on Json from this crate was using 0.12.

Please consider a pub use validator::Validate in this crate so that it is easy to use the same version of the Validate trait.

Sorry for the delay.
I think it's not a problem.
But actix-web-validator use 0.12 (latest) version of validator crate.
After adding reexport, Validator trait will be from 0.12 version and you can't use it with Validator from 0.11 version anyway. But you can replace it in your code.

validator = { version = ">=0.11, <=0.12", features = ["derive"] }

Thanks