Skip to content

Add support for handling unrecognized keywords - #1982

Merged
Vincent Biret (baywet) merged 10 commits into
vnextfrom
mk/support-unrecognized-keywords
Dec 19, 2024
Merged

Add support for handling unrecognized keywords#1982
Vincent Biret (baywet) merged 10 commits into
vnextfrom
mk/support-unrecognized-keywords

Conversation

@MaggieKimani1

Copy link
Copy Markdown
Contributor

Fixes #1970

UnresolvedReference = schema?.UnresolvedReference ?? UnresolvedReference;
Reference = schema?.Reference != null ? new(schema?.Reference) : null;
Annotations = schema?.Annotations != null ? new Dictionary<string, object>(schema?.Annotations) : null;
UnrecognizedKeywords = schema?.UnrecognizedKeywords != null ? new Dictionary<string, JsonNode>(schema?.UnrecognizedKeywords) : null;

Check warning

Code scanning / CodeQL

Virtual call in constructor or destructor

Avoid virtual calls in a constructor or destructor.
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Comment thread src/Microsoft.OpenApi/Reader/V31/OpenApiSchemaDeserializer.cs
Pattern = schema?.Pattern ?? Pattern;
MultipleOf = schema?.MultipleOf ?? MultipleOf;
_default = schema?.Default != null ? JsonNodeCloneHelper.Clone(schema?.Default) : null;
Default = schema?.Default != null ? JsonNodeCloneHelper.Clone(schema?.Default) : null;

Check warning

Code scanning / CodeQL

Virtual call in constructor or destructor

Avoid virtual calls in a constructor or destructor.
Discriminator = schema?.Discriminator != null ? new(schema?.Discriminator) : null;
_example = schema?.Example != null ? JsonNodeCloneHelper.Clone(schema?.Example) : null;
_examples = schema?.Examples != null ? new List<JsonNode>(schema.Examples) : null;
Example = schema?.Example != null ? JsonNodeCloneHelper.Clone(schema?.Example) : null;

Check warning

Code scanning / CodeQL

Virtual call in constructor or destructor

Avoid virtual calls in a constructor or destructor.
_example = schema?.Example != null ? JsonNodeCloneHelper.Clone(schema?.Example) : null;
_examples = schema?.Examples != null ? new List<JsonNode>(schema.Examples) : null;
Example = schema?.Example != null ? JsonNodeCloneHelper.Clone(schema?.Example) : null;
Examples = schema?.Examples != null ? new List<JsonNode>(schema.Examples) : null;

Check warning

Code scanning / CodeQL

Virtual call in constructor or destructor

Avoid virtual calls in a constructor or destructor.
@baywet
Vincent Biret (baywet) merged commit 8bf3fbe into vnext Dec 19, 2024
@baywet
Vincent Biret (baywet) deleted the mk/support-unrecognized-keywords branch December 19, 2024 12:25
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Reliability Rating on New Code (required ≥ A)
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Ondrej Oprala (ooprala) pushed a commit to VitaliyKurokhtin/OpenAPI.NET that referenced this pull request Feb 4, 2025
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.

[API Review] : Implement support for handling unrecognized keywords in the OpenAPISchema

3 participants