diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 40647ecefe..4d49e1d5b2 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -25,6 +25,10 @@ on: - '**/*.*' - '!**/*.md' +concurrency: + group: ${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: windows-latest: name: windows-latest diff --git a/.gitignore b/.gitignore index fe508bd541..ae82a3cb09 100644 --- a/.gitignore +++ b/.gitignore @@ -82,3 +82,4 @@ _ReSharper.Caches/ /artifacts *.binlog +*.gen diff --git a/Directory.Build.props b/Directory.Build.props index 05b87f8df4..b457b2f3e5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 14.1.0 + 14.2.0 Rico Suter Copyright © Rico Suter, 2023 diff --git a/build/Build.CI.GitHubActions.cs b/build/Build.CI.GitHubActions.cs index e1e980906c..aa87ae10d8 100644 --- a/build/Build.CI.GitHubActions.cs +++ b/build/Build.CI.GitHubActions.cs @@ -16,7 +16,7 @@ PublishArtifacts = true, InvokedTargets = [nameof(Compile), nameof(Test), nameof(Pack)], CacheKeyFiles = [], - ConcurrencyCancelInProgress = false), + ConcurrencyCancelInProgress = true), ] [CustomGitHubActions( "build", diff --git a/build/Build.cs b/build/Build.cs index 3b34e02e84..337583af7a 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -269,7 +269,7 @@ void PublishConsoleProject(Project project, string[] targetFrameworks) PublishConsoleProject(consoleX86Project, ["net462"]); PublishConsoleProject(consoleProject, ["net462"]); } - PublishConsoleProject(consoleCoreProject, ["net6.0", "net8.0"]); + PublishConsoleProject(consoleCoreProject, ["net8.0", "net9.0"]); void CopyConsoleBinaries(AbsolutePath target) { @@ -285,8 +285,8 @@ void CopyConsoleBinaries(AbsolutePath target) (ArtifactsDirectory / "publish" / consoleProject.Name / configuration).Copy(target / "Win", ExistsPolicy.DirectoryMerge); } - (ArtifactsDirectory / "publish" / consoleCoreProject.Name / (configuration + "_net6.0")).Copy(target / "Net60"); (ArtifactsDirectory / "publish" / consoleCoreProject.Name / (configuration + "_net8.0")).Copy(target / "Net80"); + (ArtifactsDirectory / "publish" / consoleCoreProject.Name / (configuration + "_net9.0")).Copy(target / "Net90"); } if (IsRunningOnWindows) diff --git a/build/_build.csproj b/build/_build.csproj index 8762b669da..09e0acf10b 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -17,6 +17,7 @@ + diff --git a/global.json b/global.json index 989a69cafb..f15a959283 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "9.0.100", "rollForward": "latestMinor" } } \ No newline at end of file diff --git a/src/NSwag.ApiDescription.Client/NSwag.ApiDescription.Client.targets b/src/NSwag.ApiDescription.Client/NSwag.ApiDescription.Client.targets index 662b846518..46996343e5 100644 --- a/src/NSwag.ApiDescription.Client/NSwag.ApiDescription.Client.targets +++ b/src/NSwag.ApiDescription.Client/NSwag.ApiDescription.Client.targets @@ -3,9 +3,11 @@ <_NSwagCommand>$(NSwagExe) <_NSwagCommand - Condition="'$(MSBuildRuntimeType)' == 'Core'">dotnet --roll-forward-on-no-candidate-fx 2 "$(NSwagDir_Net60)/dotnet-nswag.dll" + Condition="'$(MSBuildRuntimeType)' == 'Core'">dotnet --roll-forward-on-no-candidate-fx 2 "$(NSwagDir_Net80)/dotnet-nswag.dll" <_NSwagCommand Condition="'$(TargetFramework)' == 'net8.0'">dotnet --roll-forward-on-no-candidate-fx 2 "$(NSwagDir_Net80)/dotnet-nswag.dll" + <_NSwagCommand + Condition="'$(TargetFramework)' == 'net9.0'">dotnet --roll-forward-on-no-candidate-fx 2 "$(NSwagDir_Net90)/dotnet-nswag.dll" diff --git a/src/NSwag.AspNetCore.Launcher/NSwag.AspNetCore.Launcher.csproj b/src/NSwag.AspNetCore.Launcher/NSwag.AspNetCore.Launcher.csproj index e0cf5ce4e2..d44def6312 100644 --- a/src/NSwag.AspNetCore.Launcher/NSwag.AspNetCore.Launcher.csproj +++ b/src/NSwag.AspNetCore.Launcher/NSwag.AspNetCore.Launcher.csproj @@ -1,12 +1,12 @@  - net6.0;net462 + net8.0;net462 x64 Exe false - + \ No newline at end of file diff --git a/src/NSwag.AspNetCore/NSwag.AspNetCore.csproj b/src/NSwag.AspNetCore/NSwag.AspNetCore.csproj index b89c21a616..e8bab7f7d2 100644 --- a/src/NSwag.AspNetCore/NSwag.AspNetCore.csproj +++ b/src/NSwag.AspNetCore/NSwag.AspNetCore.csproj @@ -1,6 +1,6 @@  - net462;netstandard2.0;net6.0;net8.0 + net462;netstandard2.0;net8.0;net9.0 Swagger Documentation AspNetCore NetCore TypeScript CodeGen $(MSBuildProjectName).nuspec symbols.nupkg @@ -14,12 +14,8 @@ 1.0.4 6.0.3 1.0.1 - 3.1.0 - 5.0.0 - 6.0.0 - 7.0.0 8.0.0 - 1.6.1 + 9.0.0 4.3.0 4.0.1 @@ -42,16 +38,16 @@ - - - - - + + + + + @@ -72,12 +68,8 @@ microsoftAspNetCoreStaticFilesPackageVersion=$(MicrosoftAspNetCoreStaticFilesPackageVersion); microsoftExtensionsApiDescriptionServerPackageVersion=$(MicrosoftExtensionsApiDescriptionServerPackageVersion); microsoftExtensionsFileProvidersEmbeddedPackageVersion=$(MicrosoftExtensionsFileProvidersEmbeddedPackageVersion); - microsoftExtensionsFileProvidersEmbeddedPackageVersionCore31=$(MicrosoftExtensionsFileProvidersEmbeddedPackageVersionCore31); - microsoftExtensionsFileProvidersEmbeddedPackageVersionNet5=$(MicrosoftExtensionsFileProvidersEmbeddedPackageVersionNet5); - microsoftExtensionsFileProvidersEmbeddedPackageVersionNet6=$(MicrosoftExtensionsFileProvidersEmbeddedPackageVersionNet6); - microsoftExtensionsFileProvidersEmbeddedPackageVersionNet7=$(MicrosoftExtensionsFileProvidersEmbeddedPackageVersionNet7); microsoftExtensionsFileProvidersEmbeddedPackageVersionNet8=$(MicrosoftExtensionsFileProvidersEmbeddedPackageVersionNet8); - netStandardLibraryPackageVersion=$(NETStandardLibraryPackageVersion); + microsoftExtensionsFileProvidersEmbeddedPackageVersionNet9=$(MicrosoftExtensionsFileProvidersEmbeddedPackageVersionNet9); systemIOFileSystemPackageVersion=$(SystemIOFileSystemPackageVersion); systemXmlXPathXDocumentPackageVersion=$(SystemXmlXPathXDocumentPackageVersion); diff --git a/src/NSwag.AspNetCore/NSwag.AspNetCore.nuspec b/src/NSwag.AspNetCore/NSwag.AspNetCore.nuspec index e43c66929c..da5b8d625f 100644 --- a/src/NSwag.AspNetCore/NSwag.AspNetCore.nuspec +++ b/src/NSwag.AspNetCore/NSwag.AspNetCore.nuspec @@ -37,23 +37,23 @@ - + - + - + - + @@ -65,9 +65,9 @@ - - + + diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/NSwag.CodeGeneration.CSharp.Tests.csproj b/src/NSwag.CodeGeneration.CSharp.Tests/NSwag.CodeGeneration.CSharp.Tests.csproj index 4dd19e2b08..82ba11adcc 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/NSwag.CodeGeneration.CSharp.Tests.csproj +++ b/src/NSwag.CodeGeneration.CSharp.Tests/NSwag.CodeGeneration.CSharp.Tests.csproj @@ -7,8 +7,11 @@ - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/NSwag.CodeGeneration.Tests/NSwag.CodeGeneration.Tests.csproj b/src/NSwag.CodeGeneration.Tests/NSwag.CodeGeneration.Tests.csproj index 18ea1e01e1..d871b04c72 100644 --- a/src/NSwag.CodeGeneration.Tests/NSwag.CodeGeneration.Tests.csproj +++ b/src/NSwag.CodeGeneration.Tests/NSwag.CodeGeneration.Tests.csproj @@ -6,9 +6,12 @@ - - - + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/NSwag.CodeGeneration.TypeScript.Tests/NSwag.CodeGeneration.TypeScript.Tests.csproj b/src/NSwag.CodeGeneration.TypeScript.Tests/NSwag.CodeGeneration.TypeScript.Tests.csproj index 09b63ca692..51bf7cb27f 100644 --- a/src/NSwag.CodeGeneration.TypeScript.Tests/NSwag.CodeGeneration.TypeScript.Tests.csproj +++ b/src/NSwag.CodeGeneration.TypeScript.Tests/NSwag.CodeGeneration.TypeScript.Tests.csproj @@ -7,8 +7,11 @@ - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/NSwag.Commands/NSwag.Commands.csproj b/src/NSwag.Commands/NSwag.Commands.csproj index e078f8778f..ac9c285766 100644 --- a/src/NSwag.Commands/NSwag.Commands.csproj +++ b/src/NSwag.Commands/NSwag.Commands.csproj @@ -1,7 +1,7 @@  - net462;net6.0;net8.0 + net462;net8.0;net9.0 true $(NoWarn),618,1591 @@ -11,18 +11,18 @@ - - - - - - + + + + + + @@ -34,7 +34,7 @@ - + diff --git a/src/NSwag.Commands/NSwagDocument.cs b/src/NSwag.Commands/NSwagDocument.cs index 7bd11df052..43696e3293 100644 --- a/src/NSwag.Commands/NSwagDocument.cs +++ b/src/NSwag.Commands/NSwagDocument.cs @@ -239,13 +239,13 @@ private string GetArgumentsPrefix() #if NET462 var runtime = Runtime != Runtime.Default ? Runtime : RuntimeUtilities.CurrentRuntime; - if (runtime == Runtime.Net60) + if (runtime == Runtime.Net80) { - return "\"" + System.IO.Path.Combine(RootBinaryDirectory, "Net60/dotnet-nswag.dll") + "\" "; + return "\"" + System.IO.Path.Combine(RootBinaryDirectory, "Net80/dotnet-nswag.dll") + "\" "; } - else if (runtime == Runtime.Net80) + if (runtime == Runtime.Net90) { - return "\"" + System.IO.Path.Combine(RootBinaryDirectory, "Net80/dotnet-nswag.dll") + "\" "; + return "\"" + System.IO.Path.Combine(RootBinaryDirectory, "Net90/dotnet-nswag.dll") + "\" "; } else #endif diff --git a/src/NSwag.Commands/NSwagDocumentBase.cs b/src/NSwag.Commands/NSwagDocumentBase.cs index 8cd1598142..b16eb66423 100644 --- a/src/NSwag.Commands/NSwagDocumentBase.cs +++ b/src/NSwag.Commands/NSwagDocumentBase.cs @@ -57,7 +57,7 @@ protected NSwagDocumentBase() public abstract Task ExecuteAsync(); /// Gets or sets the runtime where the document should be processed. - public Runtime Runtime { get; set; } = Runtime.Net60; + public Runtime Runtime { get; set; } = Runtime.Net80; /// Gets or sets the default variables. public string DefaultVariables { get; set; } diff --git a/src/NSwag.Commands/Runtime.cs b/src/NSwag.Commands/Runtime.cs index 4e4a1f11ea..a700040dec 100644 --- a/src/NSwag.Commands/Runtime.cs +++ b/src/NSwag.Commands/Runtime.cs @@ -20,12 +20,12 @@ public enum Runtime /// Full .NET framework, x86. WinX86, - /// .NET 6 app. - Net60, - /// .NET 8 app. Net80, + /// .NET 9 app. + Net90, + /// Execute in the same process. Debug } diff --git a/src/NSwag.Commands/RuntimeUtilities.cs b/src/NSwag.Commands/RuntimeUtilities.cs index 92cbea8ecf..f97ff58144 100644 --- a/src/NSwag.Commands/RuntimeUtilities.cs +++ b/src/NSwag.Commands/RuntimeUtilities.cs @@ -27,17 +27,12 @@ public static Runtime CurrentRuntime var framework = PlatformServices.Default.Application.RuntimeFramework; if (framework.Identifier == ".NETCoreApp") { - if (framework.Version.Major >= 8) + if (framework.Version.Major >= 9) { - return Runtime.Net80; + return Runtime.Net90; } - if (framework.Version.Major >= 6) - { - return Runtime.Net60; - } - - return Runtime.Net60; + return Runtime.Net80; } return IntPtr.Size == 4 ? Runtime.WinX86 : Runtime.WinX64; #endif diff --git a/src/NSwag.Sample.NET80Minimal/GeneratedClientsCs.gen b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpClientsAsync_projectName=NSwag.Sample.NET90Minimal_targetFramework=net9.0_generatesCode=True.verified.txt similarity index 99% rename from src/NSwag.Sample.NET80Minimal/GeneratedClientsCs.gen rename to src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpClientsAsync_projectName=NSwag.Sample.NET90Minimal_targetFramework=net9.0_generatesCode=True.verified.txt index 0a5d58ade6..8dd9c74dd8 100644 --- a/src/NSwag.Sample.NET80Minimal/GeneratedClientsCs.gen +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpClientsAsync_projectName=NSwag.Sample.NET90Minimal_targetFramework=net9.0_generatesCode=True.verified.txt @@ -1,4 +1,4 @@ -//---------------------- +//---------------------- // // Generated using the NSwag toolchain v (http://NSwag.org) // diff --git a/src/NSwag.Sample.NET80Minimal/GeneratedControllersCs.gen b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET90Minimal_targetFramework=net9.0_generatesCode=True.verified.txt similarity index 99% rename from src/NSwag.Sample.NET80Minimal/GeneratedControllersCs.gen rename to src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET90Minimal_targetFramework=net9.0_generatesCode=True.verified.txt index 53d1086332..048437a5d1 100644 --- a/src/NSwag.Sample.NET80Minimal/GeneratedControllersCs.gen +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckCSharpControllersAsync_projectName=NSwag.Sample.NET90Minimal_targetFramework=net9.0_generatesCode=True.verified.txt @@ -1,4 +1,4 @@ -//---------------------- +//---------------------- // // Generated using the NSwag toolchain v (http://NSwag.org) // diff --git a/src/NSwag.Sample.NET80Minimal/GeneratedClientsTs.gen b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckTypeScriptAsync_projectName=NSwag.Sample.NET90Minimal_targetFramework=net9.0_generatesCode=True.verified.txt similarity index 99% rename from src/NSwag.Sample.NET80Minimal/GeneratedClientsTs.gen rename to src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckTypeScriptAsync_projectName=NSwag.Sample.NET90Minimal_targetFramework=net9.0_generatesCode=True.verified.txt index 21ee891e02..dc6afc7fef 100644 --- a/src/NSwag.Sample.NET80Minimal/GeneratedClientsTs.gen +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.CheckTypeScriptAsync_projectName=NSwag.Sample.NET90Minimal_targetFramework=net9.0_generatesCode=True.verified.txt @@ -1,4 +1,4 @@ -//---------------------- +//---------------------- // // Generated using the NSwag toolchain v (http://NSwag.org) // diff --git a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET90Minimal_targetFramework=net9.0_generatesCode=True.verified.txt b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET90Minimal_targetFramework=net9.0_generatesCode=True.verified.txt new file mode 100644 index 0000000000..313ca86c6c --- /dev/null +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET90Minimal_targetFramework=net9.0_generatesCode=True.verified.txt @@ -0,0 +1,161 @@ +{ + "x-generator": "NSwag", + "openapi": "3.0.0", + "info": { + "title": "Minimal API", + "version": "v1" + }, + "paths": { + "/": { + "get": { + "tags": [ + "General" + ], + "operationId": "Get", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/sum/{a}/{b}": { + "get": { + "tags": [ + "Calculator" + ], + "operationId": "CalculateSum", + "parameters": [ + { + "name": "a", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + }, + "x-position": 1 + }, + { + "name": "b", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + }, + "x-position": 2 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "integer", + "format": "int32" + } + } + } + } + } + } + }, + "/abs({a})": { + "get": { + "tags": [ + "Calculator" + ], + "operationId": "AbsoluteValue", + "parameters": [ + { + "name": "a", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + }, + "x-position": 1 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "integer", + "format": "int32" + } + } + } + } + } + } + }, + "/id:{id}": { + "get": { + "tags": [ + "Calculator" + ], + "operationId": "Identity", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + }, + "x-position": 1 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "integer", + "format": "int32" + } + } + } + } + } + } + }, + "/examples": { + "get": { + "tags": [ + "Example" + ], + "operationId": "Example_Get", + "responses": { + "200": { + "description": "", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + } + }, + "components": {} +} \ No newline at end of file diff --git a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET90_targetFramework=net9.0_generatesCode=False.verified.txt b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET90_targetFramework=net9.0_generatesCode=False.verified.txt new file mode 100644 index 0000000000..8f3057def2 --- /dev/null +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET90_targetFramework=net9.0_generatesCode=False.verified.txt @@ -0,0 +1,247 @@ +{ + "x-generator": "NSwag", + "openapi": "3.0.0", + "info": { + "title": "My Title", + "description": "Hello world!", + "version": "1.0.0" + }, + "paths": { + "/api/Values": { + "get": { + "tags": [ + "Values" + ], + "operationId": "Values_GetAll", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Values" + ], + "operationId": "Values_Post", + "requestBody": { + "x-name": "value", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true, + "x-position": 1 + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/Values/{id}": { + "get": { + "tags": [ + "Values" + ], + "operationId": "Values_Get", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + }, + "x-position": 1 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestEnum" + } + } + } + } + } + }, + "put": { + "tags": [ + "Values" + ], + "operationId": "Values_Put", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + }, + "x-position": 1 + } + ], + "requestBody": { + "x-name": "value", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": true, + "x-position": 2 + }, + "responses": { + "200": { + "description": "" + } + } + }, + "delete": { + "tags": [ + "Values" + ], + "operationId": "Values_Delete", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + }, + "x-position": 1 + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/Values/ToString({id})": { + "get": { + "tags": [ + "Values" + ], + "operationId": "Values_GetToString", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + }, + "x-position": 1 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/Values/{id}/foo": { + "get": { + "tags": [ + "Values" + ], + "operationId": "Values_GetFooBar", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int32" + }, + "x-position": 1 + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "Person": { + "type": "object", + "additionalProperties": false, + "properties": { + "firstName": { + "type": "string" + }, + "middleName": { + "type": "string", + "nullable": true + }, + "lastName": { + "type": "string" + }, + "dayOfBirth": { + "type": "string", + "format": "date-time" + } + } + }, + "TestEnum": { + "type": "string", + "description": "", + "x-enumNames": [ + "Foo", + "Bar" + ], + "enum": [ + "Foo", + "Bar" + ] + } + } + } +} \ No newline at end of file diff --git a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.cs b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.cs index 41ca3a3d5f..460acad83c 100644 --- a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.cs +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.cs @@ -6,14 +6,13 @@ namespace NSwag.ConsoleCore.Tests { - [UsesVerify] public class GenerateSampleSpecificationTests { [Theory] - [InlineData("NSwag.Sample.NET60", "net6.0", false)] - [InlineData("NSwag.Sample.NET60Minimal", "net6.0", false)] [InlineData("NSwag.Sample.NET80", "net8.0", false)] [InlineData("NSwag.Sample.NET80Minimal", "net8.0", true)] + [InlineData("NSwag.Sample.NET90", "net9.0", false)] + [InlineData("NSwag.Sample.NET90Minimal", "net9.0", true)] public async Task Should_generate_openapi_for_project(string projectName, string targetFramework, bool generatesCode) { // Arrange diff --git a/src/NSwag.ConsoleCore.Tests/NSwag.ConsoleCore.Tests.csproj b/src/NSwag.ConsoleCore.Tests/NSwag.ConsoleCore.Tests.csproj index 3ec0a8d543..37ba60eeac 100644 --- a/src/NSwag.ConsoleCore.Tests/NSwag.ConsoleCore.Tests.csproj +++ b/src/NSwag.ConsoleCore.Tests/NSwag.ConsoleCore.Tests.csproj @@ -1,20 +1,23 @@  - net8.0 + net9.0 - - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + - + diff --git a/src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj b/src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj index 2b08cb1eab..2988ad1055 100644 --- a/src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj +++ b/src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj @@ -1,6 +1,6 @@  - net6.0;net8.0 + net8.0;net9.0 Exe dotnet-nswag NSwag.ConsoleCore @@ -13,16 +13,16 @@ - - - - - + + + + + diff --git a/src/NSwag.Core.Tests/NSwag.Core.Tests.csproj b/src/NSwag.Core.Tests/NSwag.Core.Tests.csproj index b824a5dceb..43e8d8f8f3 100644 --- a/src/NSwag.Core.Tests/NSwag.Core.Tests.csproj +++ b/src/NSwag.Core.Tests/NSwag.Core.Tests.csproj @@ -10,8 +10,11 @@ - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/NSwag.Core.Yaml.Tests/NSwag.Core.Yaml.Tests.csproj b/src/NSwag.Core.Yaml.Tests/NSwag.Core.Yaml.Tests.csproj index cb5ed03331..b824683868 100644 --- a/src/NSwag.Core.Yaml.Tests/NSwag.Core.Yaml.Tests.csproj +++ b/src/NSwag.Core.Yaml.Tests/NSwag.Core.Yaml.Tests.csproj @@ -8,8 +8,11 @@ - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/NSwag.Generation.AspNetCore.Tests.Web/NSwag.Generation.AspNetCore.Tests.Web.csproj b/src/NSwag.Generation.AspNetCore.Tests.Web/NSwag.Generation.AspNetCore.Tests.Web.csproj index d0e8b4d6bf..65067107fc 100644 --- a/src/NSwag.Generation.AspNetCore.Tests.Web/NSwag.Generation.AspNetCore.Tests.Web.csproj +++ b/src/NSwag.Generation.AspNetCore.Tests.Web/NSwag.Generation.AspNetCore.Tests.Web.csproj @@ -1,7 +1,7 @@  - net6.0;net8.0 + net8.0;net9.0 true $(NoWarn),618,1591 enable diff --git a/src/NSwag.Generation.AspNetCore.Tests/NSwag.Generation.AspNetCore.Tests.csproj b/src/NSwag.Generation.AspNetCore.Tests/NSwag.Generation.AspNetCore.Tests.csproj index 4e5ef16a97..7ae1dd8cd9 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/NSwag.Generation.AspNetCore.Tests.csproj +++ b/src/NSwag.Generation.AspNetCore.Tests/NSwag.Generation.AspNetCore.Tests.csproj @@ -1,6 +1,6 @@  - net6.0;net8.0 + net8.0;net9.0 $(NoWarn),618,1591 true @@ -9,12 +9,11 @@ - - - - - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + @@ -22,6 +21,11 @@ + + + + + diff --git a/src/NSwag.Generation.AspNetCore/NSwag.Generation.AspNetCore.csproj b/src/NSwag.Generation.AspNetCore/NSwag.Generation.AspNetCore.csproj index bceac8d52c..93c97ac420 100644 --- a/src/NSwag.Generation.AspNetCore/NSwag.Generation.AspNetCore.csproj +++ b/src/NSwag.Generation.AspNetCore/NSwag.Generation.AspNetCore.csproj @@ -1,6 +1,6 @@ - net462;netstandard2.0;net6.0;net8.0 + net462;netstandard2.0;net8.0;net9.0 Swagger Documentation AspNetCore $(DefineConstants);ASPNETCORE true @@ -12,18 +12,18 @@ - - - - - - + + + + + + diff --git a/src/NSwag.Generation.Tests/NSwag.Generation.Tests.csproj b/src/NSwag.Generation.Tests/NSwag.Generation.Tests.csproj index 929ef80fef..546df0f41f 100644 --- a/src/NSwag.Generation.Tests/NSwag.Generation.Tests.csproj +++ b/src/NSwag.Generation.Tests/NSwag.Generation.Tests.csproj @@ -10,8 +10,11 @@ - - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/NSwag.MSBuild/NSwag.MSBuild.nuspec b/src/NSwag.MSBuild/NSwag.MSBuild.nuspec index b438e64b3d..542cc1952f 100644 --- a/src/NSwag.MSBuild/NSwag.MSBuild.nuspec +++ b/src/NSwag.MSBuild/NSwag.MSBuild.nuspec @@ -28,7 +28,7 @@ - + diff --git a/src/NSwag.MSBuild/NSwag.MSBuild.props b/src/NSwag.MSBuild/NSwag.MSBuild.props index 20efc1c697..8b9d3e65ec 100644 --- a/src/NSwag.MSBuild/NSwag.MSBuild.props +++ b/src/NSwag.MSBuild/NSwag.MSBuild.props @@ -3,11 +3,11 @@ "$(MSBuildThisFileDirectory)../tools/Win/NSwag.exe" "$(MSBuildThisFileDirectory)../tools/Win/NSwag.x86.exe" - dotnet "$(MSBuildThisFileDirectory)../tools/Net60/dotnet-nswag.dll" dotnet "$(MSBuildThisFileDirectory)../tools/Net80/dotnet-nswag.dll" + dotnet "$(MSBuildThisFileDirectory)../tools/Net90/dotnet-nswag.dll" $(MSBuildThisFileDirectory)../tools/Win/ - $(MSBuildThisFileDirectory)../tools/Net60/ $(MSBuildThisFileDirectory)../tools/Net80/ + $(MSBuildThisFileDirectory)../tools/Net90/ diff --git a/src/NSwag.NoInstaller.slnf b/src/NSwag.NoInstaller.slnf index 22d6de4ff5..27cd432f64 100644 --- a/src/NSwag.NoInstaller.slnf +++ b/src/NSwag.NoInstaller.slnf @@ -30,10 +30,10 @@ "NSwag.Generation.Tests\\NSwag.Generation.Tests.csproj", "NSwag.Generation.WebApi\\NSwag.Generation.WebApi.csproj", "NSwag.Generation\\NSwag.Generation.csproj", - "NSwag.Sample.NET60Minimal\\NSwag.Sample.NET60Minimal.csproj", - "NSwag.Sample.NET60\\NSwag.Sample.NET60.csproj", "NSwag.Sample.NET80Minimal\\NSwag.Sample.NET80Minimal.csproj", - "NSwag.Sample.NET80\\NSwag.Sample.NET80.csproj" + "NSwag.Sample.NET80\\NSwag.Sample.NET80.csproj", + "NSwag.Sample.NET90Minimal\\NSwag.Sample.NET90Minimal.csproj", + "NSwag.Sample.NET90\\NSwag.Sample.NET90.csproj" ] } } \ No newline at end of file diff --git a/src/NSwag.Npm/README.md b/src/NSwag.Npm/README.md index 083db8b3db..efb43cdc0a 100644 --- a/src/NSwag.Npm/README.md +++ b/src/NSwag.Npm/README.md @@ -39,11 +39,11 @@ Add the switch `/runtime:NetCore*` to the command to execute one of the .NET Cor To specify what .NET Core binaries to execute, either use (default) - nswag version /runtime:Net60 + nswag version /runtime:Net80 or - nswag version /runtime:Net80 + nswag version /runtime:Net90 ## Development diff --git a/src/NSwag.Npm/bin/nswag.js b/src/NSwag.Npm/bin/nswag.js index 16add27913..c1446d91fe 100644 --- a/src/NSwag.Npm/bin/nswag.js +++ b/src/NSwag.Npm/bin/nswag.js @@ -3,8 +3,8 @@ var defaultCoreVersion = "Net80"; var supportedCoreVersions = [ - { ver: '6.0', dir: "Net60", }, { ver: '8.0', dir: "Net80", }, + { ver: '9.0', dir: "Net90", }, ]; // Initialize @@ -15,8 +15,8 @@ var args = process.argv.splice(2, process.argv.length - 2).map(function (a) { re // Legacy support args = args.replace("--x86", "/runtime:WinX86"); args = args.replace("/runtime:x86", "/runtime:WinX86"); -args = args.replace("--core 6.0", "/runtime:Net60"); args = args.replace("--core 8.0", "/runtime:Net80"); +args = args.replace("--core 9.0", "/runtime:Net90"); args = args.replace("--core", "/runtime:" + defaultCoreVersion); // Search for full .NET installation diff --git a/src/NSwag.Npm/package.json b/src/NSwag.Npm/package.json index 2893c0fa53..ff985ebb23 100644 --- a/src/NSwag.Npm/package.json +++ b/src/NSwag.Npm/package.json @@ -1,6 +1,6 @@ { "name": "nswag", - "version": "14.0.0", + "version": "14.2.0", "optionalDependencies": {}, "repository": { "type": "git", diff --git a/src/NSwag.Sample.NET60Minimal/nswag.json b/src/NSwag.Sample.NET60Minimal/nswag.json deleted file mode 100644 index c00a25bfe7..0000000000 --- a/src/NSwag.Sample.NET60Minimal/nswag.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "runtime": "Net60", - "defaultVariables": null, - "documentGenerator": { - "aspNetCoreToOpenApi": { - "project": "NSwag.Sample.NET60Minimal.csproj", - "msBuildProjectExtensionsPath": null, - "configuration": null, - "runtime": null, - "targetFramework": null, - "noBuild": false, - "verbose": true, - "workingDirectory": null, - "requireParametersWithoutDefault": false, - "apiGroupNames": null, - "defaultPropertyNameHandling": "Default", - "defaultReferenceTypeNullHandling": "Null", - "defaultDictionaryValueReferenceTypeNullHandling": "NotNull", - "defaultResponseReferenceTypeNullHandling": "NotNull", - "defaultEnumHandling": "Integer", - "flattenInheritanceHierarchy": false, - "generateKnownTypes": true, - "generateEnumMappingDescription": false, - "generateXmlObjects": false, - "generateAbstractProperties": false, - "generateAbstractSchemas": true, - "ignoreObsoleteProperties": false, - "allowReferencesWithProperties": false, - "excludedTypeNames": [], - "serviceHost": null, - "serviceBasePath": null, - "serviceSchemes": [], - "infoTitle": "My Title", - "infoDescription": null, - "infoVersion": "1.0.0", - "documentTemplate": null, - "documentProcessorTypes": [], - "operationProcessorTypes": [], - "typeNameGeneratorType": null, - "schemaNameGeneratorType": null, - "contractResolverType": null, - "serializerSettingsType": null, - "documentName": "v1", - "aspNetCoreEnvironment": null, - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": true, - "output": "openapi.json", - "outputType": "Swagger2", - "assemblyPaths": [], - "assemblyConfig": null, - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": {} -} \ No newline at end of file diff --git a/src/NSwag.Sample.NET60/Controllers/ValuesController.cs b/src/NSwag.Sample.NET90/Controllers/ValuesController.cs similarity index 97% rename from src/NSwag.Sample.NET60/Controllers/ValuesController.cs rename to src/NSwag.Sample.NET90/Controllers/ValuesController.cs index 59bfda3282..55c1b366b2 100644 --- a/src/NSwag.Sample.NET60/Controllers/ValuesController.cs +++ b/src/NSwag.Sample.NET90/Controllers/ValuesController.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using Microsoft.AspNetCore.Mvc; -namespace NSwag.Sample.NET60.Controllers +namespace NSwag.Sample.NET80.Controllers { [Route("api/[controller]")] [ApiController] diff --git a/src/NSwag.Sample.NET60/NSwag.Sample.NET60.csproj b/src/NSwag.Sample.NET90/NSwag.Sample.NET90.csproj similarity index 58% rename from src/NSwag.Sample.NET60/NSwag.Sample.NET60.csproj rename to src/NSwag.Sample.NET90/NSwag.Sample.NET90.csproj index 0890a7bd8c..f09aba7f8a 100644 --- a/src/NSwag.Sample.NET60/NSwag.Sample.NET60.csproj +++ b/src/NSwag.Sample.NET90/NSwag.Sample.NET90.csproj @@ -1,14 +1,10 @@  - net6.0 + net9.0 enable - - - - diff --git a/src/NSwag.Sample.NET60/Program.cs b/src/NSwag.Sample.NET90/Program.cs similarity index 90% rename from src/NSwag.Sample.NET60/Program.cs rename to src/NSwag.Sample.NET90/Program.cs index 0fe6db3c92..92efd4267e 100644 --- a/src/NSwag.Sample.NET60/Program.cs +++ b/src/NSwag.Sample.NET90/Program.cs @@ -1,8 +1,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; -using NSwag.Sample.NET60; -namespace NSwag.Sample.NET60 +namespace NSwag.Sample.NET90 { public class Program { diff --git a/src/NSwag.Sample.NET60/Properties/launchSettings.json b/src/NSwag.Sample.NET90/Properties/launchSettings.json similarity index 92% rename from src/NSwag.Sample.NET60/Properties/launchSettings.json rename to src/NSwag.Sample.NET90/Properties/launchSettings.json index 715b9fe7fc..8ae276e366 100644 --- a/src/NSwag.Sample.NET60/Properties/launchSettings.json +++ b/src/NSwag.Sample.NET90/Properties/launchSettings.json @@ -1,7 +1,7 @@ { "$schema": "http://json.schemastore.org/launchsettings.json", "profiles": { - "NSwag.Sample.NET60": { + "NSwag.Sample.NET90": { "commandName": "Project", "launchBrowser": true, "launchUrl": "swagger", diff --git a/src/NSwag.Sample.NET60/Startup.cs b/src/NSwag.Sample.NET90/Startup.cs similarity index 98% rename from src/NSwag.Sample.NET60/Startup.cs rename to src/NSwag.Sample.NET90/Startup.cs index d7e3dd7c48..331d4ba83f 100644 --- a/src/NSwag.Sample.NET60/Startup.cs +++ b/src/NSwag.Sample.NET90/Startup.cs @@ -6,7 +6,7 @@ using NJsonSchema.Generation; using System.Text.Json.Serialization; -namespace NSwag.Sample.NET60 +namespace NSwag.Sample.NET90 { public class Startup { diff --git a/src/NSwag.Sample.NET60/appsettings.Development.json b/src/NSwag.Sample.NET90/appsettings.Development.json similarity index 100% rename from src/NSwag.Sample.NET60/appsettings.Development.json rename to src/NSwag.Sample.NET90/appsettings.Development.json diff --git a/src/NSwag.Sample.NET60/appsettings.json b/src/NSwag.Sample.NET90/appsettings.json similarity index 100% rename from src/NSwag.Sample.NET60/appsettings.json rename to src/NSwag.Sample.NET90/appsettings.json diff --git a/src/NSwag.Sample.NET60/nswag.json b/src/NSwag.Sample.NET90/nswag.json similarity index 96% rename from src/NSwag.Sample.NET60/nswag.json rename to src/NSwag.Sample.NET90/nswag.json index 948c460162..d2a7177a91 100644 --- a/src/NSwag.Sample.NET60/nswag.json +++ b/src/NSwag.Sample.NET90/nswag.json @@ -1,9 +1,9 @@ { - "runtime": "Net60", + "runtime": "Net90", "defaultVariables": null, "documentGenerator": { "aspNetCoreToOpenApi": { - "project": "NSwag.Sample.NET60.csproj", + "project": "NSwag.Sample.NET90.csproj", "msBuildProjectExtensionsPath": null, "configuration": null, "runtime": null, diff --git a/src/NSwag.Sample.NET60/openapi.json b/src/NSwag.Sample.NET90/openapi.json similarity index 100% rename from src/NSwag.Sample.NET60/openapi.json rename to src/NSwag.Sample.NET90/openapi.json diff --git a/src/NSwag.Sample.NET60Minimal/NSwag.Sample.NET60Minimal.csproj b/src/NSwag.Sample.NET90Minimal/NSwag.Sample.NET90Minimal.csproj similarity index 81% rename from src/NSwag.Sample.NET60Minimal/NSwag.Sample.NET60Minimal.csproj rename to src/NSwag.Sample.NET90Minimal/NSwag.Sample.NET90Minimal.csproj index 38bdd60b5a..1e769d3c2f 100644 --- a/src/NSwag.Sample.NET60Minimal/NSwag.Sample.NET60Minimal.csproj +++ b/src/NSwag.Sample.NET90Minimal/NSwag.Sample.NET90Minimal.csproj @@ -1,6 +1,6 @@  - net6.0 + net9.0 diff --git a/src/NSwag.Sample.NET60Minimal/Program.cs b/src/NSwag.Sample.NET90Minimal/Program.cs similarity index 100% rename from src/NSwag.Sample.NET60Minimal/Program.cs rename to src/NSwag.Sample.NET90Minimal/Program.cs diff --git a/src/NSwag.Sample.NET60Minimal/Properties/launchSettings.json b/src/NSwag.Sample.NET90Minimal/Properties/launchSettings.json similarity index 90% rename from src/NSwag.Sample.NET60Minimal/Properties/launchSettings.json rename to src/NSwag.Sample.NET90Minimal/Properties/launchSettings.json index 6aa10cff13..5ca81b5de1 100644 --- a/src/NSwag.Sample.NET60Minimal/Properties/launchSettings.json +++ b/src/NSwag.Sample.NET90Minimal/Properties/launchSettings.json @@ -1,7 +1,7 @@ { "$schema": "http://json.schemastore.org/launchsettings.json", "profiles": { - "NSwag.Sample.NET60Minimal": { + "NSwag.Sample.NET90Minimal": { "commandName": "Project", "launchBrowser": true, "launchUrl": "swagger", diff --git a/src/NSwag.Sample.NET90Minimal/nswag.json b/src/NSwag.Sample.NET90Minimal/nswag.json new file mode 100644 index 0000000000..720f576a37 --- /dev/null +++ b/src/NSwag.Sample.NET90Minimal/nswag.json @@ -0,0 +1,231 @@ +{ + "runtime": "Net90", + "defaultVariables": null, + "documentGenerator": { + "aspNetCoreToOpenApi": { + "project": "NSwag.Sample.NET90Minimal.csproj", + "documentName": "v1", + "msBuildProjectExtensionsPath": null, + "configuration": null, + "runtime": null, + "targetFramework": null, + "noBuild": false, + "msBuildOutputPath": null, + "verbose": true, + "workingDirectory": null, + "aspNetCoreEnvironment": null, + "output": "openapi.json", + "newLineBehavior": "Auto" + } + }, + "codeGenerators": { + "openApiToTypeScriptClient": { + "className": "{controller}Client", + "moduleName": "", + "namespace": "", + "typeScriptVersion": 2.7, + "template": "Fetch", + "promiseType": "Promise", + "httpClass": "HttpClient", + "withCredentials": false, + "useSingletonProvider": false, + "injectionTokenType": "OpaqueToken", + "rxJsVersion": 6.0, + "dateTimeType": "Date", + "nullValue": "Undefined", + "generateClientClasses": true, + "generateClientInterfaces": false, + "generateOptionalParameters": false, + "exportTypes": true, + "wrapDtoExceptions": false, + "exceptionClass": "ApiException", + "clientBaseClass": null, + "wrapResponses": false, + "wrapResponseMethods": [], + "generateResponseClasses": true, + "responseClass": "SwaggerResponse", + "protectedMethods": [], + "configurationClass": null, + "useTransformOptionsMethod": false, + "useTransformResultMethod": false, + "generateDtoTypes": true, + "operationGenerationMode": "MultipleClientsFromOperationId", + "markOptionalProperties": true, + "generateCloneMethod": false, + "typeStyle": "Class", + "enumStyle": "Enum", + "useLeafType": false, + "classTypes": [], + "extendedClasses": [], + "extensionCode": null, + "generateDefaultValues": true, + "excludedTypeNames": [], + "excludedParameterNames": [], + "handleReferences": false, + "generateTypeCheckFunctions": false, + "generateConstructorInterface": true, + "convertConstructorInterfaceData": false, + "importRequiredTypes": true, + "useGetBaseUrlMethod": false, + "baseUrlTokenName": "API_BASE_URL", + "queryNullValue": "", + "useAbortSignal": false, + "inlineNamedDictionaries": false, + "inlineNamedAny": false, + "includeHttpContext": false, + "templateDirectory": null, + "serviceHost": null, + "serviceSchemes": null, + "output": "GeneratedClientsTs.gen", + "newLineBehavior": "Auto" + }, + "openApiToCSharpClient": { + "clientBaseClass": null, + "configurationClass": null, + "generateClientClasses": true, + "suppressClientClassesOutput": false, + "generateClientInterfaces": false, + "suppressClientInterfacesOutput": false, + "clientBaseInterface": null, + "injectHttpClient": true, + "disposeHttpClient": true, + "protectedMethods": [], + "generateExceptionClasses": true, + "exceptionClass": "ApiException", + "wrapDtoExceptions": true, + "useHttpClientCreationMethod": false, + "httpClientType": "System.Net.Http.HttpClient", + "useHttpRequestMessageCreationMethod": false, + "useBaseUrl": true, + "generateBaseUrlProperty": true, + "generateSyncMethods": false, + "generatePrepareRequestAndProcessResponseAsAsyncMethods": false, + "exposeJsonSerializerSettings": false, + "clientClassAccessModifier": "public", + "typeAccessModifier": "public", + "propertySetterAccessModifier": "", + "generateNativeRecords": false, + "generateContractsOutput": false, + "contractsNamespace": null, + "contractsOutputFilePath": null, + "parameterDateTimeFormat": "s", + "parameterDateFormat": "yyyy-MM-dd", + "generateUpdateJsonSerializerSettingsMethod": true, + "useRequestAndResponseSerializationSettings": false, + "serializeTypeInformation": false, + "queryNullValue": "", + "className": "{controller}Client", + "operationGenerationMode": "MultipleClientsFromOperationId", + "additionalNamespaceUsages": [], + "additionalContractNamespaceUsages": [], + "generateOptionalParameters": false, + "generateJsonMethods": false, + "enforceFlagEnums": false, + "parameterArrayType": "System.Collections.Generic.IEnumerable", + "parameterDictionaryType": "System.Collections.Generic.IDictionary", + "responseArrayType": "System.Collections.Generic.ICollection", + "responseDictionaryType": "System.Collections.Generic.IDictionary", + "wrapResponses": false, + "wrapResponseMethods": [], + "generateResponseClasses": true, + "responseClass": "SwaggerResponse", + "namespace": "MyNamespace", + "requiredPropertiesMustBeDefined": true, + "dateType": "System.DateTimeOffset", + "jsonConverters": null, + "anyType": "object", + "dateTimeType": "System.DateTimeOffset", + "timeType": "System.TimeSpan", + "timeSpanType": "System.TimeSpan", + "arrayType": "System.Collections.Generic.ICollection", + "arrayInstanceType": "System.Collections.ObjectModel.Collection", + "dictionaryType": "System.Collections.Generic.IDictionary", + "dictionaryInstanceType": "System.Collections.Generic.Dictionary", + "arrayBaseType": "System.Collections.ObjectModel.Collection", + "dictionaryBaseType": "System.Collections.Generic.Dictionary", + "classStyle": "Poco", + "jsonLibrary": "NewtonsoftJson", + "generateDefaultValues": true, + "generateDataAnnotations": true, + "excludedTypeNames": [], + "excludedParameterNames": [], + "handleReferences": false, + "generateImmutableArrayProperties": false, + "generateImmutableDictionaryProperties": false, + "jsonSerializerSettingsTransformationMethod": null, + "inlineNamedArrays": false, + "inlineNamedDictionaries": false, + "inlineNamedTuples": true, + "inlineNamedAny": false, + "generateDtoTypes": true, + "generateOptionalPropertiesAsNullable": false, + "generateNullableReferenceTypes": false, + "templateDirectory": null, + "serviceHost": null, + "serviceSchemes": null, + "output": "GeneratedClientsCs.gen", + "newLineBehavior": "Auto" + }, + "openApiToCSharpController": { + "controllerBaseClass": null, + "controllerStyle": "Partial", + "controllerTarget": "AspNetCore", + "useCancellationToken": false, + "useActionResultType": false, + "generateModelValidationAttributes": false, + "routeNamingStrategy": "None", + "basePath": null, + "className": "{controller}", + "operationGenerationMode": "MultipleClientsFromOperationId", + "additionalNamespaceUsages": [], + "additionalContractNamespaceUsages": [], + "generateOptionalParameters": false, + "generateJsonMethods": false, + "enforceFlagEnums": false, + "parameterArrayType": "System.Collections.Generic.IEnumerable", + "parameterDictionaryType": "System.Collections.Generic.IDictionary", + "responseArrayType": "System.Collections.Generic.ICollection", + "responseDictionaryType": "System.Collections.Generic.IDictionary", + "wrapResponses": false, + "wrapResponseMethods": [], + "generateResponseClasses": true, + "responseClass": "SwaggerResponse", + "namespace": "MyNamespace", + "requiredPropertiesMustBeDefined": true, + "dateType": "System.DateTimeOffset", + "jsonConverters": null, + "anyType": "object", + "dateTimeType": "System.DateTimeOffset", + "timeType": "System.TimeSpan", + "timeSpanType": "System.TimeSpan", + "arrayType": "System.Collections.Generic.List", + "arrayInstanceType": "System.Collections.Generic.List", + "dictionaryType": "System.Collections.Generic.IDictionary", + "dictionaryInstanceType": "System.Collections.Generic.Dictionary", + "arrayBaseType": "System.Collections.ObjectModel.Collection", + "dictionaryBaseType": "System.Collections.Generic.Dictionary", + "classStyle": "Poco", + "jsonLibrary": "NewtonsoftJson", + "generateDefaultValues": true, + "generateDataAnnotations": true, + "excludedTypeNames": [], + "excludedParameterNames": [], + "handleReferences": false, + "generateImmutableArrayProperties": false, + "generateImmutableDictionaryProperties": false, + "jsonSerializerSettingsTransformationMethod": null, + "inlineNamedArrays": false, + "inlineNamedDictionaries": false, + "inlineNamedTuples": true, + "inlineNamedAny": false, + "generateDtoTypes": true, + "generateOptionalPropertiesAsNullable": false, + "generateNullableReferenceTypes": false, + "templateDirectory": null, + "serviceHost": null, + "serviceSchemes": null, + "output": "GeneratedControllersCs.gen", + "newLineBehavior": "Auto" + } + } +} \ No newline at end of file diff --git a/src/NSwag.Sample.NET60Minimal/openapi.json b/src/NSwag.Sample.NET90Minimal/openapi.json similarity index 100% rename from src/NSwag.Sample.NET60Minimal/openapi.json rename to src/NSwag.Sample.NET90Minimal/openapi.json diff --git a/src/NSwag.sln b/src/NSwag.sln index bc33f5f241..254f7791fd 100644 --- a/src/NSwag.sln +++ b/src/NSwag.sln @@ -117,16 +117,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "00 Build", "00 Build", "{6F EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "..\build\_build.csproj", "{AC3D8125-AE21-49FC-A217-D96C7B585FF9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Sample.NET60", "NSwag.Sample.NET60\NSwag.Sample.NET60.csproj", "{DE82965A-6935-43E0-A9A1-F3F35B4487EB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Sample.NET60Minimal", "NSwag.Sample.NET60Minimal\NSwag.Sample.NET60Minimal.csproj", "{24693FBC-445E-4360-A1E8-B6F136C563FB}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.ConsoleCore.Tests", "NSwag.ConsoleCore.Tests\NSwag.ConsoleCore.Tests.csproj", "{CF6112E5-20FD-4B22-A6C0-20AF6B3396F3}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Sample.NET80", "NSwag.Sample.NET80\NSwag.Sample.NET80.csproj", "{2A166077-2189-4376-A38B-8E362A319028}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Sample.NET80Minimal", "NSwag.Sample.NET80Minimal\NSwag.Sample.NET80Minimal.csproj", "{F0569608-BD55-4316-94F0-E85A14D7FE14}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Sample.NET90", "NSwag.Sample.NET90\NSwag.Sample.NET90.csproj", "{DE82965A-6935-43E0-A9A1-F3F35B4487EB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Sample.NET90Minimal", "NSwag.Sample.NET90Minimal\NSwag.Sample.NET90Minimal.csproj", "{24693FBC-445E-4360-A1E8-B6F136C563FB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/src/NSwagStudio/nswag.cmd b/src/NSwagStudio/nswag.cmd index ed4321a24c..a102b33d2a 100644 --- a/src/NSwagStudio/nswag.cmd +++ b/src/NSwagStudio/nswag.cmd @@ -6,13 +6,13 @@ IF NOT "%args:/runtime:winx86=%" == "%args%" ( GOTO end ) -IF NOT "%args:/runtime:net60=%" == "%args%" ( - dotnet "%~dp0/Net60/dotnet-nswag.dll" %* +IF NOT "%args:/runtime:net80=%" == "%args%" ( + dotnet "%~dp0/Net80/dotnet-nswag.dll" %* GOTO end ) -IF NOT "%args:/runtime:net80=%" == "%args%" ( - dotnet "%~dp0/Net80/dotnet-nswag.dll" %* +IF NOT "%args:/runtime:net90=%" == "%args%" ( + dotnet "%~dp0/Net90/dotnet-nswag.dll" %* GOTO end )