-
-
Notifications
You must be signed in to change notification settings - Fork 769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tag
is not affected by rename_all
#2776
Comments
something like #2324 would also resolve this issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rename_all
is useful in situations where the format you're serializing from and the format you're serializing to may have different forms (i.e.rename_all(serialize = "SCREAMING_SNAKE_CASE", deserialize = "kebab-case")
. It seems that when specifyingtag
for enums, the tag name is not affected by therename_all
attribute. This leads to inconsistencies in the serialized/deserialized data. There is also no way to specify a different tag value forSerialize
andDeserialize
.Example Output from
serde_json::to_string_pretty
:Example Code:
playground link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f5b7b498f6ae4abfbd85b905a6b28b34
The text was updated successfully, but these errors were encountered: