-
Notifications
You must be signed in to change notification settings - Fork 13
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
Implement predefined field constraints #178
base: main
Are you sure you want to change the base?
Conversation
…into jchadwick/shared-field-rules
We still need to synchronize this to the latest version of protovalidate, but that is held up for now. This can be reviewed/merged earlier if desired; it should pass all relevant conformance tests, except for the boolean rules fixes, because those would require the internal set of proto descriptors to be up-to-date. I'm going to push for reviews now so we can get this closed up as soon as possible. |
OK, it is now synchronized to Protovalidate v0.8.1 and should be ready to go. |
I decided to go over this PR today and made some adjustments. Updated to add an |
ExtensionRegistry
and aTypeRegistry
for resolving protobuf messages. Ordinarily, only aTypeRegistry
would necessarily be needed. However, we need to be able to resolve extensions defined in file descriptor sets we don't control, which means we need to be able to reparse to and from the user's descriptors in the worst case: to the user's descriptors to get the extended rule message (whose message type descriptors may have a different hashcode and thus may not resolve using just anExtensionRegistry
alone) and back from the user's descriptors in order to parse thepriv
/shared
field.rule
variable.ExtensionRegistry
and aTypeRegistry
. This enables the conformance runner to pass both the old conformance test suite and the new one, regardless of whether the proto descriptors match up.TODO:
This will depend on bufbuild/protovalidate#246.