-
Notifications
You must be signed in to change notification settings - Fork 275
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
Issues with the PROTOVALIDATE rules when linting a proto file with optional fields and protovalidate constraints #2589
Comments
As for why This is similar to how in |
This is definitely a bug - we'll fix. |
Fixes #2589. This PR fixes the bug where `buf lint` incorrectly report error on proto3 optional fields.
Thanks for reporting this bug! This is fixed in #2590 and will go out in the next release. Sorry for the inconvenience |
This has been fixed in v1.28.1, sorry for the troubles. |
Thanks for the kind comments and quick fix. Really appreciate it 👍 |
The linting rules for protovalidate do not support optional fields with field constraints.
To reproduce:
In a proto file:
optional string abc = 1 [(buf.validate.field).required = true];
And then use as rules for running
buf
:Run the linter(I use
npx @bufbuild/buf lint
).You will get something similar to:
Workaround is to disable the PROTOVALIDATE rules, but I think that's a bad and temporary solution as you lose out on validation.
Please ask if additional context is needed.
The text was updated successfully, but these errors were encountered: