Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/RSuter/NSwag
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoSuter committed Dec 6, 2018
2 parents dfa5d21 + c5a1db8 commit 3cbeed0
Show file tree
Hide file tree
Showing 56 changed files with 2,883 additions and 219 deletions.
2 changes: 2 additions & 0 deletions build/01_Build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ dotnet publish "%~dp0/../src/NSwag.ConsoleCore" -c release -f "netcoreapp1.0" -o
dotnet publish "%~dp0/../src/NSwag.ConsoleCore" -c release -f "netcoreapp1.1" -o "bin/release/netcoreapp1.1/Publish" /property:Platform=AnyCPU || goto :error
dotnet publish "%~dp0/../src/NSwag.ConsoleCore" -c release -f "netcoreapp2.0" -o "bin/release/netcoreapp2.0/Publish" /property:Platform=AnyCPU || goto :error
dotnet publish "%~dp0/../src/NSwag.ConsoleCore" -c release -f "netcoreapp2.1" -o "bin/release/netcoreapp2.1/Publish" /property:Platform=AnyCPU || goto :error
dotnet publish "%~dp0/../src/NSwag.ConsoleCore" -c release -f "netcoreapp2.2" -o "bin/release/netcoreapp2.2/Publish" /property:Platform=AnyCPU || goto :error

xcopy "%~dp0/../src/NSwag.ConsoleCore/bin/release/netcoreapp1.0/publish" "%~dp0/../src/NSwag.Npm/bin/binaries/NetCore10" /E /I /y
xcopy "%~dp0/../src/NSwag.ConsoleCore/bin/release/netcoreapp1.1/publish" "%~dp0/../src/NSwag.Npm/bin/binaries/NetCore11" /E /I /y
xcopy "%~dp0/../src/NSwag.ConsoleCore/bin/release/netcoreapp2.0/publish" "%~dp0/../src/NSwag.Npm/bin/binaries/NetCore20" /E /I /y
xcopy "%~dp0/../src/NSwag.ConsoleCore/bin/release/netcoreapp2.1/publish" "%~dp0/../src/NSwag.Npm/bin/binaries/NetCore21" /E /I /y
xcopy "%~dp0/../src/NSwag.ConsoleCore/bin/release/netcoreapp2.2/publish" "%~dp0/../src/NSwag.Npm/bin/binaries/NetCore22" /E /I /y

REM Package nuspecs
"%~dp0/nuget.exe" pack "%~dp0/../src/NSwag.MSBuild/NSwag.MSBuild.nuspec" || goto :error
Expand Down
12 changes: 12 additions & 0 deletions build/03_RunIntegrationTests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ dotnet publish || goto :error
cmd /c call "..\NSwagStudio\bin\Release\nswag.cmd" run /runtime:NetCore20 || goto :error
popd

pushd "%~dp0\..\src\NSwag.Sample.NETCore21"
dotnet restore || goto :error
dotnet build /p:CopyLocalLockFileAssemblies=true || goto :error
cmd /c call "..\NSwagStudio\bin\Release\nswag.cmd" run /runtime:NetCore21 || goto :error
popd

pushd "%~dp0\..\src\NSwag.Sample.NETCore22"
dotnet restore || goto :error
dotnet build /p:CopyLocalLockFileAssemblies=true || goto :error
cmd /c call "..\NSwagStudio\bin\Release\nswag.cmd" run /runtime:NetCore22 || goto :error
popd

