Skip to content

Keep input values out of enum JSON diagnostics - #830

Open
vanderbr wants to merge 1 commit into
anthropics:mainfrom
reallyme:reallyme/enum-json-diagnostics
Open

vanderbr wants to merge 1 commit into
anthropics:mainfrom
reallyme:reallyme/enum-json-diagnostics

Conversation

@vanderbr

@vanderbr vanderbr commented Nov 14, 2026 •

Copy link
Copy Markdown

Generated enum deserializers can expose an unrecognized name or number in a JSON error. Logging that error can disclose rejected input.

Use fixed diagnostics for standalone enum decoding, enum fields and collection boundaries, registered enum extensions, and reflection. Preserve strict standalone parsing, lenient field filtering, accepted JSON values, and null handling. Integer callbacks use checked narrowing: in-range 128-bit callbacks follow the existing enum conversions, while wider values fail without their contents. Registered extension errors retain their field-number context.

Regenerate bindings with the matching generator to update standalone enum deserialization. Checked-in descriptor bindings are regenerated. MSRV remains Rust 1.75.

Validation: 4,343 workspace tests, strict all-target/all-feature Clippy, formatting, rustdoc, Rust 1.75 checks and WASM checks passed. Focused regressions cover owned and reflective decoding, strict and lenient modes, signed/unsigned widths, malformed collection shapes, and actual arbitrary-precision JSON values.

Related to #822. #832 extends this change to other ProtoJSON conversions and wrong-kind diagnostics.

@github-actions

Copy link
Copy Markdown

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

Use fixed diagnostics for enum names, numeric ranges, scalar container shapes and registered extensions. Preserve strict standalone parsing, lenient field behavior and checked 128-bit narrowing.

Cover owned and reflective decoding, container boundaries and arbitrary-precision JSON values.

This branch has not been deployed

No deployments
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