Address PR #2645 review comments: improve type checking logic and use JsonNode.DeepEquals #1
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.
Pull Request
Description
Addresses review feedback on PR microsoft#2645 by replacing .NET 5+ specific
Enum.IsDefinedwith clear iteration logic and updating test assertions to use structural JSON comparison instead of string comparison.Type of Change
Related Issue(s)
Addresses review comments on https://github.com/microsoft/OpenAPI.NET/pull/2645/files
Changes Made
System.Enum.IsDefined(commonType)with clear iteration logic that explicitly checks if all schemas have the same type& ~JsonSchemaType.Nullbitwise operator to remove Null flag from type comparison, consistent with existing patterns in the classJsonNode.DeepEqualsinstead of string comparison withMakeLineBreaksEnvironmentNeutral()Testing
Checklist
Versions applicability
See the contributing guidelines for more information about how patches are applied across multiple versions.
Additional Notes
All 927 tests pass. Changes maintain backward compatibility while improving cross-framework support and code readability. The implementation uses the established bitwise pattern from the class for handling null flags.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.