Skip to content

Fix ambiguous string member serialization in generated contexts - #160

Merged
xoofx merged 2 commits into
xoofx:mainfrom
HoMiyabi:fix-generated-string-members
Sep 20, 2026
Merged

xoofx merged 2 commits into
xoofx:mainfrom
HoMiyabi:fix-generated-string-members

Conversation

@HoMiyabi

@HoMiyabi HoMiyabi commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Generated serializers write string members with WriteScalar, so a string such as "null" is emitted without quotes and becomes a null reference on deserialization. Emit WriteString instead, matching root strings, collection elements, and reflection-based serialization.

Add regression coverage for nullable and non-nullable string members, ambiguous scalar values, empty strings, actual null values, and disabling ambiguous scalar quoting.

@xoofx xoofx added the bug label Sep 5, 2026

@xoofx xoofx left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed the generator change and regression coverage. WriteString correctly preserves ambiguous CLR string values while retaining null handling and the opt-out behavior. All 675 tests passed locally. Added and pushed documentation for the quoting behavior; the documentation build passes (with an existing unrelated CurrentKey xref warning).

@xoofx
xoofx merged commit 9320d98 into xoofx:main Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants