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.
This contains two main changes:
FieldValue
andRuleValue
to newerrors.Violation
type, alongside required plumbingA lot of different approaches were considered, but so far this seems to be the cleanest way to get the desired result. It also has the benefit of removing most of the unnecessary allocations that were added in the error case during the proto2 migration.
I think there is no particularly good reason to keep theAfter further discussion, I think we're not in a position to removeViolation
message as part of the protovalidate protobuf API, so I think it should be moved to the validation test harness.Violation
orViolations
from the API right now, due to usages outside of protovalidate (e.g. as error details, in connectrpc/validate-go.). We'll need to weigh in on this before 1.0.