Add protovalidate as alternative to protoc-gen-validate #124
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I ran into this while looking into
authzed-rb
's implementation of validation. I hoped that it might solve that problem, but it turns out that there isn't aprotovalidate
implementation for ruby either (yet, I hope).I think there's still value in bringing this in, though.
protoc-gen-validate
is in maintenance mode: https://github.com/bufbuild/protoc-gen-validate?tab=readme-ov-file#-protoc-gen-validate-pgvThe library they want us to move to is
protovalidate
: https://github.com/bufbuild/protovalidateThis follows the steps in the migration guide to add annotations that are compatible with
protovalidate
and allow the downstream libs to use theprotovalidate
libs as desired.Notes
The breaking change lint step is complaining, but I ran it locally and it's not code that we use directly or control:
It appears to be complaining about the proto provided by the
grpc-gateway
dep, and that version bump happened when I added the new dependency. I'm not particularly concerned about it breaking anything.Changes
buf.yaml
to v2buf format
over everythingNotes
This does not remove support for protoc-gen-validate. We probably won't do that for a while yet. This should be a non-breaking change.
Testing
Review. See that our CI still passes.