Skip to content

Commit e222e36

Browse files
authored
Merge pull request #1703 from microsoft/vnext
Releases Hidi
2 parents 080095e + b3d2b32 commit e222e36

File tree

17 files changed

+83
-24
lines changed

17 files changed

+83
-24
lines changed

.github/workflows/docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ jobs:
3030
id: getversion
3131
- name: Push to GitHub Packages - Nightly
3232
if: ${{ github.ref == 'refs/heads/vnext' }}
33-
uses: docker/build-push-action@v5.4.0
33+
uses: docker/build-push-action@v6.1.0
3434
with:
3535
push: true
3636
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly
3737
- name: Push to GitHub Packages - Release
3838
if: ${{ github.ref == 'refs/heads/master' }}
39-
uses: docker/build-push-action@v5.4.0
39+
uses: docker/build-push-action@v6.1.0
4040
with:
4141
push: true
4242
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.getversion.outputs.version }}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<Nullable>enable</Nullable>
1010
<ToolCommandName>hidi</ToolCommandName>
1111
<PackageOutputPath>./../../artifacts</PackageOutputPath>
12-
<Version>1.4.5</Version>
12+
<Version>1.4.6</Version>
1313
<Description>OpenAPI.NET CLI tool for slicing OpenAPI documents</Description>
1414
<SignAssembly>true</SignAssembly>
1515
<!-- https://github.com/dotnet/sourcelink/blob/main/docs/README.md#embeduntrackedsources -->
@@ -35,7 +35,7 @@
3535
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
3636
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
3737
<PackageReference Include="Microsoft.OData.Edm" Version="7.21.3" />
38-
<PackageReference Include="Microsoft.OpenApi.OData" Version="1.6.6" />
38+
<PackageReference Include="Microsoft.OpenApi.OData" Version="1.6.7" />
3939
<PackageReference Include="Microsoft.OpenApi.ApiManifest" Version="0.5.0-preview" />
4040
<PackageReference Include="System.CommandLine.Hosting" Version="0.4.0-alpha.22272.1" />
4141
</ItemGroup>

src/Microsoft.OpenApi.Readers/V2/OpenApiV2Deserializer.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license.
33

44
using System.Collections.Generic;
@@ -113,11 +113,11 @@ public static IOpenApiAny LoadAny(ParseNode node)
113113

