Skip to content

Commit b3a54cb

Browse files
authored
Merge pull request #558 from microsoft/dm/updateversion
Updated version and added extenalReference support to commandline tool
2 parents ea63b8b + b9521cd commit b3a54cb

File tree

6 files changed

+16
-11
lines changed

6 files changed

+16
-11
lines changed

build.cmd

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ dotnet msbuild %PROJ% /t:restore /p:Configuration=Release
1313
dotnet msbuild %PROJ% /t:build /p:Configuration=Release
1414
dotnet msbuild %PROJ% /t:pack /p:Configuration=Release;PackageOutputPath=%~dp0artifacts
1515

16-
goto :end
17-
:error
18-
echo Version parameter missing e.g. build.cmd 1.0.0-beta0008
16+
Echo Building Microsoft.OpenApi.Tool
17+
18+
SET PROJ=%~dp0src\Microsoft.OpenApi.Tool\Microsoft.OpenApi.Tool.csproj
19+
dotnet msbuild %PROJ% /t:restore /p:Configuration=Release
20+
dotnet msbuild %PROJ% /t:build /p:Configuration=Release
21+
dotnet msbuild %PROJ% /t:pack /p:Configuration=Release;PackageOutputPath=%~dp0artifacts
1922

2023
:end

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Company>Microsoft</Company>
1111
<Title>Microsoft.OpenApi.Readers</Title>
1212
<PackageId>Microsoft.OpenApi.Readers</PackageId>
13-
<Version>1.2.3</Version>
13+
<Version>1.3.0-preview</Version>
1414
<Description>OpenAPI.NET Readers for JSON and YAML documents</Description>
1515
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
1616
<PackageTags>OpenAPI .NET</PackageTags>

src/Microsoft.OpenApi.Tool/Microsoft.OpenApi.Tool.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
<PackAsTool>true</PackAsTool>
77
<ToolCommandName>openapi</ToolCommandName>
88
<PackageOutputPath>./../../artifacts</PackageOutputPath>
9-
<Version>0.5.0</Version>
9+
<Version>1.3.0-preview</Version>
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20104.2" />
13+
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20574.7" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

src/Microsoft.OpenApi.Tool/OpenApiService.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ public static void ProcessOpenApiDocument(
1818
FileInfo output,
1919
OpenApiSpecVersion version,
2020
OpenApiFormat format,
21-
bool inline)
21+
bool inline,
22+
bool resolveExternal)
2223
{
2324
OpenApiDocument document;
2425
using (Stream stream = input.OpenRead())
2526
{
2627

2728
document = new OpenApiStreamReader(new OpenApiReaderSettings
2829
{
29-
ReferenceResolution = ReferenceResolutionSetting.ResolveLocalReferences,
30+
ReferenceResolution = resolveExternal == true ? ReferenceResolutionSetting.ResolveAllReferences : ReferenceResolutionSetting.ResolveLocalReferences,
3031
RuleSet = ValidationRuleSet.GetDefaultRuleSet()
3132
}
3233
).Read(stream, out var context);

src/Microsoft.OpenApi.Tool/Program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ static async Task<int> Main(string[] args)
1717
new Option("--output") { Argument = new Argument<FileInfo>() },
1818
new Option("--version") { Argument = new Argument<OpenApiSpecVersion>() },
1919
new Option("--format") { Argument = new Argument<OpenApiFormat>() },
20-
new Option("--inline") { Argument = new Argument<bool>() }
20+
new Option("--inline") { Argument = new Argument<bool>() },
21+
new Option("--resolveExternal") { Argument = new Argument<bool>() }
2122
};
2223

23-
command.Handler = CommandHandler.Create<FileInfo,FileInfo,OpenApiSpecVersion,OpenApiFormat,bool>(
24+
command.Handler = CommandHandler.Create<FileInfo,FileInfo,OpenApiSpecVersion,OpenApiFormat,bool, bool>(
2425
OpenApiService.ProcessOpenApiDocument);
2526

2627
// Parse the incoming args and invoke the handler

src/Microsoft.OpenApi/Microsoft.OpenApi.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<Company>Microsoft</Company>
1111
<Title>Microsoft.OpenApi</Title>
1212
<PackageId>Microsoft.OpenApi</PackageId>
13-
<Version>1.2.3</Version>
13+
<Version>1.3.0-preview</Version>
1414
<Description>.NET models with JSON and YAML writers for OpenAPI specification</Description>
1515
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
1616
<PackageTags>OpenAPI .NET</PackageTags>

0 commit comments

Comments
 (0)