Fixed an edge-case bug when reading getter for enum value, updates XObjectsCodeGen version#89
Merged
Merged
Conversation
… to clashing with C# keyword.
…ng publishing new releases as the version number wasn't being updated!
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses an enum parsing edge case in the runtime services where enum facet mappings may return C#-escaped member names (prefixed with @), and updates project/package versioning and release notes for the 3.4.15 release.
Changes:
- Adjust enum facet member parsing to strip a leading
@before enum parsing (keyword-escaped enum identifiers). - Add/rename NUnit tests covering enum keyword cases and clarify a configuration test name.
- Centralize/align versioning for
XObjectsCodeGenand bump repo version + release notes to3.4.15.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| XObjectsTests/WssApiUseTests.cs | Adds new tests targeting enum values that clash with C# keywords (e.g., @false). |
| XObjectsTests/LinqToXsdConfigurationTests.cs | Renames a test to better reflect the enum/keyword scenario. |
| XObjectsCore/API/XTypedServices.cs | Updates enum facet parsing logic to handle keyword-escaped enum member names. |
| XObjectsCode/XObjectsCodeGen.csproj | Removes hardcoded package version to rely on central versioning. |
| Version.props | Bumps the repository version to 3.4.15. |
| RELEASENOTES.md | Adds release notes entry for 3.4.15. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
"The '@' stripping should only be applied when a facet mapping was found (i.e., when enumFacet != null). As written, if GetEnumFacet(strValue) returns null and the raw XML value begins with '@', this will silently change the value. Also, the equivalent enum parsing overload for XElement (ParseValue(XElement element, ..., typeDef)) still returns enumFacet.Member without stripping '@', so element-backed enum getters can still throw." Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
v3.4.15