Skip to content

Commit f9aea51

Browse files
committed
Merge remote-tracking branch 'origin/vnext' into mk/fix-bugs-and-failing-tests
2 parents 94d8c8a + ffd84ed commit f9aea51

File tree

19 files changed

+108
-110
lines changed

19 files changed

+108
-110
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ assignees: ''
1010
**Describe the bug**
1111
A clear and concise description of what the bug is.
1212

13-
**To Reproduce**
14-
Steps to reproduce the current behavior:
13+
**OpenApi File To Reproduce**
14+
Add the OpenApi file you're using or a link to it as well as the steps to reproduce the current behavior.
1515

1616
**Expected behavior**
1717
A clear and concise description of what you expected to happen.

.github/workflows/ci-cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
GITHUB_RUN_NUMBER: ${{ github.run_number }}
1515
steps:
1616
- name: Setup .NET
17-
uses: actions/setup-dotnet@v3
17+
uses: actions/setup-dotnet@v4
1818
with:
1919
dotnet-version: 7.0.x
2020

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/checkout@v4
1818

1919
- name: Setup .NET
20-
uses: actions/setup-dotnet@v3
20+
uses: actions/setup-dotnet@v4
2121
with:
2222
dotnet-version: 7.0.x
2323

.github/workflows/sonarcloud.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ jobs:
3030
runs-on: windows-latest
3131
steps:
3232
- name: Set up JDK 17
33-
uses: actions/setup-java@v3
33+
uses: actions/setup-java@v4
3434
with:
3535
distribution: 'adopt'
3636
java-version: 17
3737
- name: Setup .NET 5 # At the moment the scanner requires dotnet 5 https://www.nuget.org/packages/dotnet-sonarscanner
38-
uses: actions/setup-dotnet@v3
38+
uses: actions/setup-dotnet@v4
3939
with:
4040
dotnet-version: 5.0.x
4141
- name: Setup .NET
42-
uses: actions/setup-dotnet@v3
42+
uses: actions/setup-dotnet@v4
4343
with:
4444
dotnet-version: 7.0.x
4545
- uses: actions/checkout@v4

docs/CI-CD_DOCUMENTATION.md

Lines changed: 0 additions & 81 deletions
This file was deleted.
-38.8 KB
Binary file not shown.

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

Lines changed: 3 additions & 3 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.3.5</Version>
12+
<Version>1.3.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 -->
@@ -34,8 +34,8 @@
3434
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
3535
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
3636
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
37-
<PackageReference Include="Microsoft.OData.Edm" Version="7.18.0" />
38-
<PackageReference Include="Microsoft.OpenApi.OData" Version="1.5.0-preview9" />
37+
<PackageReference Include="Microsoft.OData.Edm" Version="7.20.0" />
38+
<PackageReference Include="Microsoft.OpenApi.OData" Version="1.5.0" />
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.Hidi/Utilities/SettingsUtilities.cs

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

4+
using System.IO;
45
using Microsoft.Extensions.Configuration;
56
using Microsoft.OpenApi.OData;
67

@@ -11,15 +12,19 @@ internal static class SettingsUtilities
1112
internal static IConfiguration GetConfiguration(string? settingsFile = null)
1213
{
1314
if (string.IsNullOrEmpty(settingsFile))
15+
{
1416
settingsFile = "appsettings.json";
17+
}
18+
19+
var settingsFilePath = Path.Combine(Directory.GetCurrentDirectory(), settingsFile);
1520

1621
IConfiguration config = new ConfigurationBuilder()
17-
.AddJsonFile(settingsFile, true)
18-
.Build();
22+
.AddJsonFile(settingsFilePath, true)
23+
.Build();
1924

2025
return config;
2126
}
22-
27+
2328
internal static OpenApiConvertSettings GetOpenApiConvertSettings(IConfiguration config, string? metadataVersion)
2429
{
2530
if (config == null) { throw new System.ArgumentNullException(nameof(config)); }

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

Lines changed: 1 addition & 1 deletion
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.10</Version>
6+
<Version>1.6.11</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 -->
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT license.
3+
4+
using System;
5+
using System.Globalization;
6+
7+
namespace Microsoft.OpenApi.Readers.ParseNodes
8+
{
9+
/// <summary>
10+
/// Useful tools to parse data
11+
/// </summary>
12+
internal class ParserHelper
13+
{
14+
/// <summary>
15+
/// Parses decimal in invariant culture.
16+
/// If the decimal is too big or small, it returns the default value
17+
///
18+
/// Note: sometimes developers put Double.MaxValue or Long.MaxValue as min/max values for numbers in json schema even if their numbers are not expected to be that big/small.
19+
/// As we have already released the library with Decimal type for Max/Min, let's not introduce the breaking change and just fallback to Decimal.Max / Min. This should satisfy almost every scenario.
20+
/// We can revisit this if somebody really needs to have double or long here.
21+
/// </summary>
22+
/// <returns></returns>
23+
public static decimal ParseDecimalWithFallbackOnOverflow(string value, decimal defaultValue)
24+
{
25+
try
26+
{
27+
return decimal.Parse(value, NumberStyles.Float, CultureInfo.InvariantCulture);
28+
}
29+
catch (OverflowException)
30+
{
31+
return defaultValue;
32+
}
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)