Closed remykarem closed 1 year ago
Thanks a lot for the issue. Somehow I didn't yet come across this issue (as I usually needed to use validator
anyways) but it's an interesting issue.
It originates as the Validate
derive will expand into code like this
impl ::validator::Validate for HelloData {
fn validate(&self) -> ::std::result::Result<(), ::validator::ValidationErrors> {
use ::validator::ValidateArgs;
self.validate_args(())
}
}
Which assumes that there is a module called validator
aka the crate itself. It's like the serde
one where rocket
reexports the crate so we can use #[serde(crate = "rocket::serde")]
.
Can't really see any other way than adding validator
as a direct dependency right now. Will look into this tomorrow.
Great, thanks!
I'm so sorry. Got caught up in some stuff.
Added a line to the readme
Awesome, cheers!
I get the following error when going through the json example:
example from https://github.com/somehowchris/rocket-validation/tree/main/examples/json-validation
But after I added
validator
as a dependency, it compiles.Should we update the docs to include this dependency?