Rename MessageReflector to ValidateMessage and add coverage tests#6
Merged
andrewparmet merged 2 commits intoJun 18, 2026
Merged
Conversation
48a8bd6 to
87b22d5
Compare
Rename the MessageReflector interface to ValidateMessage, and accordingly ProtobufMessageReflector -> ProtobufValidateMessage and MessageReflectorValue -> ValidateMessageValue (with its `reflector` field/locals renamed to `message`). Also give the jvmValue UnsupportedOperationException on the message-backed Value types a descriptive message: MessageValue notes it carries the rule message and should be read via messageValue()/celValue(); the ValidateMessage-backed value notes that a getField() implementation returned a message value for a field evaluated as a scalar.
Add ValidateMessageTest, which validates through a map-backed ValidateMessage (no com.google.protobuf.Message): scalar / nested / repeated / map / repeated-message / map-message violations and their field paths, a valid message, the well-known Timestamp type, bytes, enum, unsigned (uint32), the Int32Value wrapper, a required oneof, the clear error when a message field is not backed by a ValidateMessage, and that jvmValue is unsupported on the message-backed Value types. Co-authored-by: Jon Bodner <jbodner@buf.build>
df2cbd9 to
2d39522
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #5 (the MessageReflector branch in this fork).
MessageReflectortoValidateMessage(andProtobufMessageReflector/MessageReflectorValueaccordingly).jvmValueUnsupportedOperationExceptionon the message-value types.ValidateMessageTest, validating through a map-backedValidateMessage(nocom.google.protobuf.Message): scalar/nested/repeated/map/repeated-message/map-message violations and paths, valid, well-known Timestamp, bytes, enum, unsigned, wrapper, required oneof, and the clear error when a message field is not backed by aValidateMessage.