Skip to content

Fixed an edge-case bug when reading getter for enum value, updates XObjectsCodeGen version#89

Merged
mamift merged 5 commits into
masterfrom
bug/linqToXsdConfigBug
May 9, 2026
Merged

Fixed an edge-case bug when reading getter for enum value, updates XObjectsCodeGen version#89
mamift merged 5 commits into
masterfrom
bug/linqToXsdConfigBug

Conversation

@mamift
Copy link
Copy Markdown
Owner

@mamift mamift commented May 8, 2026

  • Fixes a bug which threw an exception when accessing the property getter for an element or attribute whose type is an enum type where the enum value shares the same name with a C# keyword, and thus the string value (ToString) returns a word prefixed with the '@' symbol.
  • Fixes an issue with publishing new XObjectsCodeGen nuget releases.

v3.4.15

Copilot AI review requested due to automatic review settings May 8, 2026 06:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 XObjectsCodeGen and bump repo version + release notes to 3.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.

Comment thread XObjectsCore/API/XTypedServices.cs Outdated
Comment thread XObjectsCore/API/XTypedServices.cs Outdated
Comment thread XObjectsTests/WssApiUseTests.cs
Comment thread XObjectsTests/WssApiUseTests.cs
Comment thread XObjectsTests/WssApiUseTests.cs
"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>
@mamift mamift merged commit f77808f into master May 9, 2026
5 checks passed
@mamift mamift deleted the bug/linqToXsdConfigBug branch May 9, 2026 11:38
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.

2 participants