pushd "%~dp0\..\src\NSwag.Sample.NetGlobalAsax"
msbuild || goto :error
cmd /c call "..\NSwagStudio\bin\Release\nswag.cmd" run /runtime:Winx64 || goto :error
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"x-generator": "NSwag v12.0.3.0 (NJsonSchema v9.12.5.0 (Newtonsoft.Json v10.0.0.0))",
"x-generator": "NSwag v12.0.4.0 (NJsonSchema v9.12.7.0 (Newtonsoft.Json v10.0.0.0))",
"swagger": "2.0",
"info": {
"title": "My Title",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"x-generator": "NSwag v12.0.3.0 (NJsonSchema v9.12.5.0 (Newtonsoft.Json v11.0.0.0))",
"x-generator": "NSwag v12.0.4.0 (NJsonSchema v9.12.7.0 (Newtonsoft.Json v11.0.0.0))",
"swagger": "2.0",
"info": {
"title": "My Title",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"x-generator": "NSwag v12.0.3.0 (NJsonSchema v9.12.5.0 (Newtonsoft.Json v11.0.0.0))",
"x-generator": "NSwag v12.0.4.0 (NJsonSchema v9.12.7.0 (Newtonsoft.Json v11.0.0.0))",
"swagger": "2.0",
"info": {
"title": "My Title",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"x-generator": "NSwag v12.0.3.0 (NJsonSchema v9.12.5.0 (Newtonsoft.Json v11.0.0.0))",
"x-generator": "NSwag v12.0.4.0 (NJsonSchema v9.12.7.0 (Newtonsoft.Json v11.0.0.0))",
"swagger": "2.0",
"info": {
"title": "My Title",
Expand Down
8 changes: 7 additions & 1 deletion src/NSwag.Commands/NSwag.Commands.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1;net461</TargetFrameworks>
<TargetFrameworks>netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1;netcoreapp2.2;net461</TargetFrameworks>
<Description>NSwag: The Swagger API toolchain for .NET and TypeScript</Description>
<Version>12.0.4</Version>
<PackageTags>Swagger Documentation WebApi AspNet TypeScript CodeGen</PackageTags>
Expand Down Expand Up @@ -46,6 +46,12 @@
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.ApiExplorer" Version="2.1.3" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.2'">
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.ApiExplorer" Version="2.2.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.6" />
Expand Down
2 changes: 2 additions & 0 deletions src/NSwag.Commands/NSwagDocument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ private string GetArgumentsPrefix()
return "\"" + System.IO.Path.Combine(RootBinaryDirectory, "NetCore20/dotnet-nswag.dll") + "\" ";
else if (runtime == Runtime.NetCore21)
return "\"" + System.IO.Path.Combine(RootBinaryDirectory, "NetCore21/dotnet-nswag.dll") + "\" ";
else if (runtime == Runtime.NetCore22)
return "\"" + System.IO.Path.Combine(RootBinaryDirectory, "NetCore22/dotnet-nswag.dll") + "\" ";
else
#endif
return "";
Expand Down
3 changes: 3 additions & 0 deletions src/NSwag.Commands/Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public enum Runtime
/// <summary>.NET Core 2.1 app.</summary>
NetCore21,

/// <summary>.NET Core 2.2 app.</summary>
NetCore22,

/// <summary>Execute in the same proces.</summary>
Debug
}
Expand Down
4 changes: 3 additions & 1 deletion src/NSwag.Commands/RuntimeUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ public static Runtime CurrentRuntime
{
if (framework.Version.Major == 2 && framework.Version.Minor == 0)
return Runtime.NetCore20;
else if (framework.Version.Major >= 2)
else if (framework.Version.Major == 2 && framework.Version.Minor == 1)
return Runtime.NetCore21;
else if (framework.Version.Major >= 2)
return Runtime.NetCore22;
else if (framework.Version.Major == 1 && framework.Version.Minor == 1)
return Runtime.NetCore11;
return Runtime.NetCore10;
Expand Down
7 changes: 6 additions & 1 deletion src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1;netcoreapp2.2</TargetFrameworks>
<OutputType>Exe</OutputType>
<Description>NSwag: The Swagger API toolchain for .NET and TypeScript</Description>
<Version>12.0.4</Version>
Expand All @@ -15,6 +15,7 @@
<AssemblyName>dotnet-nswag</AssemblyName>
<PackageId>NSwag.ConsoleCore</PackageId>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\NSwag.AspNetCore.Launcher\NSwag.AspNetCore.Launcher.csproj" PrivateAssets="All" />
<ProjectReference Include="..\NSwag.Commands\NSwag.Commands.csproj" />
Expand All @@ -36,6 +37,10 @@
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.ApiExplorer" Version="2.1.3" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.2'">
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.ApiExplorer" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="NConsole" Version="3.9.6519.30868" />
Expand Down
30 changes: 15 additions & 15 deletions src/NSwag.Integration.ClientPCL/PetStoreClient.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v12.0.3.0 (NJsonSchema v9.12.5.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
// Generated using the NSwag toolchain v12.0.4.0 (NJsonSchema v9.12.7.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------

namespace PetStore
{
#pragma warning disable // Disable all warnings

[System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.3.0 (NJsonSchema v9.12.5.0 (Newtonsoft.Json v11.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.4.0 (NJsonSchema v9.12.7.0 (Newtonsoft.Json v11.0.0.0))")]
public partial interface IPetStoreClient
{
/// <summary>Update an existing pet</summary>
Expand Down Expand Up @@ -258,7 +258,7 @@ public partial interface IPetStoreClient

}

[System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.3.0 (NJsonSchema v9.12.5.0 (Newtonsoft.Json v11.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.4.0 (NJsonSchema v9.12.7.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class PetStoreClient : IPetStoreClient
{
private string _baseUrl = "https://petstore.swagger.io/v2";
Expand Down Expand Up @@ -1974,7 +1974,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu



[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.5.0 (Newtonsoft.Json v11.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.7.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class Order : System.ComponentModel.INotifyPropertyChanged
{
private long? _id;
Expand Down Expand Up @@ -2091,7 +2091,7 @@ protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.Cal

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.5.0 (Newtonsoft.Json v11.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.7.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class User : System.ComponentModel.INotifyPropertyChanged
{
private long? _id;
Expand Down Expand Up @@ -2237,7 +2237,7 @@ protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.Cal

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.5.0 (Newtonsoft.Json v11.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.7.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class Category : System.ComponentModel.INotifyPropertyChanged
{
private long? _id;
Expand Down Expand Up @@ -2292,7 +2292,7 @@ protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.Cal

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.5.0 (Newtonsoft.Json v11.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.7.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class Tag : System.ComponentModel.INotifyPropertyChanged
{
private long? _id;
Expand Down Expand Up @@ -2347,7 +2347,7 @@ protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.Cal

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.5.0 (Newtonsoft.Json v11.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.7.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class Pet : System.ComponentModel.INotifyPropertyChanged
{
private long? _id;
Expand Down Expand Up @@ -2466,7 +2466,7 @@ protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.Cal

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.5.0 (Newtonsoft.Json v11.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.7.0 (Newtonsoft.Json v11.0.0.0)")]
public partial class ApiResponse : System.ComponentModel.INotifyPropertyChanged
{
private int? _code;
Expand Down Expand Up @@ -2536,7 +2536,7 @@ protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.Cal

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.5.0 (Newtonsoft.Json v11.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.7.0 (Newtonsoft.Json v11.0.0.0)")]
public enum Anonymous
{
[System.Runtime.Serialization.EnumMember(Value = "available")]
Expand All @@ -2550,7 +2550,7 @@ public enum Anonymous

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.5.0 (Newtonsoft.Json v11.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.7.0 (Newtonsoft.Json v11.0.0.0)")]
public enum OrderStatus
{
[System.Runtime.Serialization.EnumMember(Value = "placed")]
Expand All @@ -2564,7 +2564,7 @@ public enum OrderStatus

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.5.0 (Newtonsoft.Json v11.0.0.0)")]
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.12.7.0 (Newtonsoft.Json v11.0.0.0)")]
public enum PetStatus
{
[System.Runtime.Serialization.EnumMember(Value = "available")]
Expand All @@ -2578,7 +2578,7 @@ public enum PetStatus

}

[System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.3.0 (NJsonSchema v9.12.5.0 (Newtonsoft.Json v11.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.4.0 (NJsonSchema v9.12.7.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class FileParameter
{
public FileParameter(System.IO.Stream data)
Expand All @@ -2597,7 +2597,7 @@ public FileParameter(System.IO.Stream data, string fileName)
public string FileName { get; private set; }
}

[System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.3.0 (NJsonSchema v9.12.5.0 (Newtonsoft.Json v11.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.4.0 (NJsonSchema v9.12.7.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class SwaggerException : System.Exception
{
public int StatusCode { get; private set; }
Expand All @@ -2620,7 +2620,7 @@ public override string ToString()
}
}

[System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.3.0 (NJsonSchema v9.12.5.0 (Newtonsoft.Json v11.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.4.0 (NJsonSchema v9.12.7.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class SwaggerException<TResult> : SwaggerException
{
public TResult Result { get; private set; }
Expand Down
8 changes: 4 additions & 4 deletions src/NSwag.Integration.ClientPCL/ServiceClients.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v12.0.3.0 (NJsonSchema v9.12.5.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
// Generated using the NSwag toolchain v12.0.4.0 (NJsonSchema v9.12.7.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------

Expand All @@ -10,7 +10,7 @@ namespace NSwag.Integration.ClientPCL
{
#pragma warning disable // Disable all warnings

[System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.3.0 (NJsonSchema v9.12.5.0 (Newtonsoft.Json v11.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.4.0 (NJsonSchema v9.12.7.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class GeoClient : ClientBase
{
private string _baseUrl = "http://localhost:13452";
Expand Down Expand Up @@ -889,7 +889,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu
}
}

[System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.3.0 (NJsonSchema v9.12.5.0 (Newtonsoft.Json v11.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.4.0 (NJsonSchema v9.12.7.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class PersonsClient : ClientBase
{
private string _baseUrl = "http://localhost:13452";
Expand Down Expand Up @@ -1859,7 +1859,7 @@ private string ConvertToString(object value, System.Globalization.CultureInfo cu



[System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.3.0 (NJsonSchema v9.12.5.0 (Newtonsoft.Json v11.0.0.0))")]
[System.CodeDom.Compiler.GeneratedCode("NSwag", "12.0.4.0 (NJsonSchema v9.12.7.0 (Newtonsoft.Json v11.0.0.0))")]
internal class JsonExceptionConverter : Newtonsoft.Json.JsonConverter
{
private readonly Newtonsoft.Json.Serialization.DefaultContractResolver _defaultContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver();
Expand Down
Loading

0 comments on commit 3cbeed0

Please sign in to comment.