Repository navigation
Fix generated default and fixed string literals in Python C++ and C# - #140
Closed
nth-bailey wants to merge 4 commits into
Closed
nth-bailey wants to merge 4 commits into
nth-bailey wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generated Python string defaults could lose backslashes or emit unterminated source when XSD character references produce newlines. Python fixed/default metadata used Rust Unicode escape syntax; C++ string initializers and C# default/fixed proxies had similar escaping gaps.
Use the existing target-compatible literal encoders for these sites. C# also encodes carriage returns as numeric XML references when parsing its internal default/fixed value element, preserving xs:string values through XML line-ending normalization.
The consumer regression compiles and executes Python dataclasses, Pydantic, C++ and C# against an independent UTF-8 fixture. It checks quotes, literal backslash-u text, referenced tabs/newlines/carriage returns, Unicode separators, non-ASCII text, empty-element defaults and fixed-value rejection. This change addresses literal encoding at these sites; it does not add missing default semantics to other backends or fields.
Validation: 327 Rust tests; strict workspace formatting/Clippy; 115 Python tests with 100% statement/branch coverage; all seven CLI backends; bounded CType, AttrDecl and NIST comparisons with byte-identical summaries/failure tables. The generated-model test helper and smoke script now honor isolated Cargo targets.
See the report and raw evidence.
Stacked on #138, which fixes XSD attribute normalization and enum literals. Keep this draft until that change and #137 are reviewed.