Conversation
ef92882 to
808590f
Compare
| } | ||
| } | ||
|
|
||
| impl<V> ValidateExt for Vec<V> |
There was a problem hiding this comment.
An implement for Vec<V> is now in the library creating conflicts.
https://github.com/Keats/validator/blob/0872516333bf365668a22e522c57dac64e60d398/validator/src/traits.rs#L50
There was a problem hiding this comment.
This is fantastic. This implementation has caused some hidden panics before. 😄
| validate_geo_polygon_line_helper(l)?; | ||
| Ok(()) | ||
| } | ||
| _ => Err(ValidationError::new("not_empty")), |
There was a problem hiding this comment.
the None case is checked with an extra validation in
qdrant/lib/api/src/grpc/conversions.rs
Line 1475 in 6336395
| function = "validate_unique_collections", | ||
| arg = "&'v_a mut HashSet<String>" | ||
| ))] | ||
| #[validate(custom(function = "validate_unique_collections", use_context))] |
There was a problem hiding this comment.
the new macro refused to work with HashSet<String> and forced me to create a new struct.
See context in https://github.com/Keats/validator?tab=readme-ov-file#custom
There was a problem hiding this comment.
😞
Since this struct doesn't leak to other places I'm totally fine with it.
timvisee
left a comment
There was a problem hiding this comment.
Thank you so much for going through all this trouble! 🙏
dc2eab4 to
dcab5a5
Compare
* Update Validator 0.18 * fix new test error message * clearer geo error message * fix error message * fix unit tests * Put spaces back --------- Co-authored-by: timvisee <[email protected]>
This update our
Validatorinfrastructure to the 0.18.1 version.The important changes are:
#[validate]becomes#[validate(nested)]for fields implementingValidate.Option<_>field will be executed on the contained type if the option isSome.