Appends format property value to root schema if contained in anyOf, oneOf or allOf when serializing as v2#1001
Merged
irvinesunday merged 5 commits intovnextmicrosoft/OpenAPI.NET:vnextfrom Sep 7, 2022
fix/is/format-prop-paramsmicrosoft/OpenAPI.NET:fix/is/format-prop-paramsCopy head branch name to clipboard
Merged
Appends format property value to root schema if contained in anyOf, oneOf or allOf when serializing as v2#1001irvinesunday merged 5 commits intovnextmicrosoft/OpenAPI.NET:vnextfrom fix/is/format-prop-paramsmicrosoft/OpenAPI.NET:fix/is/format-prop-paramsCopy head branch name to clipboard
format property value to root schema if contained in anyOf, oneOf or allOf when serializing as v2#1001irvinesunday merged 5 commits intovnextmicrosoft/OpenAPI.NET:vnextfrom
fix/is/format-prop-paramsmicrosoft/OpenAPI.NET:fix/is/format-prop-paramsCopy head branch name to clipboard
Conversation
baywet
requested changes
Sep 7, 2022
Comment on lines
569
to
571
| Format ??= AllOf?.FirstOrDefault(static x => x.Format != null)?.Format ?? | ||
| AnyOf?.FirstOrDefault(static x => x.Format != null)?.Format ?? | ||
| OneOf?.FirstOrDefault(static x => x.Format != null)?.Format; |
Member
There was a problem hiding this comment.
I'm not super familiar with the code base here. But shouldn't this have a condition to only do it when we are serializing to v2?
Also, the conditions should be string.IsNullOrEmpty, not just a null comparison.
Contributor
Author
There was a problem hiding this comment.
This method is only called by methods that serialize as v2
Member
There was a problem hiding this comment.
thanks for the precision. for the string is null or empty comment, I was also referring to the lambdas
Member
|
also we should probably bump the preview version to we can use it in the conversion lib PR |
baywet
approved these changes
Sep 7, 2022
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.
Fixes #992
This PR:
formatproperty value from the child schemas ofanyOf,oneOforallOfand appends this to the root schema when serializing as v2 (when writing items as properties).