Skip to content

Commit 73aead3

Browse files
Merge pull request #1503 from microsoft/mk/fix-bugs-and-failing-tests
Fixes bugs and failing tests
2 parents 99a038c + 744d045 commit 73aead3

File tree

65 files changed

+677
-363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+677
-363
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/Formatters/PowerShellFormatter.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ static PowerShellFormatter()
4444
// 6. Add AdditionalProperties to object schemas.
4545

4646
public override void Visit(ref JsonSchema schema)
47-
{
48-
AddAdditionalPropertiesToSchema(schema);
47+
{
48+
AddAdditionalPropertiesToSchema(ref schema);
4949
schema = ResolveAnyOfSchema(ref schema);
5050
schema = ResolveOneOfSchema(ref schema);
5151

@@ -174,7 +174,7 @@ private static IList<OpenApiParameter> ResolveFunctionParameters(IList<OpenApiPa
174174
return parameters;
175175
}
176176

177-
private void AddAdditionalPropertiesToSchema(JsonSchema schema)
177+
private void AddAdditionalPropertiesToSchema(ref JsonSchema schema)
178178
{
179179
if (schema != null && !_schemaLoop.Contains(schema) && schema.GetJsonType().Equals(SchemaValueType.Object))
180180
{
@@ -200,6 +200,7 @@ private void AddAdditionalPropertiesToSchema(JsonSchema schema)
200200
_schemaLoop.Push(additionalProps);
201201
}
202202
}
203+
203204
}
204205

205206
private static JsonSchema ResolveOneOfSchema(ref JsonSchema schema)
@@ -254,6 +255,14 @@ private static JsonSchema FlattenSchema(JsonSchema schema, JsonSchema newSchema)
254255
private static JsonSchema CopySchema(JsonSchema schema, JsonSchema newSchema)
255256
{
256257
var schemaBuilder = new JsonSchemaBuilder();
258+
var keywords = schema.Keywords;
259+
if (keywords != null)
260+
{
261+
foreach (var keyword in keywords)
262+
{
263+
schemaBuilder.Add(keyword);
264+
}
265+
}
257266

258267
if (schema.GetTitle() == null && newSchema.GetTitle() is { } title)
259268
{

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: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
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 -->
@@ -21,7 +21,6 @@
2121
<PackageReference Include="JsonSchema.Net" Version="4.1.5" />
2222
<PackageReference Include="JsonSchema.Net.OpenApi" Version="1.1.0" />
2323
<PackageReference Include="SharpYaml" Version="2.1.0" />
24-
<PackageReference Include="Yaml2JsonNode" Version="1.1.1" />
2524
<PackageReference Include="System.Text.Json" Version="7.0.2" />
2625
</ItemGroup>
2726

0 commit comments

Comments
 (0)