Skip to content

Commit 652408b

Browse files
committed
Merged with vnext
2 parents f1b3f3b + 2e3055e commit 652408b

File tree

8 files changed

+21
-12
lines changed

8 files changed

+21
-12
lines changed

.github/workflows/ci-cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
4242
- name: Checkout repository
4343
id: checkout_repo
44-
uses: actions/checkout@v2
44+
uses: actions/checkout@v3
4545
with:
4646
token: ${{ secrets.GITHUB_TOKEN }}
4747
fetch-depth: 0

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- name: Checkout repository
1616
id: checkout_repo
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v3
1818

1919
- name: Setup .NET
2020
uses: actions/setup-dotnet@v2

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
<ItemGroup>
3535
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
36-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
36+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.1" />
3737
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
3838
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
3939
<PackageReference Include="System.CommandLine" Version="2.0.0-beta3.22114.1" />

src/Microsoft.OpenApi.Hidi/OpenApiService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public static async Task<int> TransformOpenApiDocument(
3636
string openapi,
3737
string csdl,
3838
FileInfo output,
39+
bool cleanoutput,
3940
string? version,
4041
OpenApiFormat? format,
4142
LogLevel loglevel,
@@ -59,6 +60,10 @@ CancellationToken cancellationToken
5960
{
6061
throw new ArgumentNullException(nameof(output));
6162
}
63+
if (cleanoutput && output.Exists)
64+
{
65+
output.Delete();
66+
}
6267
if (output.Exists)
6368
{
6469
throw new IOException($"The file {output} already exists. Please input a new file path.");

src/Microsoft.OpenApi.Hidi/Program.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ static async Task Main(string[] args)
2727
var outputOption = new Option<FileInfo>("--output", () => new FileInfo("./output"), "The output directory path for the generated file.") { Arity = ArgumentArity.ZeroOrOne };
2828
outputOption.AddAlias("-o");
2929

30+
var cleanOutputOption = new Option<bool>("--clean-output", "Overwrite an existing file");
31+
cleanOutputOption.AddAlias("-co");
32+
3033
var versionOption = new Option<string?>("--version", "OpenAPI specification version");
3134
versionOption.AddAlias("-v");
3235

@@ -64,6 +67,7 @@ static async Task Main(string[] args)
6467
descriptionOption,
6568
csdlOption,
6669
outputOption,
70+
cleanOutputOption,
6771
versionOption,
6872
formatOption,
6973
logLevelOption,
@@ -74,7 +78,7 @@ static async Task Main(string[] args)
7478
resolveExternalOption,
7579
};
7680

77-
transformCommand.SetHandler<string, string, FileInfo, string?, OpenApiFormat?, LogLevel, bool, bool, string, string, string, CancellationToken> (
81+
transformCommand.SetHandler<string, string, FileInfo, bool, string?, OpenApiFormat?, LogLevel, bool, bool, string, string, string, CancellationToken> (
7882
OpenApiService.TransformOpenApiDocument, descriptionOption, csdlOption, outputOption, versionOption, formatOption, logLevelOption, inlineOption, resolveExternalOption, filterByOperationIdsOption, filterByTagsOption, filterByCollectionOption);
7983

8084
rootCommand.Add(transformCommand);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</ItemGroup>
4141

4242
<ItemGroup>
43-
<PackageReference Include="SharpYaml" Version="1.8.0" />
43+
<PackageReference Include="SharpYaml" Version="1.9.0" />
4444
</ItemGroup>
4545

4646
<ItemGroup>
@@ -66,4 +66,4 @@
6666
<LastGenOutput>SRResource.Designer.cs</LastGenOutput>
6767
</EmbeddedResource>
6868
</ItemGroup>
69-
</Project>
69+
</Project>

test/Microsoft.OpenApi.Readers.Tests/Microsoft.OpenApi.Readers.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@
247247
</PackageReference>
248248
<PackageReference Include="Newtonsoft.Json" Version="13.0.1">
249249
</PackageReference>
250-
<PackageReference Include="SharpYaml" Version="1.8.0">
250+
<PackageReference Include="SharpYaml" Version="1.9.0">
251251
</PackageReference>
252252
<PackageReference Include="xunit" Version="2.4.1">
253253
</PackageReference>

test/Microsoft.OpenApi.Tests/Microsoft.OpenApi.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<ItemGroup>
1818
<PackageReference Include="FluentAssertions" Version="6.5.1" />
1919
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
20-
<PackageReference Include="Moq" Version="4.17.1" />
20+
<PackageReference Include="Moq" Version="4.17.2" />
2121
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
22-
<PackageReference Include="SharpYaml" Version="1.8.0" />
23-
<PackageReference Include="Verify" Version="16.3.2" />
24-
<PackageReference Include="Verify.Xunit" Version="16.3.2" />
22+
<PackageReference Include="SharpYaml" Version="1.9.0" />
23+
<PackageReference Include="Verify" Version="16.3.5" />
24+
<PackageReference Include="Verify.Xunit" Version="16.3.5" />
2525
<PackageReference Include="xunit" Version="2.4.1" />
2626
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
2727
<PrivateAssets>all</PrivateAssets>
@@ -30,7 +30,7 @@
3030
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
3131
<PackageReference Include="PublicApiGenerator" Version="10.3.0" />
3232
</ItemGroup>
33-
33+
3434
<ItemGroup>
3535
<ProjectReference Include="..\..\src\Microsoft.OpenApi.Hidi\Microsoft.OpenApi.Hidi.csproj" />
3636
<ProjectReference Include="..\..\src\Microsoft.OpenApi\Microsoft.OpenApi.csproj" />

0 commit comments

Comments
 (0)