Repository navigation
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
This was referenced Nov 14, 2026
vanderbr
force-pushed
the
reallyme/json-value-diagnostics
branch
from
November 18, 2026 02:12
4e89299 to
98c1dc6
Compare
Use fixed typed reasons across protobuf JSON helpers, generated visitors, well-known types and reflection. Preserve supported custom representations, formats and legal names. Redact invalid FieldMask paths during owned, borrowed and reflective serialization as well as parsing.
vanderbr
force-pushed
the
reallyme/json-value-diagnostics
branch
from
November 18, 2026 23:27
98c1dc6 to
9386a73
Compare
This branch has not been deployed
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.
ProtoJSON errors can disclose rejected values through numeric and base64 conversion errors, malformed temporal strings, map keys, registered Any decoders, and default Serde wrong-kind diagnostics.
Replace those value-bearing diagnostics with fixed reasons across scalar and enum helpers, optional/repeated/map/oneof positions, generated messages with a oneof or extension range, well-known types, registered Any decoding, and corresponding reflection paths. Include the complete enum diagnostics change from #830. Enum-map key conversion failures preserve native key grammar, borrowing, and syntax/I/O error categories while avoiding consumer error-context formatting. Ignored Empty keys are discarded without an additional allocation for their unescaped text.
Preserve custom string policies and the existing bool/default-string custom collection Serde paths, supported binary Serde encodings, and legal explicit json_name mappings. JSON null remains unset/default where required. Ordinary repeated-open-enum null-to-zero handling predates this PR and is addressed separately in #836. The YAML carrier uses stricter JSON kinds at newly routed default bool/string positions, including rejecting tagged scalar values. Empty/comment-only documents and previously accepted structural/temporal tags remain supported. Explicit empty YAML documents (
---) are rejected at structural roots because Serde presents them as the same unit kind as invalid JSON null.Scope limits remain: parser/deserializer and custom representation errors, derived messages without a oneof or extension range given a non-object, their message containers, Any given a non-object, unknown-field diagnostics outside Any, and serialization errors other than the FieldMask path errors covered here. Messages and Empty reject an unrecognized member named
$serde_json::private::Number; a schema explicitly using that json_name retains typed object checking and its early parser diagnostics can include input. Arbitrary-precision Serde JSON is not a generally supported protobuf mapping; focused tests ensure the covered failures do not disclose wide integers.Regenerate bindings with the matching generator. Release runtime, generator, buffa-types and buffa-descriptor together with dependency minimums raised to the release containing the new runtime helpers; publishing new generated code against an older runtime is unsupported. Version preparation stays on the release branch. MSRV remains Rust 1.75.
FieldMask serialization also uses a fixed typed reason when a binary or hand-built path has no ProtoJSON spelling. Owned, borrowed and reflective output agree, and the rejected path is never included. Accepted paths and deserialization behavior stay unchanged.
Validation:
The external protobuf conformance suite was not rerun for this follow-up.
Related to #822 and includes #830 until it merges.