Skip to content

Conversation

@edif2008
Copy link
Member

Summary

This PR fixes generating Algebraic Rust Enums in Go to properly set the constant values according to the serde configuration for that enum.

Background

For Algebraic Rust Enums, when generating them in Go, the values of the constants were the original name of the enum variant instead of the renamed one, which takes into consideration the serde attributes. Because of that, it could happen that in such enums the JSON unmarshalling will fail due to not having any content to process. That was caused by the match case not hitting any variant.

For Algebraic Rust Enums, when generating them in Go, the values of the constants were the original name of the enum variant instead of the renamed one, which takes into consideration the serde attributes. Because of that, it could happen that in such enums the unmarshaling of JSON will fail due to not having any content to process. That was caused by the match case not hitting any variant.
@edif2008 edif2008 merged commit 6528569 into main Feb 28, 2025
6 checks passed
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.

3 participants