Skip to content
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

Merged
merged 2 commits into from
Apr 5, 2024
Merged

Fixes cloning of JsonNode objects #1616

merged 2 commits into from
Apr 5, 2024

Conversation

irvinesunday
Copy link
Contributor

... and other nit fixes

@@ -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

Avoid virtual calls in a constructor or destructor.
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

Avoid virtual calls in a constructor or destructor.
@@ -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

Avoid virtual calls in a constructor or destructor.
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

Avoid virtual calls in a constructor or destructor.
@@ -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

Avoid virtual calls in a constructor or destructor.
@@ -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

Avoid virtual calls in a constructor or destructor.
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

Avoid virtual calls in a constructor or destructor.
@irvinesunday irvinesunday merged commit b9d5360 into release/2.0.0 Apr 5, 2024
6 of 8 checks passed
@irvinesunday irvinesunday deleted the is/v2-fixes branch April 5, 2024 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants