Repository navigation
Bug 1929903 - Preserve object property names in Rust JSON - #890
Merged
Merged
Conversation
Add conditional Serde renames when schema properties differ from their generated Rust fields in the Rust and Rust Sym templates Extend the existing object test to cover original JSON keys for dotted, hyphenated, uppercase, nested, array, and union properties
badboy
requested changes
Nov 3, 2026
badboy
approved these changes
Nov 4, 2026
akasakariko
added a commit
to akasakariko/akasakariko
that referenced
this pull request
Nov 4, 2026
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.
Object properties such as
foo.bar-bazbecome Rust fields such asfoo_bar_bazwithout a Serde rename, causing serialization to emit the wrong JSON key and deserialization to reject the original schema keyAlways add Serde renames in the Rust and Rust Sym object templates while retaining the existing Rust field names, including fields whose names already match the schema
Extend the existing object test to cover dots, hyphens, uppercase names, nested objects, arrays, union properties, and an unchanged snake_case property
Bug 1929903: https://bugzilla.mozilla.org/show_bug.cgi?id=1929903
Firefox’s separate generator patch: https://phabricator.services.mozilla.com/D338979
Validation on
afa0dd058c1d7009670cc0fd5afad545dba6b5f6, after merging upstreammainatdc9ff80a8b1b9fb67fe8d7d8a57f3faa6a7c842c:git diff --check: passedmake test-fulland reported 337 passed; the documentation build passed with 9 warningsPull Request checklist
CHANGELOG.md; Rust field names remain unchanged