-
Notifications
You must be signed in to change notification settings - Fork 19
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
[BUG] Non-deterministic error values when using string.uuid
#108
Comments
For a given message, you should see a deterministic result based on this logic:
I assume you are seeing both errors in your tests because you have test cases that exercise both kinds of validation failures. You should be able to just update your test cases to expect the more precise error messages for each case. If you are actually seeing non-determinism, or if the behavior doesn't match what I described above, then please share a reproducible example. |
Hey @oxisto, great to hear from you and hope protovalidate is working out in your project. Since you're bumping the I suggest the following:
Happy to help out if you'd like an upstream contribution. |
You are completely right. It seems that we had two validation rules one in the "outer" and one in the "inner" message and both were triggered. |
Thanks for the details on this! I was wondering where the exact messages were coming from. And thanks for the support, I managed to fix all the failing tests now. |
Description
After upgrading from 0.5 to 0.6 I get a non-deterministic behaviour when validating strings with the UUID validator when the string is empty. Half of the time I get
value is empty, which is not a valid UUID
, and half of the time I getvalue must be a valid UUID
. I guess the first one might be better, but it would be good (especially for testing) if either one or the other is used.Steps to Reproduce
[(buf.validate.field).string.uuid = true];
Expected Behavior
I would probably expect the new
value is empty, which is not a valid UUID
error stringActual Behavior
Half of the time I get
value is empty, which is not a valid UUID
, and half of the time I getvalue must be a valid UUID
Environment
The text was updated successfully, but these errors were encountered: