Discriminator - Ensure warning shows up in recursive case#4350
Open
gadcam wants to merge 1 commit intomicrosoft:mainfrom
Open
Discriminator - Ensure warning shows up in recursive case#4350gadcam wants to merge 1 commit intomicrosoft:mainfrom
gadcam wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Author
|
@microsoft-github-policy-service agree |
baywet
requested changes
Mar 19, 2024
Member
baywet
left a comment
There was a problem hiding this comment.
Thank you for the contribution.
I do think we'll need to make a few tweaks before we can merge this.
Also, can you add an entry to the changelog please? (unreleased, changed)
| return "object".Equals(schema?.Type, StringComparison.OrdinalIgnoreCase); | ||
| } | ||
|
|
||
| public static bool IsScalar(this OpenApiSchema? schema) |
Member
There was a problem hiding this comment.
this method name is confusing. An array would technically return true even though semantically it's not scalar.
Also the implementation checks two separate concerns: the structure (object) and the location (reference) of the schema.
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.
Traverse paths until exhaustion of the tree before checking if a discriminator is needed.
With the previous code the example added in the test where we have a
oneOfhidden inside anarraywould be enough to confuse the check.