Skip to content

Fix prefix in digit-led enum XDR-JSON names - #639

Merged
leighmcculloch merged 4 commits into
mainfrom
fix-json-digit-enum-names
Nov 18, 2026
Merged

leighmcculloch merged 4 commits into
mainfrom
fix-json-digit-enum-names

Conversation

@leighmcculloch

Copy link
Copy Markdown
Member

What

Serialize enum members whose prefix-stripped name starts with a digit using that stripped name in XDR-JSON, so BinaryFuseFilterType becomes 8_bit, 16_bit and 32_bit while the Rust variants stay B8Bit, B16Bit and B32Bit.

This change is backwards compatible for reading.

Why

The generator prepends the prefix's first letter to make a valid Rust identifier because Rust identifiers cannot begin with a number. However that also meant the serde derived name that ends up in XDR-JSON was producing names like b8_bit instead of 8_bit. To be consistent with SEP-51 the name in the XDR-JSON should be 8_bit.

Close #634

Known limitations

N/A

@leighmcculloch leighmcculloch changed the title Drop prefix letter from digit-led enum JSON names Fix prefix in digit-led enum XDR-JSON names Nov 18, 2026
@leighmcculloch
leighmcculloch requested a review from a team November 18, 2026 04:15
@leighmcculloch
leighmcculloch added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit ce849b0 Nov 18, 2026
70 checks passed
@leighmcculloch
leighmcculloch deleted the fix-json-digit-enum-names branch November 18, 2026 21:02
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.

XDR-JSON for BinaryFuseFilterType renders "b8_bit" instead of "8_bit", inconsistent with SEP-51

2 participants