114114
private static IOpenApiExtension LoadExtension(string name, ParseNode node)
115115
{
116-
if (node.Context.ExtensionParsers.TryGetValue(name, out var parser))
116+
if (node.Context.ExtensionParsers.TryGetValue(name, out var parser) && parser(
117+
OpenApiAnyConverter.GetSpecificOpenApiAny(node.CreateAny()),
118+
OpenApiSpecVersion.OpenApi2_0) is { } result)
117119
{
118-
return parser(
119-
OpenApiAnyConverter.GetSpecificOpenApiAny(node.CreateAny()),
120-
OpenApiSpecVersion.OpenApi2_0);
120+
return result;
121121
}
122122
else
123123
{

src/Microsoft.OpenApi.Readers/V3/OpenApiV3Deserializer.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,11 @@ public static IOpenApiAny LoadAny(ParseNode node)
171171

172172
private static IOpenApiExtension LoadExtension(string name, ParseNode node)
173173
{
174-
if (node.Context.ExtensionParsers.TryGetValue(name, out var parser))
174+
if (node.Context.ExtensionParsers.TryGetValue(name, out var parser) && parser(
175+
OpenApiAnyConverter.GetSpecificOpenApiAny(node.CreateAny()),
176+
OpenApiSpecVersion.OpenApi3_0) is { } result)
175177
{
176-
return parser(
177-
OpenApiAnyConverter.GetSpecificOpenApiAny(node.CreateAny()),
178-
OpenApiSpecVersion.OpenApi3_0);
178+
return result;
179179
}
180180
else
181181
{

src/Microsoft.OpenApi/MicrosoftExtensions/OpenApiDeprecationExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void Write(IOpenApiWriter writer, OpenApiSpecVersion specVersion)
7878
/// <exception cref="ArgumentOutOfRangeException">When the source element is not an object</exception>
7979
public static OpenApiDeprecationExtension Parse(IOpenApiAny source)
8080
{
81-
if (source is not OpenApiObject rawObject) throw new ArgumentOutOfRangeException(nameof(source));
81+
if (source is not OpenApiObject rawObject) return null;
8282
var extension = new OpenApiDeprecationExtension();
8383
if (rawObject.TryGetValue(nameof(RemovalDate).ToFirstCharacterLowerCase(), out var removalDate) && removalDate is OpenApiDateTime removalDateValue)
8484
extension.RemovalDate = removalDateValue.Value;

src/Microsoft.OpenApi/MicrosoftExtensions/OpenApiEnumFlagsExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void Write(IOpenApiWriter writer, OpenApiSpecVersion specVersion)
4545
/// <exception cref="ArgumentOutOfRangeException">When the source element is not an object</exception>
4646
public static OpenApiEnumFlagsExtension Parse(IOpenApiAny source)
4747
{
48-
if (source is not OpenApiObject rawObject) throw new ArgumentOutOfRangeException(nameof(source));
48+
if (source is not OpenApiObject rawObject) return null;
4949
var extension = new OpenApiEnumFlagsExtension();
5050
if (rawObject.TryGetValue(nameof(IsFlags).ToFirstCharacterLowerCase(), out var flagsValue) && flagsValue is OpenApiBoolean isFlags)
5151
{

src/Microsoft.OpenApi/MicrosoftExtensions/OpenApiEnumValuesDescriptionExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void Write(IOpenApiWriter writer, OpenApiSpecVersion specVersion)
6464
/// <exception cref="ArgumentOutOfRangeException">When the source element is not an object</exception>
6565
public static OpenApiEnumValuesDescriptionExtension Parse(IOpenApiAny source)
6666
{
67-
if (source is not OpenApiObject rawObject) throw new ArgumentOutOfRangeException(nameof(source));
67+
if (source is not OpenApiObject rawObject) return null;
6868
var extension = new OpenApiEnumValuesDescriptionExtension();
6969
if (rawObject.TryGetValue("values", out var values) && values is OpenApiArray valuesArray)
7070
{

src/Microsoft.OpenApi/MicrosoftExtensions/OpenApiPagingExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void Write(IOpenApiWriter writer, OpenApiSpecVersion specVersion)
7373
/// <exception cref="ArgumentOutOfRangeException">When the source element is not an object</exception>
7474
public static OpenApiPagingExtension Parse(IOpenApiAny source)
7575
{
76-
if (source is not OpenApiObject rawObject) throw new ArgumentOutOfRangeException(nameof(source));
76+
if (source is not OpenApiObject rawObject) return null;
7777
var extension = new OpenApiPagingExtension();
7878
if (rawObject.TryGetValue(nameof(NextLinkName).ToFirstCharacterLowerCase(), out var nextLinkName) && nextLinkName is OpenApiString nextLinkNameStr)
7979
{

src/Microsoft.OpenApi/MicrosoftExtensions/OpenApiPrimaryErrorMessageExtension.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// ------------------------------------------------------------
1+
// ------------------------------------------------------------
22
// Copyright (c) Microsoft Corporation. All rights reserved.
33
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
44
// ------------------------------------------------------------
@@ -39,7 +39,7 @@ public void Write(IOpenApiWriter writer, OpenApiSpecVersion specVersion)
3939
/// <returns>The <see cref="OpenApiPrimaryErrorMessageExtension"/>.</returns>
4040
public static OpenApiPrimaryErrorMessageExtension Parse(IOpenApiAny source)
4141
{
42-
if (source is not OpenApiBoolean rawObject) throw new ArgumentOutOfRangeException(nameof(source));
42+
if (source is not OpenApiBoolean rawObject) return null;
4343
return new()
4444
{
4545
IsPrimaryErrorMessage = rawObject.Value

src/Microsoft.OpenApi/MicrosoftExtensions/OpenApiReservedParameterExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public bool? IsReserved
4141
/// <returns></returns>
4242
public static OpenApiReservedParameterExtension Parse(IOpenApiAny source)
4343
{
44-
if (source is not OpenApiBoolean rawBoolean) throw new ArgumentOutOfRangeException(nameof(source));
44+
if (source is not OpenApiBoolean rawBoolean) return null;
4545
return new()
4646
{
4747
IsReserved = rawBoolean.Value

0 commit comments

Comments
 (0)