Skip to content

Commit ef58bf6

Browse files
Merge pull request #1822 from microsoft/vnext
Release libs
2 parents afa73a4 + 0ae4031 commit ef58bf6

File tree

7 files changed

+19
-70
lines changed

7 files changed

+19
-70
lines changed

src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj

+4-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
3434
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
3535
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
36-
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="17.11.20" />
36+
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20">
37+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
38+
<PrivateAssets>all</PrivateAssets>
39+
</PackageReference>
3740
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
3841
<PackageReference Include="Microsoft.OData.Edm" Version="8.0.1" />
3942
<PackageReference Include="Microsoft.OpenApi.OData" Version="2.0.0-preview.2" />

src/Microsoft.OpenApi.Readers/Microsoft.OpenApi.Readers.csproj

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<TargetFramework>netstandard2.0</TargetFramework>
44
<LangVersion>latest</LangVersion>
55
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
6-
<Version>1.6.20</Version>
6+
<Version>1.6.21</Version>
77
<Description>OpenAPI.NET Readers for JSON and YAML documents</Description>
88
<SignAssembly>true</SignAssembly>
99
<!-- https://github.com/dotnet/sourcelink/blob/main/docs/README.md#embeduntrackedsources -->
@@ -18,8 +18,10 @@
1818
</PropertyGroup>
1919

2020
<ItemGroup>
21-
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="17.11.20">
22-
<PrivateAssets>all</PrivateAssets>
21+
22+
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20">
23+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
24+
<PrivateAssets>all</PrivateAssets>
2325
</PackageReference>
2426

2527
<PackageReference Include="SharpYaml" Version="2.1.1" />

src/Microsoft.OpenApi.Workbench/Microsoft.OpenApi.Workbench.csproj

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
<EnableWindowsTargeting>true</EnableWindowsTargeting>
99
</PropertyGroup>
1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="17.11.20" />
11+
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20">
12+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
13+
<PrivateAssets>all</PrivateAssets>
14+
</PackageReference>
1215
<PackageReference Include="Microsoft.Windows.Compatibility" Version="8.0.8" />
1316
<!-- Microsoft.Windows.Compatibility 8.0.8 depends on 8.0.0 this dependency can be removed once they update theirs -->
1417
<PackageReference Include="System.Formats.Asn1" Version="8.0.1" />

src/Microsoft.OpenApi/Microsoft.OpenApi.csproj

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<TargetFramework>netstandard2.0</TargetFramework>
44
<LangVersion>Latest</LangVersion>
55
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
6-
<Version>1.6.20</Version>
6+
<Version>1.6.21</Version>
77
<Description>.NET models with JSON and YAML writers for OpenAPI specification</Description>
88
<SignAssembly>true</SignAssembly>
99
<!-- https://github.com/dotnet/sourcelink/blob/main/docs/README.md#embeduntrackedsources -->
@@ -37,8 +37,9 @@
3737
</ItemGroup>
3838

3939
<ItemGroup>
40-
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="17.11.20" >
41-
<PrivateAssets>all</PrivateAssets>
40+
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20">
41+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
42+
<PrivateAssets>all</PrivateAssets>
4243
</PackageReference>
4344
</ItemGroup>
4445
</Project>

src/Microsoft.OpenApi/Models/OpenApiDocument.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class OpenApiDocument : IOpenApiSerializable, IOpenApiExtensible, IOpenAp
4848
/// <summary>
4949
/// A declaration of which security mechanisms can be used across the API.
5050
/// </summary>
51-
public IList<OpenApiSecurityRequirement> SecurityRequirements { get; set; }
51+
public IList<OpenApiSecurityRequirement> SecurityRequirements { get; set; } = new List<OpenApiSecurityRequirement>();
5252

5353
/// <summary>
5454
/// A list of tags used by the specification with additional metadata.

src/Microsoft.OpenApi/Models/OpenApiOperation.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public class OpenApiOperation : IOpenApiSerializable, IOpenApiExtensible, IOpenA
9191
/// This definition overrides any declared top-level security.
9292
/// To remove a top-level security declaration, an empty array can be used.
9393
/// </summary>
94-
public IList<OpenApiSecurityRequirement> Security { get; set; }
94+
public IList<OpenApiSecurityRequirement> Security { get; set; } = new List<OpenApiSecurityRequirement>();
9595

9696
/// <summary>
9797
/// An alternative server array to service this operation.

test/Microsoft.OpenApi.Readers.Tests/V3Tests/OpenApiDocumentTests.cs

-60
Original file line numberDiff line numberDiff line change
@@ -1433,65 +1433,5 @@ public void ParseBasicDocumentWithServerVariableAndNoDefaultShouldFail()
14331433

14341434
diagnostic.Errors.Should().NotBeEmpty();
14351435
}
1436-
1437-
[Fact]
1438-
public void ParseDocumentWithMissingSecuritySchemeDefaultsToNull()
1439-
{
1440-
// Arrange
1441-
var input = @"openapi: 3.0.0
1442-
info:
1443-
title: test
1444-
version: ""1.0""
1445-
paths:
1446-
/test:
1447-
get:
1448-
description: description for test path
1449-
responses:
1450-
'200':
1451-
description: test
1452-
components:
1453-
securitySchemes:
1454-
apiKey0:
1455-
type: apiKey,
1456-
name: x-api-key,
1457-
in: header";
1458-
1459-
// Act && Assert
1460-
var doc = new OpenApiStringReader().Read(input, out var diagnostic);
1461-
1462-
doc.Paths["/test"].Operations[OperationType.Get].Security.Should().BeNull();
1463-
doc.SecurityRequirements.Should().BeNull();
1464-
}
1465-
1466-
[Fact]
1467-
public void ParseDocumentWithEmptySecuritySchemeDefaultsToEmptyList()
1468-
{
1469-
// Arrange
1470-
var input = @"openapi: 3.0.0
1471-
info:
1472-
title: test
1473-
version: ""1.0""
1474-
paths:
1475-
/test:
1476-
get:
1477-
description: description for test path
1478-
responses:
1479-
'200':
1480-
description: test
1481-
security: []
1482-
security:
1483-
- apiKey0: []
1484-
components:
1485-
securitySchemes:
1486-
apiKey0:
1487-
type: apiKey,
1488-
name: x-api-key,
1489-
in: header";
1490-
1491-
// Act && Assert
1492-
var doc = new OpenApiStringReader().Read(input, out var diagnostic);
1493-
1494-
doc.Paths["/test"].Operations[OperationType.Get].Security.Should().BeEmpty();
1495-
}
14961436
}
14971437
}

0 commit comments

Comments
 (0)