Address PR #2645 review comments: improve type checking logic and use JsonNode.DeepEquals#1
Merged
desjoerd merged 4 commits intofix/support-v2/gh-2629from Dec 15, 2025
Conversation
…and use JsonNode.DeepEquals in tests Co-authored-by: desjoerd <2460430+desjoerd@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix comments on PR 2645
Address PR #2645 review comments: replace Enum.IsDefined and use JsonNode.DeepEquals
Dec 15, 2025
desjoerd
requested changes
Dec 15, 2025
Co-authored-by: desjoerd <2460430+desjoerd@users.noreply.github.com>
Copilot
AI
changed the title
Address PR #2645 review comments: replace Enum.IsDefined and use JsonNode.DeepEquals
Address PR #2645 review comments: improve type checking logic and use JsonNode.DeepEquals
Dec 15, 2025
desjoerd
requested changes
Dec 15, 2025
Owner
desjoerd
left a comment
There was a problem hiding this comment.
See my comment on on the first type logic.
You should still remove null from the equation. You can still do that with a bit wise operator as that is done at more places in this class.
Co-authored-by: desjoerd <2460430+desjoerd@users.noreply.github.com>
Author
Updated to use |
desjoerd
approved these changes
Dec 15, 2025
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.
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.