Skip to content

Make sure that flag enums with value zero are correctly serialized; fixes #640#644

Merged
liuzicheng1987 merged 1 commit intomainfrom
f/fix_enum
Apr 3, 2026
Merged

Make sure that flag enums with value zero are correctly serialized; fixes #640#644
liuzicheng1987 merged 1 commit intomainfrom
f/fix_enum

Conversation

@liuzicheng1987
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves the serialization of bitflag enums by handling cases where no flags are set and adds a corresponding test case. The review feedback suggests using the to_string_or_number helper instead of a hardcoded "0" to ensure that named constants for zero values (e.g., None = 0) are correctly serialized, along with a corresponding update to the test expectations.

@liuzicheng1987 liuzicheng1987 merged commit 498d9d0 into main Apr 3, 2026
613 of 624 checks passed
@liuzicheng1987 liuzicheng1987 deleted the f/fix_enum branch April 3, 2026 14:45
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.

1 participant