You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Validating an empty 'FieldWithIssue' gives a validation error, correctly.
When nested as OneTwo.F1.field, it also gives the validation error.
However, when nested as TwoOne.F1.field, and when the need_this string is set to a value, it does not fail validation.
The number of the fields doesn't seem to matter, only the order they appear in.
messageOneTwo {
F1field1=1;
F2field2=2;
}
messageTwoOne {
F2field2=1;
F1field1=2;
}
messageF2 {
FieldWithIssuefield=1;
}
messageF1 {
stringneed_this=1; // This needs a value, leaving it empty validates correctlyFieldWithIssuefield=2;
}
messageFieldWithIssue {
F1f1=1; // This must be before the name string, but does not need a valuestringname=2 [(buf.validate.field).string.min_len = 1];
}
Steps to Reproduce
$ git clone https://github.com/daemonl/pvbug
$ cd pvbug
$ buf generate && go test ./...
Expected Behavior
Expected to see the message marked as invalid in all cases
Actual Behavior
--- FAIL: TestLocalJ5 (0.01s)
--- FAIL: TestLocalJ5/Wrapped_in_order_2_1 (0.00s)
test_test.go:75: Fresh Validation should have failed
FAIL
FAIL github.com/daemonl/pvbug 0.271s
FAIL
Environment
Operating System: macOS - M1
Version: macOS Sonoma 14.6.1
Compiler/Toolchain: go1.22.4 darwin/arm64
Protobuf Compiler & Version: buf 1.33.0
Protoc-gen-validate Version: ?
Protovalidate Version v0.6.4
Possible Solution
I'm gonna guess it's something to do with recursive lazy loading
The text was updated successfully, but these errors were encountered:
Description
A bit difficult to describe, but there are circumstances where the validator will incorrectly skip a message.
https://github.com/daemonl/pvbug is a full demo
Validating an empty 'FieldWithIssue' gives a validation error, correctly.
When nested as
OneTwo.F1.field
, it also gives the validation error.However, when nested as
TwoOne.F1.field
, and when theneed_this
string is set to a value, it does not fail validation.The number of the fields doesn't seem to matter, only the order they appear in.
Steps to Reproduce
Expected Behavior
Expected to see the message marked as invalid in all cases
Actual Behavior
Environment
Possible Solution
I'm gonna guess it's something to do with recursive lazy loading
The text was updated successfully, but these errors were encountered: