Skip to content

chore(deps): bump Microsoft.OpenApi from 2.0.0-preview8 to 2.0.0-preview9 #663

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

Merged
merged 2 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public static IOpenApiSchema CreateSchema(this ODataContext context, IEdmPrimiti

// Nullable properties are marked with the keyword nullable and a value of true.
// nullable cannot be true when type is empty, often common in anyof/allOf since individual entries are nullable
if (!string.IsNullOrEmpty(schema.Type.ToIdentifier()) && primitiveType.IsNullable)
if (schema.Type.ToIdentifiers() is { Length: > 0 } && primitiveType.IsNullable)
{
openApiSchema.Type |= JsonSchemaType.Null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@
}
else
{
return schema.Type.ToIdentifier() ??
return (schema.Type & ~JsonSchemaType.Null)?.ToIdentifiers()[0] ??
(schema.AnyOf ?? Enumerable.Empty<IOpenApiSchema>())
.Union(schema.AllOf ?? Enumerable.Empty<IOpenApiSchema>())
.Union(schema.OneOf ?? Enumerable.Empty<IOpenApiSchema>())
Expand Down Expand Up @@ -746,7 +746,7 @@
// The type 'System.Double' is not supported in Open API document.
case EdmPrimitiveTypeKind.Double:
/*
{

Check warning on line 749 in src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiSchemaGenerator.cs

View workflow job for this annotation

GitHub Actions / Build

Remove this commented out code. (https://rules.sonarsource.com/csharp/RSPEC-125)
double result;
if (Double.TryParse(property.DefaultValueString, out result))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.OData.Edm" Version="8.2.3" />
<PackageReference Include="Microsoft.OpenApi" Version="2.0.0-preview8" />
<PackageReference Include="Microsoft.OpenApi" Version="2.0.0-preview9" />
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.13.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
4 changes: 2 additions & 2 deletions src/OoasGui/OoasGui.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
Expand All @@ -17,7 +17,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.OData.Edm" Version="8.2.3" />
<PackageReference Include="Microsoft.OpenApi" Version="2.0.0-preview8" />
<PackageReference Include="Microsoft.OpenApi" Version="2.0.0-preview9" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ public async Task CreateComplexTypeWithBaseSchemaReturnCorrectSchema()

// Assert
Assert.NotNull(schema);
Assert.True(String.IsNullOrEmpty(schema.Type.ToIdentifier()));
Assert.Null(schema.Type.ToIdentifiers());

Assert.NotNull(schema.AllOf);
Assert.Null(schema.AnyOf);
Expand Down Expand Up @@ -660,7 +660,7 @@ public async Task CreateEntityTypeWithBaseSchemaReturnCorrectSchema()

// Assert
Assert.NotNull(schema);
Assert.True(String.IsNullOrEmpty(schema.Type.ToIdentifier()));
Assert.Null(schema.Type.ToIdentifiers());

Assert.NotNull(schema.AllOf);
Assert.Null(schema.AnyOf);
Expand Down Expand Up @@ -735,7 +735,7 @@ public void CreateEntityTypeWithCrossReferenceBaseSchemaReturnCorrectSchema()

// Assert
Assert.NotNull(schema);
Assert.True(string.IsNullOrEmpty(schema.Type.ToIdentifier()));
Assert.Null(schema.Type.ToIdentifiers());

Assert.NotNull(schema.AllOf);
Assert.Null(schema.AnyOf);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.OpenApi" Version="2.0.0-preview8" />
<PackageReference Include="Microsoft.OpenApi" Version="2.0.0-preview9" />
<PackageReference Include="moq" Version="4.20.72" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="xunit" Version="2.9.3" />
Expand Down
2 changes: 1 addition & 1 deletion tool/UpdateDocs/UpdateDocs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.OData.Edm" Version="8.2.3" />
<PackageReference Include="Microsoft.OpenApi" Version="2.0.0-preview8" />
<PackageReference Include="Microsoft.OpenApi" Version="2.0.0-preview9" />
</ItemGroup>
</Project>
Loading