Skip to content

Validate DynamicMessage values before set#272

Open
fallintoplace wants to merge 1 commit into
anthropics:mainfrom
fallintoplace:fix/dynamic-message-value-validation
Open

Validate DynamicMessage values before set#272
fallintoplace wants to merge 1 commit into
anthropics:mainfrom
fallintoplace:fix/dynamic-message-value-validation

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Summary

  • validate DynamicMessage::try_set values against the target field descriptor before mutation
  • add a WrongValueKind reflection error for mismatched singular, repeated, map, and nested message values
  • skip invalid stored values during encode so direct mutable field access cannot emit tag-only wire bytes

Tests

  • cargo test -p buffa-descriptor --test dynamic_e2e --features reflect
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test --workspace --all-features

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

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