Skip to content

Enhance enum parsing and nullable context handling#23

Merged
IvanMurzak merged 6 commits into
mainfrom
fix/better-older-dotnet-support
Nov 9, 2025
Merged

Enhance enum parsing and nullable context handling#23
IvanMurzak merged 6 commits into
mainfrom
fix/better-older-dotnet-support

Conversation

@IvanMurzak
Copy link
Copy Markdown
Owner

Improvements include better handling of null values in enum parsing and adjustments to nullable context handling in MethodUtils for compatibility with different .NET versions.

@IvanMurzak IvanMurzak self-assigned this Nov 9, 2025
@IvanMurzak IvanMurzak requested a review from Copilot November 9, 2025 08:21
@IvanMurzak IvanMurzak added the enhancement New feature or request label Nov 9, 2025
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 improves cross-platform compatibility by adjusting conditional compilation directives and adding defensive null checks for enum parsing operations.

  • Wraps JsonSchemaExporterContext method with conditional compilation and uses fully-qualified type name
  • Adjusts conditional compilation for NullableContextAttribute usage across .NET versions
  • Adds defensive null checks before Enum.IsDefined calls in enum conversion logic

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
ReflectorNet/src/Utils/TypeUtils.cs Removes System.Text.Json.Schema using directive, wraps GetPropertyDescription method with conditional compilation, and uses fully-qualified type name for JsonSchemaExporterContext
ReflectorNet/src/Utils/MethodUtils.cs Updates conditional compilation directives for NullableContextAttribute to support .NET Standard 2.1 and distinguish between .NET 8.0+ and .NET 5.0+
ReflectorNet/src/Reflector/MethodWrapper.cs Adds null check before Enum.IsDefined call in ConvertStringToEnum method
ReflectorNet/src/Convertor/Json/EnumJsonConverter.cs Adds null check before Enum.IsDefined call in enum string parsing logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ReflectorNet/src/Utils/MethodUtils.cs
Comment thread ReflectorNet/src/Utils/TypeUtils.cs
Comment thread ReflectorNet/src/Utils/MethodUtils.cs Outdated
Comment thread ReflectorNet/src/Utils/MethodUtils.cs Outdated
@IvanMurzak IvanMurzak requested a review from Copilot November 9, 2025 08:32
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…Utils for better understanding of environment support
@IvanMurzak IvanMurzak requested a review from Copilot November 9, 2025 08:41
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ReflectorNet/src/Reflector/MethodWrapper.cs Outdated
Comment thread ReflectorNet/src/Convertor/Json/EnumJsonConverter.cs Outdated
IvanMurzak and others added 2 commits November 9, 2025 00:45
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@IvanMurzak IvanMurzak requested a review from Copilot November 9, 2025 08:45
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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@IvanMurzak IvanMurzak merged commit 94ad953 into main Nov 9, 2025
7 checks passed
@IvanMurzak IvanMurzak deleted the fix/better-older-dotnet-support branch November 9, 2025 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants