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

Define JSON schema's Type property as a flaggable enum to allow storing multiple values #1897

Merged
merged 19 commits into from
Oct 31, 2024

Conversation

MaggieKimani1
Copy link
Contributor

Fixes #1874

@MaggieKimani1 MaggieKimani1 marked this pull request as draft October 28, 2024 17:53
@MaggieKimani1 MaggieKimani1 marked this pull request as ready for review October 29, 2024 09:26
@MaggieKimani1 MaggieKimani1 changed the title Define JSON schema's Type property as a flaggable enum Define JSON schema's Type property as a flaggable enum to allow storing multiple values Oct 29, 2024
foreach (JsonSchemaType? flag in System.Enum.GetValues(typeof(JsonSchemaType)))
{
// Skip if the flag is not set or if it's the Null flag
if (schemaType.Value.HasFlag(flag) && flag != JsonSchemaType.Null)

Check warning

Code scanning / CodeQL

Dereferenced variable may be null Warning

Variable
schemaType
may be null at this access because it has a nullable type.
src/Microsoft.OpenApi/Reader/V31/OpenApiSchemaDeserializer.cs Dismissed Show dismissed Hide dismissed
Copy link

sonarcloud bot commented Oct 30, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
79.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@MaggieKimani1 MaggieKimani1 merged commit bf4a9ea into release/2.0.0 Oct 31, 2024
8 of 9 checks passed
@MaggieKimani1 MaggieKimani1 deleted the mk/define-json-schema-type-as-enum branch October 31, 2024 11:18
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.

3 participants