Skip to content

Rename MessageReflector to ValidateMessage and add coverage tests#6

Merged
andrewparmet merged 2 commits into
pv-message-reflector-purefrom
pv-validate-message-tests
Jun 18, 2026
Merged

Rename MessageReflector to ValidateMessage and add coverage tests#6
andrewparmet merged 2 commits into
pv-message-reflector-purefrom
pv-validate-message-tests

Conversation

@andrewparmet

Copy link
Copy Markdown
Owner

Stacked on #5 (the MessageReflector branch in this fork).

  • Renames MessageReflector to ValidateMessage (and ProtobufMessageReflector/MessageReflectorValue accordingly).
  • Adds descriptive messages to the jvmValue UnsupportedOperationException on the message-value types.
  • Adds ValidateMessageTest, validating through a map-backed ValidateMessage (no com.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 a ValidateMessage.

@andrewparmet andrewparmet force-pushed the pv-validate-message-tests branch from 48a8bd6 to 87b22d5 Compare June 18, 2026 03:05
andrewparmet and others added 2 commits June 17, 2026 23:15
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>
@andrewparmet andrewparmet force-pushed the pv-validate-message-tests branch from df2cbd9 to 2d39522 Compare June 18, 2026 03:16
@andrewparmet andrewparmet merged commit 2d39522 into pv-message-reflector-pure Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant