-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes cloning of JsonNode
objects
#1616
Conversation
@@ -68,10 +68,10 @@ | |||
{ | |||
Summary = example?.Summary ?? Summary; | |||
Description = example?.Description ?? Description; | |||
Value = example?.Value ?? JsonNodeCloneHelper.Clone(example?.Value); | |||
Value = example?.Value != null ? JsonNodeCloneHelper.Clone(example.Value) : null; |
Check warning
Code scanning / CodeQL
Virtual call in constructor or destructor Warning
ExternalValue = example?.ExternalValue ?? ExternalValue; | ||
Extensions = example?.Extensions != null ? new Dictionary<string, IOpenApiExtension>(example.Extensions) : null; | ||
Reference = example?.Reference != null ? new(example?.Reference) : null; | ||
Reference = example?.Reference != null ? new(example.Reference) : null; |
Check warning
Code scanning / CodeQL
Virtual call in constructor or destructor Warning
@@ -114,8 +114,8 @@ | |||
Style = header?.Style ?? Style; | |||
Explode = header?.Explode ?? Explode; | |||
AllowReserved = header?.AllowReserved ?? AllowReserved; | |||
Schema = header?.Schema != null ? JsonNodeCloneHelper.CloneJsonSchema(header?.Schema) : null; | |||
Example = header?.Example != null ? JsonNodeCloneHelper.Clone(header?.Example) : null; | |||
Schema = header?.Schema != null ? JsonNodeCloneHelper.CloneJsonSchema(header.Schema) : null; |
Check warning
Code scanning / CodeQL
Virtual call in constructor or destructor Warning
Schema = header?.Schema != null ? JsonNodeCloneHelper.CloneJsonSchema(header?.Schema) : null; | ||
Example = header?.Example != null ? JsonNodeCloneHelper.Clone(header?.Example) : null; | ||
Schema = header?.Schema != null ? JsonNodeCloneHelper.CloneJsonSchema(header.Schema) : null; | ||
Example = header?.Example != null ? JsonNodeCloneHelper.Clone(header.Example) : null; |
Check warning
Code scanning / CodeQL
Virtual call in constructor or destructor Warning
@@ -62,8 +62,8 @@ | |||
/// </summary> | |||
public OpenApiMediaType(OpenApiMediaType mediaType) | |||
{ | |||
_schema = JsonNodeCloneHelper.CloneJsonSchema(mediaType?.Schema); | |||
Example = JsonNodeCloneHelper.Clone(mediaType?.Example); | |||
Schema = mediaType?.Schema != null ? JsonNodeCloneHelper.CloneJsonSchema(mediaType.Schema) : null; |
Check warning
Code scanning / CodeQL
Virtual call in constructor or destructor Warning
@@ -168,9 +168,9 @@ | |||
Style = parameter?.Style ?? Style; | |||
Explode = parameter?.Explode ?? Explode; | |||
AllowReserved = parameter?.AllowReserved ?? AllowReserved; | |||
Schema = parameter?.Schema != null ? JsonNodeCloneHelper.CloneJsonSchema(parameter?.Schema) : null; | |||
Schema = parameter?.Schema != null ? JsonNodeCloneHelper.CloneJsonSchema(parameter.Schema) : null; |
Check warning
Code scanning / CodeQL
Virtual call in constructor or destructor Warning
Examples = parameter?.Examples != null ? new Dictionary<string, OpenApiExample>(parameter.Examples) : null; | ||
Example = parameter?.Example != null ? JsonNodeCloneHelper.Clone(parameter?.Example) : null; | ||
Example = parameter?.Example != null ? JsonNodeCloneHelper.Clone(parameter.Example) : null; |
Check warning
Code scanning / CodeQL
Virtual call in constructor or destructor Warning
... and other nit fixes