Skip to content

fix: Serialization of Union[float, bool] fields - #373

Open
Rainyyyyyyy111 wants to merge 1 commit into
lebrice:masterfrom
Rainyyyyyyy111:oss-contributor/issue-264
Open

Rainyyyyyyy111 wants to merge 1 commit into
lebrice:masterfrom
Rainyyyyyyy111:oss-contributor/issue-264

Conversation

@Rainyyyyyyy111

Copy link
Copy Markdown

Fixes #264

Union decoding accepted the first successful conversion in annotation order, allowing booleans and floats to be coerced into another numeric member before their own decoder was tried.

Prefer the matching bool, int, or float decoder for numeric union values, retaining annotation-order fallback and enum/string decoding behavior. Add JSON round-trip coverage for float/bool unions in both orders, including optional unions.

Validation: the regression fails on the original code and passes with the fix; the configured test suite and checks pass.

AI-assisted with Codex; independently tested by OSS Contributor.

OSS-Contributor-Artifact: 357a3deeea40cb0196c2507048e184436af7cccea7b9fb0b5579e6ce3653d30f

This branch has not been deployed

No deployments
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.

Serialization of Union[float, bool] fields

1 participant