diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 6bbf90c422..41e2a32820 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -91,13 +91,10 @@ "Clean", "Compile", "InstallDependencies", - "IntegrationTest", "Pack", "Publish", "Restore", - "Samples", - "Test", - "UnitTest" + "Test" ] } }, @@ -114,13 +111,10 @@ "Clean", "Compile", "InstallDependencies", - "IntegrationTest", "Pack", "Publish", "Restore", - "Samples", - "Test", - "UnitTest" + "Test" ] } }, diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ccb54a74e0..639817b139 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -71,7 +71,6 @@ steps: msbuildArchitecture: 'x86' configuration: '$(BuildConfiguration)' - - task: VSTest@2 displayName: 'Run tests' inputs: diff --git a/build/00_Install.bat b/build/00_Install.bat deleted file mode 100644 index 3fc6429fd8..0000000000 --- a/build/00_Install.bat +++ /dev/null @@ -1,3 +0,0 @@ -pushd "%~dp0\.." -cmd /c call build.cmd restore --configuration Release -popd diff --git a/build/01_Build.bat b/build/01_Build.bat deleted file mode 100644 index 38c8bdeb40..0000000000 --- a/build/01_Build.bat +++ /dev/null @@ -1,3 +0,0 @@ -pushd "%~dp0\.." -cmd /c call build.cmd compile pack --configuration Release -popd diff --git a/build/02_RunUnitTests.bat b/build/02_RunUnitTests.bat deleted file mode 100644 index ad1aff2464..0000000000 --- a/build/02_RunUnitTests.bat +++ /dev/null @@ -1,3 +0,0 @@ -pushd "%~dp0\.." -cmd /c call build.cmd unittest --configuration Release -popd diff --git a/build/03_RunIntegrationTests.bat b/build/03_RunIntegrationTests.bat deleted file mode 100644 index fc9fb6b435..0000000000 --- a/build/03_RunIntegrationTests.bat +++ /dev/null @@ -1,3 +0,0 @@ -pushd "%~dp0\.." -cmd /c call build.cmd integrationtest --configuration Release -popd diff --git a/build/04_Publish.bat b/build/04_Publish.bat deleted file mode 100644 index 64335a3fa3..0000000000 --- a/build/04_Publish.bat +++ /dev/null @@ -1,3 +0,0 @@ -pushd "%~dp0\.." -cmd /c call build.cmd publish --configuration Release -popd diff --git a/build/Build.Pack.cs b/build/Build.Pack.cs index 4ea7295a97..add94b7648 100644 --- a/build/Build.Pack.cs +++ b/build/Build.Pack.cs @@ -22,7 +22,7 @@ public partial class Build // logic from 01_Build.bat Target Pack => _ => _ .DependsOn(Compile) - .After(Test, IntegrationTest, UnitTest, Samples) + .After(Test) .Produces(ArtifactsDirectory / "*.*") .Executes(() => { @@ -123,7 +123,7 @@ public partial class Build // patch npm version var npmPackagesFile = SourceDirectory / "NSwag.Npm" / "package.json"; content = TextTasks.ReadAllText(npmPackagesFile); - content = Regex.Replace(content, @"""version"": "".*""", @"""version"": """ + VersionPrefix + @""""); + content = Regex.Replace(content, @"""version"": "".*""", @"""version"": """ + nugetVersion + @""""); TextTasks.WriteAllText(npmPackagesFile, content); // ZIP directories diff --git a/build/Build.Publish.cs b/build/Build.Publish.cs index 554b88d745..d297dc22f9 100644 --- a/build/Build.Publish.cs +++ b/build/Build.Publish.cs @@ -49,17 +49,21 @@ public partial class Build Path.Combine(userDirectory, ".npmrc"), "//registry.npmjs.org/:_authToken=" + NpmAuthToken + "\n"); - var outputs = Npm("publish", SourceDirectory / "NSwag.Npm", logOutput: false); - - foreach (var output in outputs.Where(o => !o.Text.Contains("npm notice"))) + // do not publish preview packages to npm + if (string.IsNullOrEmpty(VersionSuffix)) { - if (output.Type == OutputType.Std) - { - Serilog.Log.Information(output.Text); - } - else + var outputs = Npm("publish", SourceDirectory / "NSwag.Npm", logOutput: false); + + foreach (var output in outputs.Where(o => !o.Text.Contains("npm notice"))) { - Serilog.Log.Error(output.Text); + if (output.Type == OutputType.Std) + { + Serilog.Log.Information(output.Text); + } + else + { + Serilog.Log.Error(output.Text); + } } } } diff --git a/build/Build.cs b/build/Build.cs index ec432dd1bf..d5fc84a727 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -1,5 +1,4 @@ using System; -using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Xml.Linq; @@ -17,12 +16,10 @@ using Nuke.Common.Utilities.Collections; using static Nuke.Common.IO.FileSystemTasks; -using static Nuke.Common.Tooling.ProcessTasks; using static Nuke.Common.Tools.Chocolatey.ChocolateyTasks; using static Nuke.Common.Tools.DotNet.DotNetTasks; using static Nuke.Common.Tools.MSBuild.MSBuildTasks; using static Nuke.Common.Tools.Npm.NpmTasks; -using static Nuke.Common.Tools.VSTest.VSTestTasks; using Project = Nuke.Common.ProjectModel.Project; partial class Build : NukeBuild @@ -91,9 +88,18 @@ protected override void OnBuildInitialized() { VersionPrefix = DetermineVersionPrefix(); - VersionSuffix = !IsTaggedBuild - ? $"preview-{DateTime.UtcNow:yyyyMMdd-HHmm}" - : ""; + var versionParts = VersionPrefix.Split('-'); + if (versionParts.Length == 2) + { + VersionPrefix = versionParts[0]; + VersionSuffix = versionParts[1]; + } + else + { + VersionSuffix = !IsTaggedBuild + ? $"preview-{DateTime.UtcNow:yyyyMMdd-HHmm}" + : ""; + } if (IsLocalBuild) { @@ -121,15 +127,15 @@ protected override void OnBuildInitialized() .Executes(() => { Chocolatey("install wixtoolset -y"); - Chocolatey("install netfx-4.6.1-devpack -y"); Chocolatey("install dotnetcore-3.1-sdk -y"); + Chocolatey("install netfx-4.6.2-devpack -y"); + Chocolatey("install dotnet-7.0-sdk -y"); NpmInstall(x => x .EnableGlobal() .AddPackages("dotnettools") ); }); - // logic from 00_Install.bat Target Restore => _ => _ .Executes(() => { @@ -137,10 +143,6 @@ protected override void OnBuildInitialized() .SetProcessWorkingDirectory(SourceDirectory / "NSwag.Npm") ); - NpmInstall(x => x - .SetProcessWorkingDirectory(SourceDirectory / "NSwag.Integration.TypeScriptWeb") - ); - MSBuild(x => x .SetTargetPath(Solution) .SetTargets("Restore") @@ -155,7 +157,6 @@ protected override void OnBuildInitialized() ); }); - // logic from 01_Build.bat Target Compile => _ => _ .DependsOn(Restore) .Executes(() => @@ -165,169 +166,53 @@ protected override void OnBuildInitialized() Serilog.Log.Information("Build and copy full .NET command line with configuration {Configuration}", Configuration); + // TODO: Fix build here MSBuild(x => x - .SetTargetPath(Solution) - .SetTargets("Rebuild") - .SetAssemblyVersion(VersionPrefix) - .SetFileVersion(VersionPrefix) - .SetInformationalVersion(VersionPrefix) - .SetConfiguration(Configuration) - .SetMaxCpuCount(Environment.ProcessorCount) - .SetNodeReuse(IsLocalBuild) - .SetVerbosity(MSBuildVerbosity.Minimal) - .SetProperty("Deterministic", IsServerBuild) - .SetProperty("ContinuousIntegrationBuild", IsServerBuild) + .SetProjectFile(Solution.GetProject("NSwagStudio")) + .SetTargets("Build") + .SetAssemblyVersion(VersionPrefix) + .SetFileVersion(VersionPrefix) + .SetInformationalVersion(VersionPrefix) + .SetConfiguration(Configuration) + .SetMaxCpuCount(Environment.ProcessorCount) + .SetNodeReuse(IsLocalBuild) + .SetVerbosity(MSBuildVerbosity.Minimal) + .SetProperty("Deterministic", IsServerBuild) + .SetProperty("ContinuousIntegrationBuild", IsServerBuild) + ); + + MSBuild(x => x + .SetTargetPath(Solution) + .SetTargets("Build") + .SetAssemblyVersion(VersionPrefix) + .SetFileVersion(VersionPrefix) + .SetInformationalVersion(VersionPrefix) + .SetConfiguration(Configuration) + .SetMaxCpuCount(Environment.ProcessorCount) + .SetNodeReuse(IsLocalBuild) + .SetVerbosity(MSBuildVerbosity.Minimal) + .SetProperty("Deterministic", IsServerBuild) + .SetProperty("ContinuousIntegrationBuild", IsServerBuild) ); // later steps need to have binaries in correct places PublishAndCopyConsoleProjects(); }); - // logic from 02_RunUnitTests.bat - Target UnitTest => _ => _ + Target Test => _ => _ .After(Compile) .Executes(() => { - var webApiTest = Solution.GetProject("NSwag.Generation.WebApi.Tests"); - VSTest(x => x - .SetTestAssemblies(webApiTest.Directory / "bin" / Configuration / "NSwag.Generation.WebApi.Tests.dll") - ); - - /* - VSTest(x => x - .SetLogger(logger) - .SetTestAssemblies(SourceDirectory / "NSwag.Tests" / "bin" / Configuration / "NSwag.Tests.dll") - ); - */ - - // project name + target framework pairs - var dotNetTestTargets = new (string ProjectName, string Framework)[] - { - ("NSwag.CodeGeneration.Tests", null), - ("NSwag.CodeGeneration.CSharp.Tests", null), - ("NSwag.CodeGeneration.TypeScript.Tests", null), - ("NSwag.Generation.AspNetCore.Tests", null), - ("NSwag.Core.Tests", null), - ("NSwag.Core.Yaml.Tests", null), - ("NSwag.AssemblyLoader.Tests", null) - }; - - foreach (var (project, targetFramework) in dotNetTestTargets) + foreach (var project in Solution.AllProjects.Where(p => p.Name.EndsWith(".Tests"))) { DotNetTest(x => x - .SetProjectFile(Solution.GetProject(project)) - .SetFramework(targetFramework) + .SetProjectFile(project) + .EnableNoRestore() .SetConfiguration(Configuration) ); } }); - // logic from 03_RunIntegrationTests.bat - Target IntegrationTest => _ => _ - .After(Compile) - .DependsOn(Samples) - .Executes(() => - { - var nswagCommand = NSwagStudioBinaries / "nswag.cmd"; - - // project name + runtime pairs - var dotnetTargets = new[] - { - ("NSwag.Sample.NETCore21", "NetCore21"), - ("NSwag.Sample.NETCore31", "NetCore31"), - ("NSwag.Sample.NET50", "Net50"), - ("NSwag.Sample.NET60", "Net60"), - ("NSwag.Sample.NET60Minimal", "Net60"), - ("NSwag.Sample.NET70", "Net70"), - ("NSwag.Sample.NET70Minimal", "Net70") - }; - - foreach (var (projectName, runtime) in dotnetTargets) - { - var project = Solution.GetProject(projectName); - DotNetBuild(x => BuildDefaults(x) - .SetProcessWorkingDirectory(project.Directory) - .SetProperty("CopyLocalLockFileAssemblies", true) - ); - var process = StartProcess(nswagCommand, $"run /runtime:{runtime}", workingDirectory: project.Directory); - process.WaitForExit(); - } - - // project name + runtime pairs - var msbuildTargets = new[] - { - ("NSwag.Sample.NetGlobalAsax", "Winx64"), - ("NSwag.Integration.WebAPI", "Winx64") - }; - - foreach (var (projectName, runtime) in msbuildTargets) - { - var project = Solution.GetProject(projectName); - MSBuild(x => x - .SetProcessWorkingDirectory(project.Directory) - .SetNodeReuse(IsLocalBuild) - ); - var process = StartProcess(nswagCommand, $"run /runtime:{runtime}", workingDirectory: project.Directory); - process.WaitForExit(); - } - }); - - Target Test => _ => _ - .DependsOn(UnitTest, IntegrationTest); - - // logic from runs.ps1 - Target Samples => _ => _ - .After(Compile) - .Executes(() => - { - var studioProject = Solution.GetProject("NSwagStudio"); - - void NSwagRun( - Project project, - string configurationFile, - string runtime, - Configuration configuration, - bool build) - { - var nswagConfigurationFile = project.Directory / $"{configurationFile}.nswag"; - var nswagSwaggerFile = project.Directory / $"{configurationFile}_swagger.json"; - - DeleteFile(nswagSwaggerFile); - - if (build) - { - DotNetBuild(x => BuildDefaults(x) - .SetConfiguration(configuration) - .SetProjectFile(project) - ); - } - else - { - DotNetRestore(x => x - .SetProjectFile(project) - ); - } - - var cliPath = studioProject.Directory / "bin" / Configuration / runtime / "dotnet-nswag.dll"; - DotNet($"{cliPath} run {nswagConfigurationFile} /variables:configuration=" + configuration); - - if (!File.Exists(nswagSwaggerFile)) - { - throw new Exception($"Output ${nswagSwaggerFile} not generated for {nswagConfigurationFile}."); - } - } - - var samplesPath = RootDirectory / "samples"; - var sampleSolution = ProjectModelTasks.ParseSolution(samplesPath / "Samples.sln"); - NSwagRun(sampleSolution.GetProject("Sample.AspNetCore21"), "nswag_assembly", "NetCore21", Configuration.Release, true); - NSwagRun(sampleSolution.GetProject("Sample.AspNetCore21"), "nswag_project", "NetCore21", Configuration.Release, false); - NSwagRun(sampleSolution.GetProject("Sample.AspNetCore21"), "nswag_reflection", "NetCore21", Configuration.Release, true); - - NSwagRun(sampleSolution.GetProject("Sample.AspNetCore21"), "nswag_assembly", "NetCore21", Configuration.Debug, true); - NSwagRun(sampleSolution.GetProject("Sample.AspNetCore21"), "nswag_project", "NetCore21", Configuration.Debug, false); - NSwagRun(sampleSolution.GetProject("Sample.AspNetCore21"), "nswag_reflection", "NetCore21", Configuration.Debug, true); - }); - void PublishAndCopyConsoleProjects() { var consoleCoreProject = Solution.GetProject("NSwag.ConsoleCore"); @@ -336,7 +221,7 @@ void PublishAndCopyConsoleProjects() Serilog.Log.Information("Publish command line projects"); - void PublishConsoleProject(Nuke.Common.ProjectModel.Project project, string[] targetFrameworks) + void PublishConsoleProject(Project project, string[] targetFrameworks) { foreach (var targetFramework in targetFrameworks) { @@ -353,23 +238,21 @@ void PublishConsoleProject(Nuke.Common.ProjectModel.Project project, string[] ta } } - PublishConsoleProject(consoleX86Project, new[] { "net461" }); - PublishConsoleProject(consoleProject, new[] { "net461" }); - PublishConsoleProject(consoleCoreProject, new[] { "netcoreapp2.1", "netcoreapp3.1", "net5.0", "net6.0", "net7.0" }); + PublishConsoleProject(consoleX86Project, new[] { "net462" }); + PublishConsoleProject(consoleProject, new[] { "net462" }); + PublishConsoleProject(consoleCoreProject, new[] { "netcoreapp3.1", "net6.0", "net7.0" }); void CopyConsoleBinaries(AbsolutePath target) { // take just exe from X86 as other files are shared with console project - var consoleX86Directory = consoleX86Project.Directory / "bin" / Configuration / "net461" / "publish"; + var consoleX86Directory = consoleX86Project.Directory / "bin" / Configuration / "net462" / "publish"; CopyFileToDirectory(consoleX86Directory / "NSwag.x86.exe", target / "Win"); CopyFileToDirectory(consoleX86Directory / "NSwag.x86.exe.config", target / "Win"); - CopyDirectoryRecursively(consoleProject.Directory / "bin" / Configuration / "net461" / "publish", target / "Win", DirectoryExistsPolicy.Merge); + CopyDirectoryRecursively(consoleProject.Directory / "bin" / Configuration / "net462" / "publish", target / "Win", DirectoryExistsPolicy.Merge); var consoleCoreDirectory = consoleCoreProject.Directory / "bin" / Configuration; - CopyDirectoryRecursively(consoleCoreDirectory / "netcoreapp2.1" / "publish", target / "NetCore21"); CopyDirectoryRecursively(consoleCoreDirectory / "netcoreapp3.1" / "publish", target / "NetCore31"); - CopyDirectoryRecursively(consoleCoreDirectory / "net5.0" / "publish", target / "Net50"); CopyDirectoryRecursively(consoleCoreDirectory / "net6.0" / "publish", target / "Net60"); CopyDirectoryRecursively(consoleCoreDirectory / "net7.0" / "publish", target / "Net70"); } @@ -383,7 +266,6 @@ void CopyConsoleBinaries(AbsolutePath target) CopyConsoleBinaries(target: SourceDirectory / "NSwag.Npm" / "bin" / "binaries"); } - DotNetBuildSettings BuildDefaults(DotNetBuildSettings s) { return s diff --git a/samples/Samples.sln b/samples/Samples.sln deleted file mode 100644 index d5eedd5116..0000000000 --- a/samples/Samples.sln +++ /dev/null @@ -1,60 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29613.14 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.AspNetCore20", "WithoutMiddleware\Sample.AspNetCore20\Sample.AspNetCore20.csproj", "{5A204483-5A44-4B80-8B0B-A58284CC4CCB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.AspNetCore21", "WithoutMiddleware\Sample.AspNetCore21\Sample.AspNetCore21.csproj", "{55E2BF82-3ECE-45E2-96BD-65C09C42843D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.NetOwinMiddleware", "WithMiddleware\Sample.NetOwinMiddleware\Sample.NetOwinMiddleware.csproj", "{F8839807-B6F6-41E3-BC98-DFAD3C03085E}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WithMiddleware", "WithMiddleware", "{29EDA9F6-189B-4F96-B5BE-B7B82EB8A62A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WithoutMiddleware", "WithoutMiddleware", "{BF07E900-C7DE-4ADA-8563-E09E6B5AACF0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.AspNetCore31", "WithMiddleware\Sample.AspNetCore31\Sample.AspNetCore31.csproj", "{2F6620B8-D19D-4710-AAB9-4E2B785F5FA5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.AspNetCore31.Client", "WithMiddleware\Sample.AspNetCore31.Client\Sample.AspNetCore31.Client.csproj", "{F9A962BB-9E7A-4FBD-9309-FF27A03856D6}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5A204483-5A44-4B80-8B0B-A58284CC4CCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5A204483-5A44-4B80-8B0B-A58284CC4CCB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5A204483-5A44-4B80-8B0B-A58284CC4CCB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5A204483-5A44-4B80-8B0B-A58284CC4CCB}.Release|Any CPU.Build.0 = Release|Any CPU - {55E2BF82-3ECE-45E2-96BD-65C09C42843D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {55E2BF82-3ECE-45E2-96BD-65C09C42843D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {55E2BF82-3ECE-45E2-96BD-65C09C42843D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {55E2BF82-3ECE-45E2-96BD-65C09C42843D}.Release|Any CPU.Build.0 = Release|Any CPU - {F8839807-B6F6-41E3-BC98-DFAD3C03085E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F8839807-B6F6-41E3-BC98-DFAD3C03085E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F8839807-B6F6-41E3-BC98-DFAD3C03085E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F8839807-B6F6-41E3-BC98-DFAD3C03085E}.Release|Any CPU.Build.0 = Release|Any CPU - {2F6620B8-D19D-4710-AAB9-4E2B785F5FA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2F6620B8-D19D-4710-AAB9-4E2B785F5FA5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2F6620B8-D19D-4710-AAB9-4E2B785F5FA5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2F6620B8-D19D-4710-AAB9-4E2B785F5FA5}.Release|Any CPU.Build.0 = Release|Any CPU - {F9A962BB-9E7A-4FBD-9309-FF27A03856D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F9A962BB-9E7A-4FBD-9309-FF27A03856D6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F9A962BB-9E7A-4FBD-9309-FF27A03856D6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F9A962BB-9E7A-4FBD-9309-FF27A03856D6}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {5A204483-5A44-4B80-8B0B-A58284CC4CCB} = {BF07E900-C7DE-4ADA-8563-E09E6B5AACF0} - {55E2BF82-3ECE-45E2-96BD-65C09C42843D} = {BF07E900-C7DE-4ADA-8563-E09E6B5AACF0} - {F8839807-B6F6-41E3-BC98-DFAD3C03085E} = {29EDA9F6-189B-4F96-B5BE-B7B82EB8A62A} - {2F6620B8-D19D-4710-AAB9-4E2B785F5FA5} = {29EDA9F6-189B-4F96-B5BE-B7B82EB8A62A} - {F9A962BB-9E7A-4FBD-9309-FF27A03856D6} = {29EDA9F6-189B-4F96-B5BE-B7B82EB8A62A} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {733EB565-BE1C-48BE-80C3-872F39D78955} - EndGlobalSection -EndGlobal diff --git a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/.dockerignore b/samples/WithMiddleware/Sample.AspNetCore21.Nginx/.dockerignore deleted file mode 100644 index 43e8ab1e32..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/.dockerignore +++ /dev/null @@ -1,10 +0,0 @@ -.dockerignore -.env -.git -.gitignore -.vs -.vscode -docker-compose.yml -docker-compose.*.yml -*/bin -*/obj diff --git a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Controllers/ValuesController.cs b/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Controllers/ValuesController.cs deleted file mode 100644 index 6558a7839b..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Controllers/ValuesController.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace SimpleApp.Controllers -{ - [Route("api/[controller]")] - [ApiController] - public class ValuesController : ControllerBase - { - // GET api/values - [HttpGet] - public ActionResult> Get() - { - return new string[] { "value1", "value2" }; - } - - // GET api/values/5 - [HttpGet("{id}")] - public ActionResult Get(int id) - { - return "value"; - } - - // POST api/values - [HttpPost] - public void Post([FromBody] string value) - { - } - - // PUT api/values/5 - [HttpPut("{id}")] - public void Put(int id, [FromBody] string value) - { - } - - // DELETE api/values/5 - [HttpDelete("{id}")] - public void Delete(int id) - { - } - } -} diff --git a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Dockerfile b/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Dockerfile deleted file mode 100644 index a07cd16978..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM mcr.microsoft.com/dotnet/core/aspnet:2.1-stretch-slim AS base -WORKDIR /app -EXPOSE 80 - -FROM mcr.microsoft.com/dotnet/core/sdk:2.1-stretch AS build -WORKDIR /src -COPY ["Sample.AspNetCore21.Nginx.csproj", "./"] -RUN dotnet restore "/Sample.AspNetCore21.Nginx.csproj" -COPY . . -WORKDIR "/src/" -RUN dotnet build "Sample.AspNetCore21.Nginx.csproj" -c Release -o /app - -FROM build AS publish -RUN dotnet publish "Sample.AspNetCore21.Nginx.csproj" -c Release -o /app - -FROM base AS final -WORKDIR /app -COPY --from=publish /app . -ENTRYPOINT ["dotnet", "Sample.AspNetCore21.Nginx.dll"] diff --git a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Program.cs b/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Program.cs deleted file mode 100644 index 1c6d935076..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Program.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; - -namespace SimpleApp -{ - public class Program - { - public static void Main(string[] args) - { - CreateWebHostBuilder(args).Build().Run(); - } - - public static IWebHostBuilder CreateWebHostBuilder(string[] args) => - WebHost.CreateDefaultBuilder(args) - .UseStartup(); - } -} diff --git a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Properties/launchSettings.json b/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Properties/launchSettings.json deleted file mode 100644 index e7efce453c..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Properties/launchSettings.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:59185/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "SimpleApp": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:59185/" - }, - "Docker": { - "commandName": "Docker", - "launchBrowser": true, - "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger" - } - } -} \ No newline at end of file diff --git a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Sample.AspNetCore21.Nginx.csproj b/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Sample.AspNetCore21.Nginx.csproj deleted file mode 100644 index 752582a72c..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Sample.AspNetCore21.Nginx.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - netcoreapp2.1 - Linux - docker-compose.dcproj - Linux - - - - true - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Sample.AspNetCore21.Nginx.sln b/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Sample.AspNetCore21.Nginx.sln deleted file mode 100644 index 56053e22b5..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Sample.AspNetCore21.Nginx.sln +++ /dev/null @@ -1,37 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28803.352 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.AspNetCore21.Nginx", "Sample.AspNetCore21.Nginx.csproj", "{1D7FCD75-55BD-4D44-823B-AE3787BDE313}" -EndProject -Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{D3520430-6663-47A9-A7D1-ED43F33508BD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.AspNetCore", "..\..\..\src\NSwag.AspNetCore\NSwag.AspNetCore.csproj", "{57BA5313-3983-4C01-ADD2-AB0CAFC02442}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1D7FCD75-55BD-4D44-823B-AE3787BDE313}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1D7FCD75-55BD-4D44-823B-AE3787BDE313}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1D7FCD75-55BD-4D44-823B-AE3787BDE313}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1D7FCD75-55BD-4D44-823B-AE3787BDE313}.Release|Any CPU.Build.0 = Release|Any CPU - {D3520430-6663-47A9-A7D1-ED43F33508BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D3520430-6663-47A9-A7D1-ED43F33508BD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D3520430-6663-47A9-A7D1-ED43F33508BD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D3520430-6663-47A9-A7D1-ED43F33508BD}.Release|Any CPU.Build.0 = Release|Any CPU - {57BA5313-3983-4C01-ADD2-AB0CAFC02442}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {57BA5313-3983-4C01-ADD2-AB0CAFC02442}.Debug|Any CPU.Build.0 = Debug|Any CPU - {57BA5313-3983-4C01-ADD2-AB0CAFC02442}.Release|Any CPU.ActiveCfg = Release|Any CPU - {57BA5313-3983-4C01-ADD2-AB0CAFC02442}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {F4533C7E-C2A0-4845-9A3D-2408380AED4C} - EndGlobalSection -EndGlobal diff --git a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Startup.cs b/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Startup.cs deleted file mode 100644 index 02173a88a1..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/Startup.cs +++ /dev/null @@ -1,83 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.HttpOverrides; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; - -namespace SimpleApp -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - public void ConfigureServices(IServiceCollection services) - { - services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); - - services.Configure(options => - { - options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto; - }); - - services.AddOpenApiDocument(); - } - - public void Configure(IApplicationBuilder app, IHostingEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseMvc(); - - app.UseForwardedHeaders(new ForwardedHeadersOptions - { - ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto - }); - - app.UseAuthentication(); - app.UseMvc(); - - // There are two ways to run this app: - // 1. Run docker-compose and access http://localhost:8080/externalpath/swagger - // 2. Run Sample.AspNetCore21.Nginx and access http://localhost:59185/swagger/ - // both URLs should be correctly served... - - // Config with automatic proxy header handling (X-Forwarded-Host, X-Forwarded-Proto, X-Forwarded-Prefix, - app.UseOpenApi(); - app.UseSwaggerUi3(); - - // Config with custom proxy headers - //app.UseSwagger(config => - //{ - // config.Path = "/swagger/v1/swagger.json"; - // config.PostProcess = (document, request) => - // { - // if (request.Headers.ContainsKey("X-External-Host")) - // { - // // Change document server settings to public - // document.Host = request.Headers["X-External-Host"].First(); - // document.BasePath = request.Headers["X-External-Path"].First(); - // } - // }; - //}); - //app.UseSwaggerUi3(config => - //{ - // config.SwaggerRoute = "/swagger/v1/swagger.json"; - // config.TransformToExternalPath = (internalUiRoute, request) => - // { - // // The header X-External-Path is set in the nginx.conf file - // var externalPath = request.Headers.ContainsKey("X-External-Path") ? request.Headers["X-External-Path"].First() : ""; - // return externalPath + internalUiRoute; - // }; - //}); - } - } -} diff --git a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/appsettings.Development.json b/samples/WithMiddleware/Sample.AspNetCore21.Nginx/appsettings.Development.json deleted file mode 100644 index e203e9407e..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/appsettings.Development.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/appsettings.json b/samples/WithMiddleware/Sample.AspNetCore21.Nginx/appsettings.json deleted file mode 100644 index def9159a7d..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/appsettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Warning" - } - }, - "AllowedHosts": "*" -} diff --git a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/docker-compose.dcproj b/samples/WithMiddleware/Sample.AspNetCore21.Nginx/docker-compose.dcproj deleted file mode 100644 index 10d5296f7c..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/docker-compose.dcproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 2.1 - Linux - d3520430-6663-47a9-a7d1-ed43f33508bd - LaunchBrowser - {Scheme}://localhost:{ServicePort}/swagger - sampleaspnetcore21nginx - - - - docker-compose.yml - - - - - \ No newline at end of file diff --git a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/docker-compose.override.yml b/samples/WithMiddleware/Sample.AspNetCore21.Nginx/docker-compose.override.yml deleted file mode 100644 index 3c0ce90690..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/docker-compose.override.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: '3.4' - -services: - sampleaspnetcore21nginx: - environment: - - ASPNETCORE_ENVIRONMENT=Development - ports: - - "80" diff --git a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/docker-compose.yml b/samples/WithMiddleware/Sample.AspNetCore21.Nginx/docker-compose.yml deleted file mode 100644 index 3cd40c9e27..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/docker-compose.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: "3.4" -services: - sampleaspnetcore21nginx: - build: - context: . - dockerfile: Dockerfile - ports: - - "80" - reverseproxy: - image: nginx - volumes: - - ./nginx.conf:/etc/nginx/nginx.conf:ro - ports: - - "8080:80" \ No newline at end of file diff --git a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/nginx.conf b/samples/WithMiddleware/Sample.AspNetCore21.Nginx/nginx.conf deleted file mode 100644 index 45a788ebd6..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore21.Nginx/nginx.conf +++ /dev/null @@ -1,30 +0,0 @@ -user nginx; -worker_processes 1; - -error_log /var/log/nginx/error.log warn; -pid /var/run/nginx.pid; - -events { - worker_connections 1024; -} - -http { - server { - listen 80; - listen [::]:80; - location /externalpath { - proxy_pass http://sampleaspnetcore21nginx; - rewrite ^/externalpath(.*)$ $1 break; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection keep-alive; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - proxy_set_header X-Forwarded-Host localhost:8080; - proxy_set_header X-Forwarded-Prefix /externalpath; - } - } -} \ No newline at end of file diff --git a/samples/WithMiddleware/Sample.AspNetCore31.Client/Clients.generated.cs b/samples/WithMiddleware/Sample.AspNetCore31.Client/Clients.generated.cs deleted file mode 100644 index 85a272eef8..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore31.Client/Clients.generated.cs +++ /dev/null @@ -1,341 +0,0 @@ -//---------------------- -// -// Generated using the NSwag toolchain v13.8.2.0 (NJsonSchema v10.2.1.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org) -// -//---------------------- - -#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." -#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." -#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' -#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... -#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." - -namespace Apimundo.Client -{ - using System = global::System; - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.8.2.0 (NJsonSchema v10.2.1.0 (Newtonsoft.Json v12.0.0.0))")] - public partial class WeatherForecastClient - { - private System.Net.Http.HttpClient _httpClient; - private System.Lazy _settings; - - public WeatherForecastClient(System.Net.Http.HttpClient httpClient) - { - _httpClient = httpClient; - _settings = new System.Lazy(CreateSerializerSettings); - } - - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() - { - var settings = new Newtonsoft.Json.JsonSerializerSettings(); - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - - /// A server side error occurred. - public System.Threading.Tasks.Task> GetAsync() - { - return GetAsync(System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("WeatherForecast"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ApiException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - using (var streamReader = new System.IO.StreamReader(responseStream)) - using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) - { - var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings); - var typedBody = serializer.Deserialize(jsonTextReader); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ApiException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return null; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - return System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value.GetType().IsArray) - { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); - } - - var result = System.Convert.ToString(value, cultureInfo); - return (result is null) ? string.Empty : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.2.1.0 (Newtonsoft.Json v12.0.0.0)")] - public partial class WeatherForecast : System.ComponentModel.INotifyPropertyChanged - { - private System.DateTime _date; - private int _temperatureC; - private int _temperatureF; - private string _summary; - - [Newtonsoft.Json.JsonProperty("date", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTime Date - { - get { return _date; } - set - { - if (_date != value) - { - _date = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("temperatureC", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int TemperatureC - { - get { return _temperatureC; } - set - { - if (_temperatureC != value) - { - _temperatureC = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("temperatureF", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int TemperatureF - { - get { return _temperatureF; } - set - { - if (_temperatureF != value) - { - _temperatureF = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("summary", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Summary - { - get { return _summary; } - set - { - if (_summary != value) - { - _summary = value; - RaisePropertyChanged(); - } - } - } - - public string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this); - } - - public static WeatherForecast FromJson(string data) - { - return Newtonsoft.Json.JsonConvert.DeserializeObject(data); - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.8.2.0 (NJsonSchema v10.2.1.0 (Newtonsoft.Json v12.0.0.0))")] - public partial class ApiException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.8.2.0 (NJsonSchema v10.2.1.0 (Newtonsoft.Json v12.0.0.0))")] - public partial class ApiException : ApiException - { - public TResult Result { get; private set; } - - public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - -} - -#pragma warning restore 1591 -#pragma warning restore 1573 -#pragma warning restore 472 -#pragma warning restore 114 -#pragma warning restore 108 \ No newline at end of file diff --git a/samples/WithMiddleware/Sample.AspNetCore31.Client/Sample.AspNetCore31.Client.csproj b/samples/WithMiddleware/Sample.AspNetCore31.Client/Sample.AspNetCore31.Client.csproj deleted file mode 100644 index bf64fad359..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore31.Client/Sample.AspNetCore31.Client.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - netstandard2.0 - - - - - - - diff --git a/samples/WithMiddleware/Sample.AspNetCore31/Controllers/WeatherForecastController.cs b/samples/WithMiddleware/Sample.AspNetCore31/Controllers/WeatherForecastController.cs deleted file mode 100644 index f07c4876f1..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore31/Controllers/WeatherForecastController.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; - -namespace Sample.AspNetCore31.Controllers -{ - [ApiController] - [Route("[controller]")] - public class WeatherForecastController : ControllerBase - { - private static readonly string[] Summaries = new[] - { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; - - private readonly ILogger _logger; - - public WeatherForecastController(ILogger logger) - { - _logger = logger; - } - - [HttpGet] - public IEnumerable Get() - { - var rng = new Random(); - return Enumerable.Range(1, 5).Select(index => new WeatherForecast - { - Date = DateTime.Now.AddDays(index), - TemperatureC = rng.Next(-20, 55), - Summary = Summaries[rng.Next(Summaries.Length)] - }) - .ToArray(); - } - } -} diff --git a/samples/WithMiddleware/Sample.AspNetCore31/Program.cs b/samples/WithMiddleware/Sample.AspNetCore31/Program.cs deleted file mode 100644 index 9f46a21227..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore31/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Hosting; - -namespace Sample.AspNetCore31 -{ - public class Program - { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - } -} diff --git a/samples/WithMiddleware/Sample.AspNetCore31/Properties/launchSettings.json b/samples/WithMiddleware/Sample.AspNetCore31/Properties/launchSettings.json deleted file mode 100644 index a0b847d1eb..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore31/Properties/launchSettings.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:37239", - "sslPort": 44305 - } - }, - "$schema": "http://json.schemastore.org/launchsettings.json", - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Sample.AspNetCore31": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:5001;http://localhost:5000" - } - } -} \ No newline at end of file diff --git a/samples/WithMiddleware/Sample.AspNetCore31/README.md b/samples/WithMiddleware/Sample.AspNetCore31/README.md deleted file mode 100644 index 279042761a..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore31/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Features in this sample: - -- Expose swagger.json and Swagger UI 3 via HTTP (middleware) - - See Startup.cs - - Packages in Sample.AspNetCore31.csproj -- Automatically generate a C# client library on build (Sample.AspNetCore31.Client) - - Add NSwag.MSBuild in Sample.AspNetCore31.csproj and - - Add a build task in the .csproj - - Output is in the Sample.AspNetCore31.Client library project \ No newline at end of file diff --git a/samples/WithMiddleware/Sample.AspNetCore31/Sample.AspNetCore31.csproj b/samples/WithMiddleware/Sample.AspNetCore31/Sample.AspNetCore31.csproj deleted file mode 100644 index 9c4029d3e0..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore31/Sample.AspNetCore31.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - netcoreapp3.1 - - - - - - - runtime; build; native; contentfiles; analyzers - all - - - - - - - - diff --git a/samples/WithMiddleware/Sample.AspNetCore31/Startup.cs b/samples/WithMiddleware/Sample.AspNetCore31/Startup.cs deleted file mode 100644 index 615ae41075..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore31/Startup.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; - -namespace Sample.AspNetCore31 -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - public void ConfigureServices(IServiceCollection services) - { - services.AddControllers(); - - //## NSwag - services.AddOpenApiDocument(d => d.Title = "My Sample App"); - } - - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseHttpsRedirection(); - - //## NSwag - app.UseOpenApi(); - app.UseSwaggerUi3(); - - app.UseRouting(); - app.UseAuthorization(); - app.UseEndpoints(endpoints => - { - endpoints.MapControllers(); - }); - } - } -} diff --git a/samples/WithMiddleware/Sample.AspNetCore31/WeatherForecast.cs b/samples/WithMiddleware/Sample.AspNetCore31/WeatherForecast.cs deleted file mode 100644 index 387adf731b..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore31/WeatherForecast.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Sample.AspNetCore31 -{ - public class WeatherForecast - { - public DateTime Date { get; set; } - - public int TemperatureC { get; set; } - - public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); - - public string Summary { get; set; } - } -} diff --git a/samples/WithMiddleware/Sample.AspNetCore31/appsettings.Development.json b/samples/WithMiddleware/Sample.AspNetCore31/appsettings.Development.json deleted file mode 100644 index 8983e0fc1c..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore31/appsettings.Development.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - } -} diff --git a/samples/WithMiddleware/Sample.AspNetCore31/appsettings.json b/samples/WithMiddleware/Sample.AspNetCore31/appsettings.json deleted file mode 100644 index d9d9a9bff6..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore31/appsettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "AllowedHosts": "*" -} diff --git a/samples/WithMiddleware/Sample.AspNetCore31/nswag.json b/samples/WithMiddleware/Sample.AspNetCore31/nswag.json deleted file mode 100644 index 0867fceae0..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore31/nswag.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "runtime": "NetCore31", - "defaultVariables": "Configuration=Debug", - "documentGenerator": { - "aspNetCoreToOpenApi": { - "project": "Sample.AspNetCore31.csproj", - "msBuildProjectExtensionsPath": null, - "configuration": "$(Configuration)", - "runtime": null, - "targetFramework": null, - "noBuild": true, - "verbose": true, - "workingDirectory": ".", - "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, - "useDocumentProvider": true, - "documentName": "v1", - "aspNetCoreEnvironment": "Development", - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": true, - "output": "openapi.json", - "outputType": "OpenApi3", - "assemblyPaths": [], - "assemblyConfig": null, - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": { - "openApiToCSharpClient": { - "clientBaseClass": null, - "configurationClass": null, - "generateClientClasses": true, - "generateClientInterfaces": false, - "injectHttpClient": true, - "disposeHttpClient": true, - "protectedMethods": [], - "generateExceptionClasses": true, - "exceptionClass": "ApiException", - "wrapDtoExceptions": true, - "useHttpClientCreationMethod": false, - "httpClientType": "System.Net.Http.HttpClient", - "useHttpRequestMessageCreationMethod": false, - "useBaseUrl": false, - "generateBaseUrlProperty": true, - "generateSyncMethods": false, - "exposeJsonSerializerSettings": false, - "clientClassAccessModifier": "public", - "typeAccessModifier": "public", - "generateContractsOutput": false, - "contractsNamespace": null, - "contractsOutputFilePath": null, - "parameterDateTimeFormat": "s", - "generateUpdateJsonSerializerSettingsMethod": true, - "serializeTypeInformation": false, - "queryNullValue": "", - "className": "{controller}Client", - "operationGenerationMode": "MultipleClientsFromOperationId", - "additionalNamespaceUsages": [], - "additionalContractNamespaceUsages": [], - "generateOptionalParameters": false, - "generateJsonMethods": true, - "enforceFlagEnums": false, - "parameterArrayType": "System.Collections.Generic.IEnumerable", - "parameterDictionaryType": "System.Collections.Generic.IDictionary", - "responseArrayType": "System.Collections.ObjectModel.ObservableCollection", - "responseDictionaryType": "System.Collections.Generic.Dictionary", - "wrapResponses": false, - "wrapResponseMethods": [], - "generateResponseClasses": true, - "responseClass": "SwaggerResponse", - "namespace": "Apimundo.Client", - "requiredPropertiesMustBeDefined": true, - "dateType": "System.DateTime", - "jsonConverters": null, - "anyType": "object", - "dateTimeType": "System.DateTime", - "timeType": "System.TimeSpan", - "timeSpanType": "System.TimeSpan", - "arrayType": "System.Collections.ObjectModel.ObservableCollection", - "arrayInstanceType": null, - "dictionaryType": "System.Collections.Generic.Dictionary", - "dictionaryInstanceType": null, - "arrayBaseType": "System.Collections.ObjectModel.ObservableCollection", - "dictionaryBaseType": "System.Collections.Generic.Dictionary", - "classStyle": "Inpc", - "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, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../Sample.AspNetCore31.Client/Clients.generated.cs" - } - } -} \ No newline at end of file diff --git a/samples/WithMiddleware/Sample.AspNetCore31/openapi.json b/samples/WithMiddleware/Sample.AspNetCore31/openapi.json deleted file mode 100644 index f69c7ca45d..0000000000 --- a/samples/WithMiddleware/Sample.AspNetCore31/openapi.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "x-generator": "NSwag v13.8.2.0 (NJsonSchema v10.2.1.0 (Newtonsoft.Json v9.0.0.0))", - "openapi": "3.0.0", - "info": { - "title": "My Sample App", - "version": "1.0.0" - }, - "paths": { - "/WeatherForecast": { - "get": { - "tags": [ - "WeatherForecast" - ], - "operationId": "WeatherForecast_Get", - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/WeatherForecast" - } - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "WeatherForecast": { - "type": "object", - "additionalProperties": false, - "properties": { - "date": { - "type": "string", - "format": "date-time" - }, - "temperatureC": { - "type": "integer", - "format": "int32" - }, - "temperatureF": { - "type": "integer", - "format": "int32" - }, - "summary": { - "type": "string", - "nullable": true - } - } - } - } - } -} \ No newline at end of file diff --git a/samples/WithMiddleware/Sample.NetOwinMiddleware/Controllers/ProductsController.cs b/samples/WithMiddleware/Sample.NetOwinMiddleware/Controllers/ProductsController.cs deleted file mode 100644 index cd64063c92..0000000000 --- a/samples/WithMiddleware/Sample.NetOwinMiddleware/Controllers/ProductsController.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Web.Http; -using NSwag.Sample.NetOwinMiddleware.Models; - -namespace NSwag.Sample.NetOwinMiddleware.Controllers -{ - public class ProductsController : ApiController - { - Product[] products = new Product[] - { - new Product { Id = 1, Name = "Tomato Soup", Category = "Groceries", Price = 1 }, - new Product { Id = 2, Name = "Yo-yo", Category = "Toys", Price = 3.75M }, - new Product { Id = 3, Name = "Hammer", Category = "Hardware", Price = 16.99M } - }; - - public IEnumerable GetAllProducts() - { - return products; - } - - public IHttpActionResult GetProduct(int id) - { - var product = products.FirstOrDefault((p) => p.Id == id); - if (product == null) - { - return NotFound(); - } - return Ok(product); - } - } -} diff --git a/samples/WithMiddleware/Sample.NetOwinMiddleware/Models/Product.cs b/samples/WithMiddleware/Sample.NetOwinMiddleware/Models/Product.cs deleted file mode 100644 index 4a44e09caf..0000000000 --- a/samples/WithMiddleware/Sample.NetOwinMiddleware/Models/Product.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace NSwag.Sample.NetOwinMiddleware.Models -{ - public class Product - { - public int Id { get; set; } - public string Name { get; set; } - public string Category { get; set; } - public decimal Price { get; set; } - } -} \ No newline at end of file diff --git a/samples/WithMiddleware/Sample.NetOwinMiddleware/Properties/AssemblyInfo.cs b/samples/WithMiddleware/Sample.NetOwinMiddleware/Properties/AssemblyInfo.cs deleted file mode 100644 index eb5ef562cb..0000000000 --- a/samples/WithMiddleware/Sample.NetOwinMiddleware/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NSwag.Sample.NetOwinMiddleware")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NSwag.Sample.NetOwinMiddleware")] -[assembly: AssemblyCopyright("Copyright © 2019")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("f8839807-b6f6-41e3-bc98-dfad3c03085e")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/samples/WithMiddleware/Sample.NetOwinMiddleware/Sample.NetOwinMiddleware.csproj b/samples/WithMiddleware/Sample.NetOwinMiddleware/Sample.NetOwinMiddleware.csproj deleted file mode 100644 index e51e0b3bfb..0000000000 --- a/samples/WithMiddleware/Sample.NetOwinMiddleware/Sample.NetOwinMiddleware.csproj +++ /dev/null @@ -1,182 +0,0 @@ - - - - - Debug - AnyCPU - - - 2.0 - {F8839807-B6F6-41E3-BC98-DFAD3C03085E} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - NSwag.Sample.NetOwinMiddleware - NSwag.Sample.NetOwinMiddleware - v4.7.2 - true - - - - - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - true - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - - ..\..\packages\Microsoft.Owin.4.0.1\lib\net45\Microsoft.Owin.dll - - - ..\..\packages\Microsoft.Owin.FileSystems.3.0.1\lib\net45\Microsoft.Owin.FileSystems.dll - - - ..\..\packages\Microsoft.Owin.Host.SystemWeb.4.0.1\lib\net45\Microsoft.Owin.Host.SystemWeb.dll - - - ..\..\packages\Microsoft.Owin.StaticFiles.3.0.1\lib\net45\Microsoft.Owin.StaticFiles.dll - - - ..\..\packages\Namotion.Reflection.2.0.3\lib\net45\Namotion.Reflection.dll - - - ..\..\packages\NJsonSchema.10.5.2\lib\net45\NJsonSchema.dll - - - ..\..\packages\NSwag.AspNet.Owin.13.14.5\lib\net45\NSwag.AspNet.Owin.dll - - - ..\..\packages\NSwag.Core.13.14.5\lib\net45\NSwag.Core.dll - - - ..\..\packages\NSwag.Generation.13.14.5\lib\net45\NSwag.Generation.dll - True - - - ..\..\packages\NSwag.Generation.WebApi.13.14.5\lib\net45\NSwag.Generation.WebApi.dll - True - - - ..\..\packages\Owin.1.0\lib\net40\Owin.dll - - - - - ..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll - - - - - - - - - - - - - ..\..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll - - - ..\..\packages\Microsoft.AspNet.WebApi.Owin.5.2.7\lib\net45\System.Web.Http.Owin.dll - - - - - - - - - - - - ..\..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.4\lib\net45\System.Web.Http.WebHost.dll - - - ..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll - - - - - - - - - - - - - - - Web.config - - - Web.config - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - True - True - 52772 - / - http://localhost:52772/ - False - False - - - False - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - \ No newline at end of file diff --git a/samples/WithMiddleware/Sample.NetOwinMiddleware/Startup.cs b/samples/WithMiddleware/Sample.NetOwinMiddleware/Startup.cs deleted file mode 100644 index e26c3999a8..0000000000 --- a/samples/WithMiddleware/Sample.NetOwinMiddleware/Startup.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Web.Http; -using Microsoft.Owin; -using NSwag.AspNet.Owin; -using Owin; - -[assembly: OwinStartup(typeof(NSwag.Sample.NetOwinMiddleware.Startup))] - -namespace NSwag.Sample.NetOwinMiddleware -{ - public class Startup - { - public void Configuration(IAppBuilder app) - { - // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=316888 - var config = new HttpConfiguration(); - - app.UseSwaggerUi3(typeof(Startup).Assembly, settings => - { - // configure settings here - // settings.GeneratorSettings.*: Generator settings and extension points - // settings.*: Routing and UI settings - settings.GeneratorSettings.DefaultUrlTemplate = "api/{controller}/{id?}"; - }); - app.UseWebApi(config); - - config.MapHttpAttributeRoutes(); - config.Routes.MapHttpRoute( - name: "DefaultApi", - routeTemplate: "api/{controller}/{id}", - defaults: new { id = RouteParameter.Optional } - ); - config.EnsureInitialized(); - } - } -} diff --git a/samples/WithMiddleware/Sample.NetOwinMiddleware/Web.Debug.config b/samples/WithMiddleware/Sample.NetOwinMiddleware/Web.Debug.config deleted file mode 100644 index fae9cfefa9..0000000000 --- a/samples/WithMiddleware/Sample.NetOwinMiddleware/Web.Debug.config +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/samples/WithMiddleware/Sample.NetOwinMiddleware/Web.Release.config b/samples/WithMiddleware/Sample.NetOwinMiddleware/Web.Release.config deleted file mode 100644 index da6e960b8d..0000000000 --- a/samples/WithMiddleware/Sample.NetOwinMiddleware/Web.Release.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/samples/WithMiddleware/Sample.NetOwinMiddleware/Web.config b/samples/WithMiddleware/Sample.NetOwinMiddleware/Web.config deleted file mode 100644 index 05521b86d9..0000000000 --- a/samples/WithMiddleware/Sample.NetOwinMiddleware/Web.config +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/WithMiddleware/Sample.NetOwinMiddleware/packages.config b/samples/WithMiddleware/Sample.NetOwinMiddleware/packages.config deleted file mode 100644 index a90c8ef287..0000000000 --- a/samples/WithMiddleware/Sample.NetOwinMiddleware/packages.config +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/WithoutMiddleware/Sample.AspNetCore21/Controllers/ValuesController.cs b/samples/WithoutMiddleware/Sample.AspNetCore21/Controllers/ValuesController.cs deleted file mode 100644 index 4cef5dfe7c..0000000000 --- a/samples/WithoutMiddleware/Sample.AspNetCore21/Controllers/ValuesController.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace Sample.AspNetCore21.Controllers -{ - [Route("api/[controller]")] - [ApiController] - public class ValuesController : ControllerBase - { - // GET api/values - [HttpGet] - public ActionResult> Get() - { - return new string[] { "value1", "value2" }; - } - - // GET api/values/5 - [HttpGet("{id}")] - public ActionResult Get(int id) - { - return "value"; - } - - // POST api/values - [HttpPost] - public void Post([FromBody] string value) - { - } - - // PUT api/values/5 - [HttpPut("{id}")] - public void Put(int id, [FromBody] string value) - { - } - - // DELETE api/values/5 - [HttpDelete("{id}")] - public void Delete(int id) - { - } - } -} diff --git a/samples/WithoutMiddleware/Sample.AspNetCore21/Program.cs b/samples/WithoutMiddleware/Sample.AspNetCore21/Program.cs deleted file mode 100644 index 8593b51402..0000000000 --- a/samples/WithoutMiddleware/Sample.AspNetCore21/Program.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging; - -namespace Sample.AspNetCore21 -{ - public class Program - { - public static void Main(string[] args) - { - CreateWebHostBuilder(args).Build().Run(); - } - - public static IWebHostBuilder CreateWebHostBuilder(string[] args) => - WebHost.CreateDefaultBuilder(args) - .UseStartup(); - } -} diff --git a/samples/WithoutMiddleware/Sample.AspNetCore21/Properties/launchSettings.json b/samples/WithoutMiddleware/Sample.AspNetCore21/Properties/launchSettings.json deleted file mode 100644 index 1a2a902b5b..0000000000 --- a/samples/WithoutMiddleware/Sample.AspNetCore21/Properties/launchSettings.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:47554", - "sslPort": 44395 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "api/values", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Sample.AspNetCore21": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "api/values", - "applicationUrl": "https://localhost:5001;http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/samples/WithoutMiddleware/Sample.AspNetCore21/Sample.AspNetCore21.csproj b/samples/WithoutMiddleware/Sample.AspNetCore21/Sample.AspNetCore21.csproj deleted file mode 100644 index 2767460a3e..0000000000 --- a/samples/WithoutMiddleware/Sample.AspNetCore21/Sample.AspNetCore21.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - netcoreapp2.1 - - - - - - - - - - - - - - diff --git a/samples/WithoutMiddleware/Sample.AspNetCore21/Startup.cs b/samples/WithoutMiddleware/Sample.AspNetCore21/Startup.cs deleted file mode 100644 index 0020aacda3..0000000000 --- a/samples/WithoutMiddleware/Sample.AspNetCore21/Startup.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.HttpsPolicy; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; - -namespace Sample.AspNetCore21 -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - else - { - app.UseHsts(); - } - - app.UseHttpsRedirection(); - app.UseMvc(); - } - } -} diff --git a/samples/WithoutMiddleware/Sample.AspNetCore21/appsettings.Development.json b/samples/WithoutMiddleware/Sample.AspNetCore21/appsettings.Development.json deleted file mode 100644 index e203e9407e..0000000000 --- a/samples/WithoutMiddleware/Sample.AspNetCore21/appsettings.Development.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/samples/WithoutMiddleware/Sample.AspNetCore21/appsettings.json b/samples/WithoutMiddleware/Sample.AspNetCore21/appsettings.json deleted file mode 100644 index def9159a7d..0000000000 --- a/samples/WithoutMiddleware/Sample.AspNetCore21/appsettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Warning" - } - }, - "AllowedHosts": "*" -} diff --git a/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_assembly.nswag b/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_assembly.nswag deleted file mode 100644 index 0ffecb6bab..0000000000 --- a/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_assembly.nswag +++ /dev/null @@ -1,59 +0,0 @@ -{ - "runtime": "Default", - "defaultVariables": "configuration=Debug", - "documentGenerator": { - "aspNetCoreToOpenApi": { - "project": null, - "msBuildProjectExtensionsPath": null, - "configuration": null, - "runtime": null, - "targetFramework": null, - "noBuild": false, - "verbose": false, - "workingDirectory": null, - "requireParametersWithoutDefault": true, - "apiGroupNames": null, - "defaultPropertyNameHandling": "Default", - "defaultReferenceTypeNullHandling": "Null", - "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, - "useDocumentProvider": false, - "documentName": "v1", - "aspNetCoreEnvironment": null, - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": true, - "output": "nswag_assembly_swagger.json", - "outputType": "Swagger2", - "assemblyPaths": [ - "bin/$(configuration)/netcoreapp2.1/Sample.AspNetCore21.dll" - ], - "assemblyConfig": null, - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": {} -} \ No newline at end of file diff --git a/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_assembly_swagger.json b/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_assembly_swagger.json deleted file mode 100644 index 4a2cb002c9..0000000000 --- a/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_assembly_swagger.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "x-generator": "NSwag v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))", - "swagger": "2.0", - "info": { - "title": "My Title", - "version": "1.0.0" - }, - "paths": { - "/api/Values": { - "get": { - "tags": [ - "Values" - ], - "operationId": "Values_GetAll", - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "post": { - "tags": [ - "Values" - ], - "operationId": "Values_Post", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "parameters": [ - { - "name": "value", - "in": "body", - "required": true, - "schema": { - "type": "string" - }, - "x-nullable": false - } - ], - "responses": { - "200": { - "description": "" - } - } - } - }, - "/api/Values/{id}": { - "get": { - "tags": [ - "Values" - ], - "operationId": "Values_Get", - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "type": "string" - } - } - } - }, - "put": { - "tags": [ - "Values" - ], - "operationId": "Values_Put", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "name": "value", - "in": "body", - "required": true, - "schema": { - "type": "string" - }, - "x-nullable": false - } - ], - "responses": { - "200": { - "description": "" - } - } - }, - "delete": { - "tags": [ - "Values" - ], - "operationId": "Values_Delete", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "200": { - "description": "" - } - } - } - } - } -} \ No newline at end of file diff --git a/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_project.nswag b/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_project.nswag deleted file mode 100644 index 99f950fe0b..0000000000 --- a/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_project.nswag +++ /dev/null @@ -1,57 +0,0 @@ -{ - "runtime": "NetCore21", - "defaultVariables": "configuration=Debug", - "documentGenerator": { - "aspNetCoreToOpenApi": { - "project": "Sample.AspNetCore21.csproj", - "msBuildProjectExtensionsPath": null, - "configuration": "$(configuration)", - "runtime": null, - "targetFramework": null, - "noBuild": false, - "verbose": false, - "workingDirectory": null, - "requireParametersWithoutDefault": true, - "apiGroupNames": null, - "defaultPropertyNameHandling": "Default", - "defaultReferenceTypeNullHandling": "Null", - "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, - "useDocumentProvider": false, - "documentName": "v1", - "aspNetCoreEnvironment": null, - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": true, - "output": "nswag_project_swagger.json", - "outputType": "Swagger2", - "assemblyPaths": [], - "assemblyConfig": null, - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": {} -} \ No newline at end of file diff --git a/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_project_swagger.json b/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_project_swagger.json deleted file mode 100644 index 4a2cb002c9..0000000000 --- a/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_project_swagger.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "x-generator": "NSwag v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))", - "swagger": "2.0", - "info": { - "title": "My Title", - "version": "1.0.0" - }, - "paths": { - "/api/Values": { - "get": { - "tags": [ - "Values" - ], - "operationId": "Values_GetAll", - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "post": { - "tags": [ - "Values" - ], - "operationId": "Values_Post", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "parameters": [ - { - "name": "value", - "in": "body", - "required": true, - "schema": { - "type": "string" - }, - "x-nullable": false - } - ], - "responses": { - "200": { - "description": "" - } - } - } - }, - "/api/Values/{id}": { - "get": { - "tags": [ - "Values" - ], - "operationId": "Values_Get", - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "type": "string" - } - } - } - }, - "put": { - "tags": [ - "Values" - ], - "operationId": "Values_Put", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "name": "value", - "in": "body", - "required": true, - "schema": { - "type": "string" - }, - "x-nullable": false - } - ], - "responses": { - "200": { - "description": "" - } - } - }, - "delete": { - "tags": [ - "Values" - ], - "operationId": "Values_Delete", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "200": { - "description": "" - } - } - } - } - } -} \ No newline at end of file diff --git a/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_reflection.nswag b/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_reflection.nswag deleted file mode 100644 index 1f39a63f70..0000000000 --- a/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_reflection.nswag +++ /dev/null @@ -1,55 +0,0 @@ -{ - "runtime": "Default", - "defaultVariables": "configuration=Debug", - "documentGenerator": { - "webApiToOpenApi": { - "controllerNames": [], - "isAspNetCore": true, - "resolveJsonOptions": false, - "defaultUrlTemplate": "api/{controller}/{id?}", - "addMissingPathParameters": false, - "includedVersions": null, - "defaultPropertyNameHandling": "Default", - "defaultReferenceTypeNullHandling": "Null", - "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, - "useDocumentProvider": true, - "documentName": "v1", - "aspNetCoreEnvironment": null, - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": true, - "output": "nswag_reflection_swagger.json", - "outputType": "Swagger2", - "assemblyPaths": [ - "bin/$(configuration)/netcoreapp2.1/Sample.AspNetCore21.dll" - ], - "assemblyConfig": null, - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": {} -} \ No newline at end of file diff --git a/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_reflection_swagger.json b/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_reflection_swagger.json deleted file mode 100644 index aba26111e5..0000000000 --- a/samples/WithoutMiddleware/Sample.AspNetCore21/nswag_reflection_swagger.json +++ /dev/null @@ -1,134 +0,0 @@ -{ - "x-generator": "NSwag v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))", - "swagger": "2.0", - "info": { - "title": "My Title", - "version": "1.0.0" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/api/Values": { - "get": { - "tags": [ - "Values" - ], - "operationId": "Values_GetAll", - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "post": { - "tags": [ - "Values" - ], - "operationId": "Values_Post", - "parameters": [ - { - "name": "value", - "in": "body", - "schema": { - "type": "string" - }, - "x-nullable": true - } - ], - "responses": { - "200": { - "description": "" - } - } - } - }, - "/api/Values/{id}": { - "get": { - "tags": [ - "Values" - ], - "operationId": "Values_Get", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "string" - } - } - } - }, - "put": { - "tags": [ - "Values" - ], - "operationId": "Values_Put", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "name": "value", - "in": "body", - "schema": { - "type": "string" - }, - "x-nullable": true - } - ], - "responses": { - "200": { - "description": "" - } - } - }, - "delete": { - "tags": [ - "Values" - ], - "operationId": "Values_Delete", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "200": { - "description": "" - } - } - } - } - } -} \ No newline at end of file diff --git a/samples/run.ps1 b/samples/run.ps1 deleted file mode 100644 index 1626fc8057..0000000000 --- a/samples/run.ps1 +++ /dev/null @@ -1,47 +0,0 @@ -$configuration = $args[0] -$cliPath = "$PSScriptRoot/../src/NSwagStudio/bin/$configuration" -$samplesPath = "$PSScriptRoot/../samples" - -function NSwagRun([string]$projectDirectory, [string]$configurationFile, [string]$runtime, [string]$configuration, [string]$build) -{ - $nswagConfigurationFile = [IO.Path]::GetFullPath("$projectDirectory/$configurationFile.nswag") - $nswagSwaggerFile = [IO.Path]::GetFullPath("$projectDirectory/$($configurationFile)_swagger.json") - - if (Test-Path "$nswagSwaggerFile") - { - Remove-Item $nswagSwaggerFile - } - - if ($build -eq "true") - { - dotnet build "$projectDirectory" -c $configuration - } - else - { - dotnet restore "$projectDirectory" - } - - dotnet "$cliPath/$runtime/dotnet-nswag.dll" run "$nswagConfigurationFile" /variables:configuration=$configuration - - if (!(Test-Path "$nswagSwaggerFile")) - { - throw "Output ($($configurationFile)_swagger.json) not generated for $nswagConfigurationFile." - } -} - -# WithoutMiddleware/Sample.AspNetCore20 -# NSwagRun "$samplesPath/WithoutMiddleware/Sample.AspNetCore20" "nswag_project" "NetCore21" "Release" false -# NSwagRun "$samplesPath/WithoutMiddleware/Sample.AspNetCore20" "nswag_assembly" "NetCore21" "Release" true - -# NSwagRun "$samplesPath/WithoutMiddleware/Sample.AspNetCore20" "nswag_project" "NetCore21" "Debug" false -# NSwagRun "$samplesPath/WithoutMiddleware/Sample.AspNetCore20" "nswag_assembly" "NetCore21" "Debug" true - -# WithoutMiddleware/Sample.AspNetCore21 -NSwagRun "$samplesPath/WithoutMiddleware/Sample.AspNetCore21" "nswag_assembly" "NetCore21" "Release" true -NSwagRun "$samplesPath/WithoutMiddleware/Sample.AspNetCore21" "nswag_project" "NetCore21" "Release" false -NSwagRun "$samplesPath/WithoutMiddleware/Sample.AspNetCore21" "nswag_reflection" "NetCore21" "Release" true - -NSwagRun "$samplesPath/WithoutMiddleware/Sample.AspNetCore21" "nswag_assembly" "NetCore21" "Debug" true -NSwagRun "$samplesPath/WithoutMiddleware/Sample.AspNetCore21" "nswag_project" "NetCore21" "Debug" false -NSwagRun "$samplesPath/WithoutMiddleware/Sample.AspNetCore21" "nswag_reflection" "NetCore21" "Debug" true - diff --git a/src/Directory.Build.props b/src/Directory.Build.props index ccf857d2f3..47e547ec47 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,6 +1,6 @@ - 13.20.0 + 14.0.0 Rico Suter Copyright © Rico Suter, 2023 diff --git a/src/IntegrationTests.md b/src/IntegrationTests.md deleted file mode 100644 index fdfa152245..0000000000 --- a/src/IntegrationTests.md +++ /dev/null @@ -1,9 +0,0 @@ -# Integration Tests - -How to run the integration tests: - -1. Build solution in debug mode -2. Run "src\NSwag.Integration.WebAPI\build.bat" to generate clients -3. Check outputs in Git diff, manually check for problems -4. Run client unit tests -5. Run Web API project and integration unit tests \ No newline at end of file diff --git a/src/NSwag.Annotations/NSwag.Annotations.csproj b/src/NSwag.Annotations/NSwag.Annotations.csproj index 460c52189d..09b9c81c4b 100644 --- a/src/NSwag.Annotations/NSwag.Annotations.csproj +++ b/src/NSwag.Annotations/NSwag.Annotations.csproj @@ -1,11 +1,13 @@  - netstandard1.0;net45;netstandard2.0 + netstandard2.0;net462 + bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml - + + \ 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 e95c616469..1e4bb9fd77 100644 --- a/src/NSwag.ApiDescription.Client/NSwag.ApiDescription.Client.targets +++ b/src/NSwag.ApiDescription.Client/NSwag.ApiDescription.Client.targets @@ -4,8 +4,6 @@ <_NSwagCommand>$(NSwagExe) <_NSwagCommand Condition="'$(MSBuildRuntimeType)' == 'Core'">dotnet --roll-forward-on-no-candidate-fx 2 "$(NSwagDir_Core31)/dotnet-nswag.dll" - <_NSwagCommand - Condition="'$(TargetFramework)' == 'net5.0'">dotnet --roll-forward-on-no-candidate-fx 2 "$(NSwagDir_Net50)/dotnet-nswag.dll" <_NSwagCommand Condition="'$(TargetFramework)' == 'net6.0'">dotnet --roll-forward-on-no-candidate-fx 2 "$(NSwagDir_Net60)/dotnet-nswag.dll" <_NSwagCommand diff --git a/src/NSwag.AspNet.Owin/Middlewares/OpenApiDocumentMiddleware.cs b/src/NSwag.AspNet.Owin/Middlewares/OpenApiDocumentMiddleware.cs index 317f9975d6..400b5cd062 100644 --- a/src/NSwag.AspNet.Owin/Middlewares/OpenApiDocumentMiddleware.cs +++ b/src/NSwag.AspNet.Owin/Middlewares/OpenApiDocumentMiddleware.cs @@ -93,7 +93,7 @@ protected virtual async Task GetDocumentAsync(IOwinContext context) /// The Swagger specification. protected virtual async Task GenerateDocumentAsync(IOwinContext context) { - var settings = _settings.CreateGeneratorSettings(null, null); + var settings = _settings.CreateGeneratorSettings(null); var generator = new WebApiOpenApiDocumentGenerator(settings); var document = await generator.GenerateForControllersAsync(_controllerTypes); diff --git a/src/NSwag.AspNet.Owin/NSwag.AspNet.Owin.csproj b/src/NSwag.AspNet.Owin/NSwag.AspNet.Owin.csproj index 01b044f785..62b85be6f7 100644 --- a/src/NSwag.AspNet.Owin/NSwag.AspNet.Owin.csproj +++ b/src/NSwag.AspNet.Owin/NSwag.AspNet.Owin.csproj @@ -1,10 +1,12 @@  - net45 + net462 + bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + @@ -17,12 +19,15 @@ - - TRACE;DEBUG;AspNetOwin;NET45 + + + TRACE;DEBUG;AspNetOwin - - TRACE;RELEASE;AspNetOwin;NET45 + + + TRACE;RELEASE;AspNetOwin + @@ -32,11 +37,14 @@ + + + diff --git a/src/NSwag.AspNet.WebApi/JsonExceptionFilterAttribute.cs b/src/NSwag.AspNet.WebApi/JsonExceptionFilterAttribute.cs index 355130e3f4..dee6534b24 100644 --- a/src/NSwag.AspNet.WebApi/JsonExceptionFilterAttribute.cs +++ b/src/NSwag.AspNet.WebApi/JsonExceptionFilterAttribute.cs @@ -16,7 +16,7 @@ using System.Web.Http.Controllers; using System.Web.Http.Filters; using Newtonsoft.Json; -using NJsonSchema.Converters; +using NJsonSchema.NewtonsoftJson.Converters; using NSwag.Annotations; namespace NSwag.AspNet.WebApi diff --git a/src/NSwag.AspNet.WebApi/NSwag.AspNet.WebApi.csproj b/src/NSwag.AspNet.WebApi/NSwag.AspNet.WebApi.csproj index 0b65528421..8c432c794f 100644 --- a/src/NSwag.AspNet.WebApi/NSwag.AspNet.WebApi.csproj +++ b/src/NSwag.AspNet.WebApi/NSwag.AspNet.WebApi.csproj @@ -1,18 +1,19 @@  - net45 + net462 + bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml - - TRACE;DEBUG;NET45 - + - + + + diff --git a/src/NSwag.AspNetCore.Launcher.x86/NSwag.AspNetCore.Launcher.x86.csproj b/src/NSwag.AspNetCore.Launcher.x86/NSwag.AspNetCore.Launcher.x86.csproj index bfe33ec8e8..2909459193 100644 --- a/src/NSwag.AspNetCore.Launcher.x86/NSwag.AspNetCore.Launcher.x86.csproj +++ b/src/NSwag.AspNetCore.Launcher.x86/NSwag.AspNetCore.Launcher.x86.csproj @@ -1,6 +1,6 @@  - net461 + net462 x86 Exe false diff --git a/src/NSwag.AspNetCore.Launcher/NSwag.AspNetCore.Launcher.csproj b/src/NSwag.AspNetCore.Launcher/NSwag.AspNetCore.Launcher.csproj index b744ad5f09..6e35fa8d45 100644 --- a/src/NSwag.AspNetCore.Launcher/NSwag.AspNetCore.Launcher.csproj +++ b/src/NSwag.AspNetCore.Launcher/NSwag.AspNetCore.Launcher.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net461 - x64 + netcoreapp3.1;net462 + x64 Exe false diff --git a/src/NSwag.AspNetCore/Extensions/NSwagServiceCollectionExtensions.cs b/src/NSwag.AspNetCore/Extensions/NSwagServiceCollectionExtensions.cs index e256dee86d..ad24ae96b8 100644 --- a/src/NSwag.AspNetCore/Extensions/NSwagServiceCollectionExtensions.cs +++ b/src/NSwag.AspNetCore/Extensions/NSwagServiceCollectionExtensions.cs @@ -13,6 +13,8 @@ using Microsoft.Extensions.ApiDescriptions; using Microsoft.Extensions.Options; using NJsonSchema; +using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.AspNetCore; using NSwag.Generation; using NSwag.Generation.AspNetCore; @@ -41,7 +43,7 @@ public static IServiceCollection AddOpenApiDocument(this IServiceCollection serv { return AddSwaggerDocument(serviceCollection, (settings, services) => { - settings.SchemaType = SchemaType.OpenApi3; + settings.SchemaSettings.SchemaType = SchemaType.OpenApi3; configure?.Invoke(settings, services); }); } @@ -64,10 +66,28 @@ public static IServiceCollection AddSwaggerDocument(this IServiceCollection serv { serviceCollection.AddSingleton(services => { - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + + var mvcOptions = services.GetRequiredService>(); + var newtonsoftSettings = AspNetCoreOpenApiDocumentGenerator.GetJsonSerializerSettings(services); + var systemTextJsonOptions = mvcOptions.Value.OutputFormatters + .Any(f => f.GetType().Name == "SystemTextJsonOutputFormatter") ? + AspNetCoreOpenApiDocumentGenerator.GetSystemTextJsonSettings(services) : null; + + if (systemTextJsonOptions != null) + { + settings.ApplySettings(new SystemTextJsonSchemaGeneratorSettings { SerializerOptions = systemTextJsonOptions }, mvcOptions.Value); + } + else if (newtonsoftSettings != null) { - SchemaType = SchemaType.Swagger2, - }; + settings.ApplySettings(new NewtonsoftJsonSchemaGeneratorSettings { SerializerSettings = newtonsoftSettings }, mvcOptions.Value); + } + else + { + settings.ApplySettings(new SystemTextJsonSchemaGeneratorSettings(), mvcOptions.Value); + } + + settings.SchemaSettings.SchemaType = SchemaType.Swagger2; configure?.Invoke(settings, services); diff --git a/src/NSwag.AspNetCore/JsonExceptionFilterAttribute.cs b/src/NSwag.AspNetCore/JsonExceptionFilterAttribute.cs index 78fcf9e3f0..27ac4355ca 100644 --- a/src/NSwag.AspNetCore/JsonExceptionFilterAttribute.cs +++ b/src/NSwag.AspNetCore/JsonExceptionFilterAttribute.cs @@ -15,6 +15,7 @@ using Microsoft.AspNetCore.Mvc.Filters; using Newtonsoft.Json; using NJsonSchema.Converters; +using NJsonSchema.NewtonsoftJson.Converters; using NSwag.Annotations; using NSwag.Generation.AspNetCore; diff --git a/src/NSwag.AspNetCore/NSwag.AspNetCore.csproj b/src/NSwag.AspNetCore/NSwag.AspNetCore.csproj index e807a52221..822c22ca9c 100644 --- a/src/NSwag.AspNetCore/NSwag.AspNetCore.csproj +++ b/src/NSwag.AspNetCore/NSwag.AspNetCore.csproj @@ -1,7 +1,6 @@  - net461;netstandard1.6;netstandard2.0;netcoreapp3.1;net5.0;net6.0;net7.0 - Swagger Documentation AspNetCore NetCore TypeScript CodeGen + net462;netstandard2.0;netcoreapp3.1;net6.0;net7.0 $(MSBuildProjectName).nuspec symbols.nupkg @@ -21,44 +20,49 @@ 4.3.0 4.0.1 + bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + - + + - + + - + + + - - - - + + + diff --git a/src/NSwag.AspNetCore/NSwag.AspNetCore.nuspec b/src/NSwag.AspNetCore/NSwag.AspNetCore.nuspec index 349060e3ab..889de271d5 100644 --- a/src/NSwag.AspNetCore/NSwag.AspNetCore.nuspec +++ b/src/NSwag.AspNetCore/NSwag.AspNetCore.nuspec @@ -23,7 +23,7 @@ - + @@ -61,15 +61,6 @@ - - - - - - - - - @@ -94,16 +85,12 @@ - - - - + + - - diff --git a/src/NSwag.AspNetCore/SwaggerSettings.cs b/src/NSwag.AspNetCore/SwaggerSettings.cs index 0be71aa116..f3d41a7b2e 100644 --- a/src/NSwag.AspNetCore/SwaggerSettings.cs +++ b/src/NSwag.AspNetCore/SwaggerSettings.cs @@ -70,9 +70,9 @@ public SwaggerSettings() #pragma warning restore 618 #if AspNetOwin - internal T CreateGeneratorSettings(JsonSerializerSettings serializerSettings, object mvcOptions) + internal T CreateGeneratorSettings(object mvcOptions) { - GeneratorSettings.ApplySettings(serializerSettings, mvcOptions); + GeneratorSettings.ApplySettings(GeneratorSettings.SchemaSettings, mvcOptions); return GeneratorSettings; } #endif diff --git a/src/NSwag.AssemblyLoader.Tests/PathUtilitiesTests.cs b/src/NSwag.AssemblyLoader.Tests/PathUtilitiesTests.cs deleted file mode 100644 index c0c5c0b682..0000000000 --- a/src/NSwag.AssemblyLoader.Tests/PathUtilitiesTests.cs +++ /dev/null @@ -1,48 +0,0 @@ -using NSwag.AssemblyLoader.Utilities; -using Xunit; - -namespace NSwag.AssemblyLoader.Tests -{ - public class PathUtilitiesTests - { - [Fact] - public void TwoAbsolutePaths_ConvertToRelativePath_RelativeDirectoryPath() - { - // Act - var relative = PathUtilities.MakeRelativePath("C:\\Foo\\Bar", "C:\\Foo"); - - // Assert - Assert.Equal("Bar", relative); - } - - [Fact] - public void RelativeAndAbsolutePath_ConvertToAbsolutePath_AbsolutePath() - { - // Act - var absolute = PathUtilities.MakeAbsolutePath("Bar", "C:\\Foo"); - - // Assert - Assert.Equal("C:\\Foo\\Bar", absolute); - } - - [Fact] - public void TwoAbsoluteEqualPaths_ConvertToRelativePath_CurrentDirectory() - { - // Act - var relative = PathUtilities.MakeRelativePath("C:\\Foo\\Bar", "C:\\Foo\\Bar"); - - // Assert - Assert.Equal(".", relative); - } - - [Fact] - public void CurrentDirectoryAndAbsolutePath_ConvertToAbsolutePath_SameAbsolutePath() - { - // Act - var absolute = PathUtilities.MakeAbsolutePath(".", "C:\\Foo"); - - // Assert - Assert.Equal("C:\\Foo", absolute); - } - } -} diff --git a/src/NSwag.AssemblyLoader.Tests/WildcardTests.cs b/src/NSwag.AssemblyLoader.Tests/WildcardTests.cs deleted file mode 100644 index 2d872e1525..0000000000 --- a/src/NSwag.AssemblyLoader.Tests/WildcardTests.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System.Linq; -using NSwag.AssemblyLoader.Utilities; -using Xunit; - -namespace NSwag.AssemblyLoader.Tests -{ - public class WildcardTests - { - [Fact(Skip = "Ignored")] - public void When_path_has_wildcards_then_they_are_expanded_correctly() - { - // Arrange - - - // Act - var files = PathUtilities.ExpandFileWildcards("../../**/NSwag.*.dll").ToList(); - - // Assert - Assert.True(files.Any(f => f.Contains("bin\\Debug")) || files.Any(f => f.Contains("bin\\Release"))); - } - - [Fact] - public void NoWildcard() - { - // Arrange - var items = new string[] { "abc/def", "ghi/jkl" }; - - // Act - var matches = PathUtilities.FindWildcardMatches("abc/def", items, '/'); - - // Assert - Assert.Single(matches); - Assert.Equal("abc/def", matches.First()); - } - - [Fact] - public void SingleWildcardInTheMiddle() - { - // Arrange - var items = new string[] { "abc/def/ghi", "abc/def/jkl", "abc/a/b/ghi" }; - - // Act - var matches = PathUtilities.FindWildcardMatches("abc/*/ghi", items, '/'); - - // Assert - Assert.Single(matches); - Assert.Equal("abc/def/ghi", matches.First()); - } - - [Fact] - public void DoubleWildcardInTheMiddle() - { - // Arrange - var items = new string[] { "a/b/c", "a/b/d", "a/b/b/c" }; - - // Act - var matches = PathUtilities.FindWildcardMatches("a/**/c", items, '/'); - - // Assert - Assert.Equal(2, matches.Count()); - Assert.Equal("a/b/c", matches.First()); - Assert.Equal("a/b/b/c", matches.Last()); - } - - [Fact] - public void DoubleWildcardAtTheEnd() - { - // Arrange - var items = new string[] { "abc/a", "abc/b", "abc/c/d" }; - - // Act - var matches = PathUtilities.FindWildcardMatches("abc/**", items, '/'); - - // Assert - Assert.Equal(3, matches.Count()); - } - - [Fact] - public void SingleWildcardAtTheEnd() - { - // Arrange - var items = new string[] { "abc/a", "abc/b", "abc/c/d" }; - - // Act - var matches = PathUtilities.FindWildcardMatches("abc/*", items, '/'); - - // Assert - Assert.Equal(2, matches.Count()); - } - - [Fact] - public void DoubleWildcardAtTheBeginning() - { - // Arrange - var items = new string[] { "a/b/c", "a/b/d", "a/c" }; - - // Act - var matches = PathUtilities.FindWildcardMatches("**/c", items, '/'); - - // Assert - Assert.Equal(2, matches.Count()); - Assert.Equal("a/b/c", matches.First()); - Assert.Equal("a/c", matches.Last()); - } - - [Fact] - public void SingleWildcardAtTheBeginning() - { - // Arrange - var items = new string[] { "a/b/c", "x/y/c", "x/b/c" }; - - // Act - var matches = PathUtilities.FindWildcardMatches("*/b/c", items, '/'); - - // Assert - Assert.Equal(2, matches.Count()); - Assert.Equal("a/b/c", matches.First()); - Assert.Equal("x/b/c", matches.Last()); - } - } -} diff --git a/src/NSwag.AssemblyLoader/AppDomainIsolation.cs b/src/NSwag.AssemblyLoader/AppDomainIsolation.cs deleted file mode 100644 index d153727391..0000000000 --- a/src/NSwag.AssemblyLoader/AppDomainIsolation.cs +++ /dev/null @@ -1,94 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Rico Suter. All rights reserved. -// -// https://github.com/RicoSuter/NSwag/blob/master/LICENSE.md -// Rico Suter, mail@rsuter.com -//----------------------------------------------------------------------- - -using System; -using System.Collections.Generic; -using System.Reflection; - -#if NETFRAMEWORK -using System.Diagnostics; -using Newtonsoft.Json.Linq; -#endif - -namespace NSwag.AssemblyLoader -{ -#if NETFRAMEWORK - - public sealed class AppDomainIsolation : IDisposable where T : AssemblyLoader - { - /// is . - public AppDomainIsolation(string assemblyDirectory, string assemblyConfiguration, IEnumerable bindingRedirects, IEnumerable preloadedAssemblies) - { - if (string.IsNullOrEmpty(assemblyDirectory)) - { - throw new ArgumentNullException(nameof(assemblyDirectory)); - } - - var configuration = AssemblyConfigurationFileTransformer.GetConfigurationBytes( - assemblyDirectory, assemblyConfiguration, bindingRedirects); - - var setup = new AppDomainSetup(); - setup.ShadowCopyFiles = "true"; - setup.SetConfigurationBytes(configuration); - - Domain = AppDomain.CreateDomain("AppDomainIsolation:" + Guid.NewGuid(), null, setup); - - foreach (var pa in preloadedAssemblies) - { - Domain.Load(new AssemblyName { CodeBase = pa }); - } - - var type = typeof(T); - try - { - Object = (T)Domain.CreateInstanceAndUnwrap(type.Assembly.FullName, type.FullName); - } - catch - { - Object = (T)Domain.CreateInstanceFromAndUnwrap(type.Assembly.Location, type.FullName); - } - } - - public AppDomain Domain { get; private set; } - - public T Object { get; } - - public void Dispose() - { - if (Domain != null) - { - AppDomain.Unload(Domain); - Domain = null; - } - } - } - -#else - - public sealed class AppDomainIsolation : IDisposable where T : AssemblyLoader, new() - { - /// is . - public AppDomainIsolation(string assemblyDirectory, string assemblyConfiguration, IEnumerable bindingRedirects, IEnumerable preloadedAssemblies) - { - Object = new T(); - - foreach (var pa in preloadedAssemblies) - { - Object.Context.Assemblies[pa.GetName().Name] = pa; - } - } - - public T Object { get; } - - public void Dispose() - { - } - } - -#endif -} diff --git a/src/NSwag.AssemblyLoader/AssemblyConfigurationFileTransformer.cs b/src/NSwag.AssemblyLoader/AssemblyConfigurationFileTransformer.cs deleted file mode 100644 index 3896f8795d..0000000000 --- a/src/NSwag.AssemblyLoader/AssemblyConfigurationFileTransformer.cs +++ /dev/null @@ -1,138 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Rico Suter. All rights reserved. -// -// https://github.com/RicoSuter/NSwag/blob/master/LICENSE.md -// Rico Suter, mail@rsuter.com -//----------------------------------------------------------------------- - -#if NETFRAMEWORK -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; - -namespace NSwag.AssemblyLoader -{ - internal class AssemblyConfigurationFileTransformer - { - private const string EmptyConfig = -@" - - - - - - - - - - - - - - - - - - -"; - - private const string AssemblyBinding = -@" - - -"; - - public static byte[] GetConfigurationBytes(string assemblyDirectory, string configurationPath, IEnumerable bindingRedirects) - { - configurationPath = !string.IsNullOrEmpty(configurationPath) ? configurationPath : TryFindConfigurationPath(assemblyDirectory); - - var content = !string.IsNullOrEmpty(configurationPath) ? File.ReadAllText(configurationPath, Encoding.UTF8) : EmptyConfig; - foreach (var br in bindingRedirects) - { - content = UpdateOrAddBindingRedirect(content, br.Name, br.NewVersion, br.PublicKeyToken); - } - - return Encoding.UTF8.GetBytes(content); - } - - private static string UpdateOrAddBindingRedirect(string content, string name, string newVersion, string publicKeyToken) - { - if (content.Contains(@"assemblyIdentity name=""" + name + @"""")) - { - content = Regex.Replace(content, - "", - match => Regex.Replace(match.Value, "oldVersion=\"(.*?)\"", - "oldVersion=\"0.0.0.0-65535.65535.65535.65535\""), - RegexOptions.Singleline); - - content = Regex.Replace(content, - "", - match => Regex.Replace(match.Value, "newVersion=\"(.*?)\"", "newVersion=\"" + newVersion + "\""), - RegexOptions.Singleline); - - return content; - } - else - { - return content.Replace("", AssemblyBinding - .Replace("{name}", name) - .Replace("{publicKeyToken}", publicKeyToken) - .Replace("{newVersion}", newVersion) + - ""); - } - } - - private static string TryFindConfigurationPath(string assemblyDirectory) - { - var config = Path.Combine(assemblyDirectory, "App.config"); - if (File.Exists(config)) - { - return config; - } - - config = Path.Combine(assemblyDirectory, "Web.config"); - if (File.Exists(config)) - { - return config; - } - - config = Path.Combine(assemblyDirectory, "../Web.config"); - if (File.Exists(config)) - { - return config; - } - - return null; - } - } -} - -#endif - -public class BindingRedirect -{ - public string Name { get; } - - public string NewVersion { get; } - - public string PublicKeyToken { get; } - - public BindingRedirect(string name, string newVersion, string publicKeyToken) - { - Name = name; - NewVersion = newVersion; - PublicKeyToken = publicKeyToken; - } - -#if NETFRAMEWORK - - public BindingRedirect(string name, Type newVersionType, string publicKeyToken) - : this(name, newVersionType.Assembly.GetName().Version.ToString(), publicKeyToken) - { - } - -#endif -} diff --git a/src/NSwag.AssemblyLoader/AssemblyLoader.cs b/src/NSwag.AssemblyLoader/AssemblyLoader.cs deleted file mode 100644 index 708ebc8eb3..0000000000 --- a/src/NSwag.AssemblyLoader/AssemblyLoader.cs +++ /dev/null @@ -1,223 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Rico Suter. All rights reserved. -// -// https://github.com/RicoSuter/NSwag/blob/master/LICENSE.md -// Rico Suter, mail@rsuter.com -//----------------------------------------------------------------------- - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; - -#if NETFRAMEWORK -using System.Diagnostics; -#else -using System.Runtime.Loader; -#endif - -namespace NSwag.AssemblyLoader -{ -#if NETFRAMEWORK - public class AssemblyLoader : MarshalByRefObject - { -#else - public class AssemblyLoader - { - public CustomAssemblyLoadContext Context { get; } - - public AssemblyLoader() - { - Context = new CustomAssemblyLoadContext(); - AssemblyLoadContext.Default.Resolving += (context, name) => Context.Resolve(name); - } - -#endif - - public Type GetType(string typeName) - { - try - { - var split = typeName.Split(':'); - if (split.Length > 1) - { - var assemblyName = split[0].Trim(); - typeName = split[1].Trim(); - -#if NETFRAMEWORK - var assembly = AppDomain.CurrentDomain.Load(new AssemblyName(assemblyName)); -#else - var assembly = Context.LoadFromAssemblyName(new AssemblyName(assemblyName)); -#endif - return assembly.GetType(typeName, true); - } - -#if NETFRAMEWORK - foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) - { - var type = assembly.GetType(typeName, false, true); - if (type != null) - { - return type; - } - } - - throw new InvalidOperationException("Could not find the type '" + typeName + "'."); -#else - return Type.GetType(typeName, true, true); -#endif - } - catch (Exception e) - { - throw new InvalidOperationException("Could not instantiate the type '" + typeName + "'. Try specifying the type with the assembly, e.g 'assemblyName:typeName'.", e); - } - } - - public object CreateInstance(string typeName) - { - return Activator.CreateInstance(GetType(typeName)); - } - - protected void RegisterReferencePaths(IEnumerable referencePaths) - { - var allReferencePaths = new List(); - foreach (var path in referencePaths.Where(p => !string.IsNullOrWhiteSpace(p))) - { - allReferencePaths.Add(path); - allReferencePaths.AddRange(GetAllDirectories(path)); - } - - // Add path to executable directory - allReferencePaths.Add(Path.GetDirectoryName(typeof(AssemblyLoader).GetTypeInfo().Assembly.Location)); - allReferencePaths = allReferencePaths.Distinct().ToList(); - -#if !NETFRAMEWORK - Context.AllReferencePaths = allReferencePaths; -#else - allReferencePaths.AddRange(GetAllDirectories(AppDomain.CurrentDomain.SetupInformation.ApplicationBase)); - - AppDomain.CurrentDomain.AssemblyResolve += (sender, args) => - { - Version version = null; - - var separatorIndex = args.Name.IndexOf(",", StringComparison.Ordinal); - var assemblyName = separatorIndex > 0 ? args.Name.Substring(0, separatorIndex) : args.Name; - - if (separatorIndex > 0) - { - separatorIndex = args.Name.IndexOf("=", separatorIndex, StringComparison.Ordinal); - if (separatorIndex > 0) - { - var endIndex = args.Name.IndexOf(",", separatorIndex, StringComparison.Ordinal); - if (endIndex > 0) - { - var parts = args.Name - .Substring(separatorIndex + 1, endIndex - separatorIndex - 1) - .Split('.'); - - version = new Version(int.Parse(parts[0]), int.Parse(parts[1]), int.Parse(parts[2]), int.Parse(parts[3])); - } - } - } - - var existingAssembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(a => a.GetName().Name == assemblyName); - if (existingAssembly != null) - { - return existingAssembly; - } - - if (version != null) - { - var assemblyByVersion = TryLoadByVersion(allReferencePaths, assemblyName, version.Major + "." + version.Minor + "." + version.Build + "."); - if (assemblyByVersion != null) - { - return assemblyByVersion; - } - - assemblyByVersion = TryLoadByVersion(allReferencePaths, assemblyName, version.Major + "." + version.Minor + "."); - if (assemblyByVersion != null) - { - return assemblyByVersion; - } - - assemblyByVersion = TryLoadByVersion(allReferencePaths, assemblyName, version.Major + "."); - if (assemblyByVersion != null) - { - return assemblyByVersion; - } - } - - var assembly = TryLoadByName(allReferencePaths, assemblyName); - if (assembly != null) - { - return assembly; - } - - return null; - }; - } - - private Assembly TryLoadByVersion(List allReferencePaths, string assemblyName, string assemblyVersion) - { - foreach (var path in allReferencePaths) - { - var files = Directory.GetFiles(path, assemblyName + ".dll", SearchOption.TopDirectoryOnly); - foreach (var file in files) - { - try - { - var info = FileVersionInfo.GetVersionInfo(file); - if (info.FileVersion.StartsWith(assemblyVersion)) - { - return Assembly.LoadFrom(file); - } - } - catch (Exception exception) - { - Debug.WriteLine("NSwag: AssemblyLoader exception when loading assembly by file '" + file + "': \n" + exception); - } - } - } - - return null; - } - - private Assembly TryLoadByName(List allReferencePaths, string assemblyName) - { - foreach (var path in allReferencePaths) - { - var files = Directory.GetFiles(path, assemblyName + ".dll", SearchOption.TopDirectoryOnly); - foreach (var file in files) - { - try - { - return Assembly.LoadFrom(file); - } - catch (Exception exception) - { - Debug.WriteLine("NSwag: AssemblyLoader exception when loading assembly by file '" + file + "': \n" + exception); - } - } - } - - return null; -#endif - } - - private string[] GetAllDirectories(string rootDirectory) - { - rootDirectory = Environment.ExpandEnvironmentVariables(rootDirectory); - - try - { - return Directory.GetDirectories(rootDirectory, "*", SearchOption.AllDirectories); - } - catch // https://github.com/RicoSuter/NSwag/issues/2177 - { - return new string[0]; - } - } - } -} \ No newline at end of file diff --git a/src/NSwag.AssemblyLoader/CustomAssemblyLoadContext.cs b/src/NSwag.AssemblyLoader/CustomAssemblyLoadContext.cs deleted file mode 100644 index 5241d9156c..0000000000 --- a/src/NSwag.AssemblyLoader/CustomAssemblyLoadContext.cs +++ /dev/null @@ -1,216 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Rico Suter. All rights reserved. -// -// https://github.com/RicoSuter/NSwag/blob/master/LICENSE.md -// Rico Suter, mail@rsuter.com -//----------------------------------------------------------------------- - -#if !NETFRAMEWORK - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Reflection; -using System.Runtime.Loader; -using NJsonSchema.Infrastructure; -using NSwag.AssemblyLoader.Utilities; - -namespace NSwag.AssemblyLoader -{ - public class CustomAssemblyLoadContext : AssemblyLoadContext - { - private readonly HashSet _assembliesLoadedByAssemblyName = new HashSet(); - private bool _isResolving = false; - - internal Dictionary Assemblies { get; } = new Dictionary(); - - internal List AllReferencePaths { get; set; } = new List(); - - public Assembly Resolve(AssemblyName args) - { - if (!_isResolving) - { - return Load(args); - } - else - { - return null; - } - } - - protected override Assembly Load(AssemblyName args) - { - if (Assemblies.ContainsKey(args.Name)) - { - return Assemblies[args.Name]; - } - - var separatorIndex = args.Name.IndexOf(",", StringComparison.Ordinal); - var assemblyName = separatorIndex > 0 ? args.Name.Substring(0, separatorIndex) : args.Name; - - var assembly = TryLoadExistingAssemblyName(args.FullName); - if (assembly != null) - { - Assemblies[args.Name] = assembly; - return assembly; - } - - var version = args.Version; - if (version != null) - { - // var assemblyByVersion = TryLoadByVersion(AllReferencePaths, assemblyName, version.Major + "." + version.Minor + "." + version.Build + "." + version.Revision); - // if (assemblyByVersion != null) - // { - // Assemblies[args.Name] = assemblyByVersion; - // return assemblyByVersion; - // } - - var assemblyByVersion = TryLoadByVersion(AllReferencePaths, assemblyName, version.Major + "." + version.Minor + "." + version.Build + "."); - if (assemblyByVersion != null) - { - Assemblies[args.Name] = assemblyByVersion; - return assemblyByVersion; - } - - assemblyByVersion = TryLoadByVersion(AllReferencePaths, assemblyName, version.Major + "." + version.Minor + "."); - if (assemblyByVersion != null) - { - Assemblies[args.Name] = assemblyByVersion; - return assemblyByVersion; - } - - assemblyByVersion = TryLoadByVersion(AllReferencePaths, assemblyName, version.Major + "."); - if (assemblyByVersion != null) - { - Assemblies[args.Name] = assemblyByVersion; - return assemblyByVersion; - } - } - - assembly = TryLoadByAssemblyName(args.FullName); - if (assembly != null) - { - Assemblies[args.Name] = assembly; - return assembly; - } - - assembly = TryLoadByName(AllReferencePaths, assemblyName); - if (assembly != null) - { - Assemblies[args.Name] = assembly; - return assembly; - } - - Assemblies[args.Name] = TryLoadByAssemblyName(assemblyName); - return Assemblies[args.Name]; - } - - private Assembly TryLoadExistingAssemblyName(string assemblyName) - { - try - { - _isResolving = true; - return Default.LoadFromAssemblyName(new AssemblyName(assemblyName)); - } - catch (Exception exception) - { - Debug.WriteLine("NSwag: AssemblyLoader exception when loading assembly by name in Default context '" + - assemblyName + "': \n" + exception); - } - finally - { - _isResolving = false; - } - - return null; - } - - private Assembly TryLoadByVersion(List allReferencePaths, string assemblyName, string assemblyVersion) - { - foreach (var path in allReferencePaths) - { - var files = Directory.GetFiles(path, assemblyName + ".dll", SearchOption.TopDirectoryOnly); - foreach (var file in files) - { - try - { - var info = FileVersionInfo.GetVersionInfo(file); - if (info.FileVersion.StartsWith(assemblyVersion)) - { - var assembly = TryLoadByPath(assemblyName, file); - if (assembly != null) - { - return assembly; - } - } - } - catch (Exception exception) - { - Debug.WriteLine("NSwag: AssemblyLoader exception when loading assembly by file '" + file + "': \n" + exception); - } - } - } - - return null; - } - - private Assembly TryLoadByName(List allReferencePaths, string assemblyName) - { - foreach (var path in allReferencePaths) - { - var files = Directory.GetFiles(path, assemblyName + ".dll", SearchOption.TopDirectoryOnly); - foreach (var file in files) - { - var assembly = TryLoadByPath(assemblyName, file); - if (assembly != null) - { - return assembly; - } - } - } - - return null; - } - - private Assembly TryLoadByPath(string assemblyName, string file) - { - try - { - if (!file.EndsWith("/refs/" + assemblyName + ".dll") && - !file.EndsWith("\\refs\\" + assemblyName + ".dll")) - { - var currentDirectory = DynamicApis.DirectoryGetCurrentDirectory(); - return LoadFromAssemblyPath(PathUtilities.MakeAbsolutePath(file, currentDirectory)); - } - } - catch (Exception exception) - { - Debug.WriteLine("NSwag: AssemblyLoader exception when loading assembly by file '" + file + "': \n" + exception); - } - - return null; - } - - private Assembly TryLoadByAssemblyName(string assemblyName) - { - if (!_assembliesLoadedByAssemblyName.Contains(assemblyName)) - { - try - { - _assembliesLoadedByAssemblyName.Add(assemblyName); - return LoadFromAssemblyName(new AssemblyName(assemblyName)); - } - catch (Exception exception) - { - Debug.WriteLine("NSwag: AssemblyLoader exception when loading assembly by name '" + assemblyName + "': \n" + exception); - } - } - - return null; - } - } -} - -#endif \ No newline at end of file diff --git a/src/NSwag.AssemblyLoader/NSwag.AssemblyLoader.csproj b/src/NSwag.AssemblyLoader/NSwag.AssemblyLoader.csproj deleted file mode 100644 index b2aad3112a..0000000000 --- a/src/NSwag.AssemblyLoader/NSwag.AssemblyLoader.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - netstandard1.6;net461;netstandard2.0 - - $(NoWarn),1591 - bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.AssemblyLoader/app.config b/src/NSwag.AssemblyLoader/app.config deleted file mode 100644 index d3dbfef4b1..0000000000 --- a/src/NSwag.AssemblyLoader/app.config +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/AllowNullableBodyParametersTests.cs b/src/NSwag.CodeGeneration.CSharp.Tests/AllowNullableBodyParametersTests.cs index fe1670e3c2..8ca3104191 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/AllowNullableBodyParametersTests.cs +++ b/src/NSwag.CodeGeneration.CSharp.Tests/AllowNullableBodyParametersTests.cs @@ -1,4 +1,6 @@ using Microsoft.AspNetCore.Mvc; +using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.CodeGeneration.OperationNameGenerators; using NSwag.Generation.WebApi; using System.ComponentModel.DataAnnotations; @@ -87,7 +89,8 @@ private static async Task GenerateCode(bool allowNullable { var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings { - AllowNullableBodyParameters = allowNullableBodyParameters + AllowNullableBodyParameters = allowNullableBodyParameters, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() }); var document = await swaggerGenerator.GenerateForControllerAsync(); diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/CSharpClientSettingsTests.cs b/src/NSwag.CodeGeneration.CSharp.Tests/CSharpClientSettingsTests.cs index ffa9d79935..6de6128b8d 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/CSharpClientSettingsTests.cs +++ b/src/NSwag.CodeGeneration.CSharp.Tests/CSharpClientSettingsTests.cs @@ -1,5 +1,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.WebApi; using Xunit; @@ -19,7 +21,10 @@ public object GetPerson(bool @override = false) public async Task When_ConfigurationClass_is_set_then_correct_ctor_is_generated() { // Arrange - var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); var document = await swaggerGenerator.GenerateForControllerAsync(); var generator = new CSharpClientGenerator(document, new CSharpClientGeneratorSettings @@ -40,9 +45,12 @@ public async Task When_ConfigurationClass_is_set_then_correct_ctor_is_generated( public async Task When_UseHttpRequestMessageCreationMethod_is_set_then_CreateRequestMessage_is_generated() { // Arrange - var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); + var document = await swaggerGenerator.GenerateForControllerAsync(); - var generator = new CSharpClientGenerator(document, new CSharpClientGeneratorSettings { ConfigurationClass = "MyConfig", @@ -61,9 +69,12 @@ public async Task When_UseHttpRequestMessageCreationMethod_is_set_then_CreateReq public async Task When_parameter_name_is_reserved_keyword_then_it_is_appended_with_at() { // Arrange - var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); + var document = await swaggerGenerator.GenerateForControllerAsync(); - var generator = new CSharpClientGenerator(document, new CSharpClientGeneratorSettings()); // Act @@ -77,9 +88,12 @@ public async Task When_parameter_name_is_reserved_keyword_then_it_is_appended_wi public async Task When_code_is_generated_then_by_default_the_system_httpclient_is_used() { // Arrange - var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); + var document = await swaggerGenerator.GenerateForControllerAsync(); - var generator = new CSharpClientGenerator(document, new CSharpClientGeneratorSettings { InjectHttpClient = false @@ -96,9 +110,12 @@ public async Task When_code_is_generated_then_by_default_the_system_httpclient_i public async Task When_custom_http_client_type_is_specified_then_an_instance_of_that_type_is_used() { // Arrange - var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); - var document = await swaggerGenerator.GenerateForControllerAsync(); + var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); + var document = await swaggerGenerator.GenerateForControllerAsync(); var generator = new CSharpClientGenerator(document, new CSharpClientGeneratorSettings { HttpClientType = "CustomNamespace.CustomHttpClient", @@ -116,9 +133,12 @@ public async Task When_custom_http_client_type_is_specified_then_an_instance_of_ public async Task When_client_base_interface_is_not_specified_then_client_interface_should_have_no_base_interface() { // Arrange - var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); - var document = await swaggerGenerator.GenerateForControllerAsync(); + var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); + var document = await swaggerGenerator.GenerateForControllerAsync(); var generator = new CSharpClientGenerator(document, new CSharpClientGeneratorSettings { GenerateClientInterfaces = true @@ -135,9 +155,12 @@ public async Task When_client_base_interface_is_not_specified_then_client_interf public async Task When_client_base_interface_is_specified_then_client_interface_extends_it() { // Arrange - var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); - var document = await swaggerGenerator.GenerateForControllerAsync(); + var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); + var document = await swaggerGenerator.GenerateForControllerAsync(); var generator = new CSharpClientGenerator(document, new CSharpClientGeneratorSettings { GenerateClientInterfaces = true, diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/ControllerGenerationFormatTests.cs b/src/NSwag.CodeGeneration.CSharp.Tests/ControllerGenerationFormatTests.cs index 3be84b80ba..9e59d42f77 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/ControllerGenerationFormatTests.cs +++ b/src/NSwag.CodeGeneration.CSharp.Tests/ControllerGenerationFormatTests.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Text.RegularExpressions; using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.CodeGeneration.CSharp.Models; using NSwag.CodeGeneration.OperationNameGenerators; using Xunit; @@ -267,7 +268,7 @@ private OpenApiDocument GetOpenApiDocument() complexTypeReponseSchema.Properties["Prop3"] = new JsonSchemaProperty { Type = JsonObjectType.Boolean, IsRequired = true }; complexTypeReponseSchema.Properties["Prop4"] = new JsonSchemaProperty { Type = JsonObjectType.Object, Reference = complexTypeSchema, IsRequired = true }; - var typeString = JsonSchema.FromType(typeof(string)); + var typeString = NewtonsoftJsonSchemaGenerator.FromType(typeof(string)); var document = new OpenApiDocument(); document.Paths["Foo"] = new OpenApiPathItem diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/FileDownloadTests.cs b/src/NSwag.CodeGeneration.CSharp.Tests/FileDownloadTests.cs index 608baca8ee..324b269fd9 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/FileDownloadTests.cs +++ b/src/NSwag.CodeGeneration.CSharp.Tests/FileDownloadTests.cs @@ -1,83 +1,89 @@ -using System; -using System.Net.Http; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using NSwag.Generation.WebApi; -using Xunit; - -namespace NSwag.CodeGeneration.CSharp.Tests -{ - public class FileDownloadTests - { - public class FileDownloadController : Controller - { - [Route("DownloadFile")] - public HttpResponseMessage DownloadFile() - { - throw new NotImplementedException(); - } - } - - [Fact] - public async Task When_response_is_file_and_stream_is_not_used_then_byte_array_is_returned() - { - // Arrange - var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); - var document = await swaggerGenerator.GenerateForControllerAsync(); - - // Act - var codeGen = new CSharpClientGenerator(document, new CSharpClientGeneratorSettings - { - GenerateClientInterfaces = true - }); - var code = codeGen.GenerateFile(); - - // Assert - Assert.Contains("System.Threading.Tasks.Task DownloadFileAsync();", code); - Assert.Contains("ReadAsStreamAsync()", code); - } - - [Fact] - public async Task When_openapi3_contains_octet_stream_response_then_FileResponse_is_generated() - { - // Arrange - var json = @"{ - ""openapi"": ""3.0.1"", - ""paths"": { - ""/instances/{id}/frames/{index}/raw"": { - ""get"": { - ""description"": ""sample"", - ""operationId"": ""raw"", - ""parameters"": [], - ""responses"": { - ""200"": { - ""description"": ""raw file in binary data"", - ""content"": { - ""application/octet-stream"": { - ""schema"": { - ""type"": ""string"", - ""format"": ""binary"" - } - } - } - } - } - } - } - } -}"; - var document = await OpenApiDocument.FromJsonAsync(json); - - // Act - var codeGenerator = new CSharpClientGenerator(document, new CSharpClientGeneratorSettings - { - GenerateClientInterfaces = true - }); - var code = codeGenerator.GenerateFile(); - - //// Assert - Assert.Contains("public virtual async System.Threading.Tasks.Task RawAsync(", code); - Assert.Contains("var fileResponse_ = new FileResponse(", code); - } - } -} +using System; +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; +using NSwag.Generation.WebApi; +using Xunit; + +namespace NSwag.CodeGeneration.CSharp.Tests +{ + public class FileDownloadTests + { + public class FileDownloadController : Controller + { + [Route("DownloadFile")] + public HttpResponseMessage DownloadFile() + { + throw new NotImplementedException(); + } + } + + [Fact] + public async Task When_response_is_file_and_stream_is_not_used_then_byte_array_is_returned() + { + // Arrange + var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); + + var document = await swaggerGenerator.GenerateForControllerAsync(); + + // Act + var codeGen = new CSharpClientGenerator(document, new CSharpClientGeneratorSettings + { + GenerateClientInterfaces = true + }); + var code = codeGen.GenerateFile(); + + // Assert + Assert.Contains("System.Threading.Tasks.Task DownloadFileAsync();", code); + Assert.Contains("ReadAsStreamAsync()", code); + } + + [Fact] + public async Task When_openapi3_contains_octet_stream_response_then_FileResponse_is_generated() + { + // Arrange + var json = @"{ + ""openapi"": ""3.0.1"", + ""paths"": { + ""/instances/{id}/frames/{index}/raw"": { + ""get"": { + ""description"": ""sample"", + ""operationId"": ""raw"", + ""parameters"": [], + ""responses"": { + ""200"": { + ""description"": ""raw file in binary data"", + ""content"": { + ""application/octet-stream"": { + ""schema"": { + ""type"": ""string"", + ""format"": ""binary"" + } + } + } + } + } + } + } + } +}"; + var document = await OpenApiDocument.FromJsonAsync(json); + + // Act + var codeGenerator = new CSharpClientGenerator(document, new CSharpClientGeneratorSettings + { + GenerateClientInterfaces = true + }); + var code = codeGenerator.GenerateFile(); + + //// Assert + Assert.Contains("public virtual async System.Threading.Tasks.Task RawAsync(", code); + Assert.Contains("var fileResponse_ = new FileResponse(", code); + } + } +} diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/FileTests.cs b/src/NSwag.CodeGeneration.CSharp.Tests/FileTests.cs index 6468d6690e..995ccbaf09 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/FileTests.cs +++ b/src/NSwag.CodeGeneration.CSharp.Tests/FileTests.cs @@ -2,6 +2,7 @@ using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.WebApi; using Xunit; @@ -22,7 +23,11 @@ public HttpResponseMessage DownloadFile() public async Task When_file_is_generated_system_alias_is_there() { // Arrange - var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); + var document = await swaggerGenerator.GenerateForControllerAsync(); // Act diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/FormParameterTests.cs b/src/NSwag.CodeGeneration.CSharp.Tests/FormParameterTests.cs index 009bbc83a2..8371e7d897 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/FormParameterTests.cs +++ b/src/NSwag.CodeGeneration.CSharp.Tests/FormParameterTests.cs @@ -1,6 +1,8 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using NJsonSchema; +using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.WebApi; using Xunit; @@ -67,7 +69,11 @@ public class HttpPostedFileBase public async Task When_action_has_file_parameter_then_Stream_is_generated_in_CSharp_code() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); + var document = await generator.GenerateForControllerAsync(); // Act diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/HeadRequestTests.cs b/src/NSwag.CodeGeneration.CSharp.Tests/HeadRequestTests.cs index cc1fe9786e..d379acd004 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/HeadRequestTests.cs +++ b/src/NSwag.CodeGeneration.CSharp.Tests/HeadRequestTests.cs @@ -1,5 +1,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.WebApi; using Xunit; @@ -19,7 +21,11 @@ public void Foo() public async Task When_operation_is_HTTP_head_then_no_content_is_not_used() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); + var document = await generator.GenerateForControllerAsync(); // Act 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 720d329731..4bb353b27b 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/NSwag.CodeGeneration.CSharp.Tests.csproj +++ b/src/NSwag.CodeGeneration.CSharp.Tests/NSwag.CodeGeneration.CSharp.Tests.csproj @@ -1,6 +1,7 @@  + - netcoreapp2.1 + net7.0 @@ -8,6 +9,7 @@ + diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/OptionalParameterTests.cs b/src/NSwag.CodeGeneration.CSharp.Tests/OptionalParameterTests.cs index bbf8622c7a..ad61258823 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/OptionalParameterTests.cs +++ b/src/NSwag.CodeGeneration.CSharp.Tests/OptionalParameterTests.cs @@ -2,6 +2,9 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using NJsonSchema; +using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.WebApi; using Xunit; @@ -48,7 +51,11 @@ public class MyClass public async Task When_setting_is_enabled_with_enum_fromuri_should_make_enum_nullable() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); + var document = await generator.GenerateForControllerAsync(); // Act @@ -67,7 +74,11 @@ public async Task When_setting_is_enabled_with_enum_fromuri_should_make_enum_nul public async Task When_setting_is_enabled_with_class_fromuri_should_make_enum_nullable() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); + var document = await generator.GenerateForControllerAsync(); // Act @@ -87,7 +98,11 @@ public async Task When_setting_is_enabled_with_class_fromuri_should_make_enum_nu public async Task When_setting_is_enabled_then_optional_parameters_have_null_optional_value() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); + var document = await generator.GenerateForControllerAsync(); // Act @@ -105,7 +120,11 @@ public async Task When_setting_is_enabled_then_optional_parameters_have_null_opt [Fact] public async Task When_setting_is_enabled_then_parameters_are_reordered() { - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); // Act diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/UseCancellationTokenTests.cs b/src/NSwag.CodeGeneration.CSharp.Tests/UseCancellationTokenTests.cs index 1f37e02a22..43b334a792 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/UseCancellationTokenTests.cs +++ b/src/NSwag.CodeGeneration.CSharp.Tests/UseCancellationTokenTests.cs @@ -1,6 +1,8 @@ using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.CodeGeneration.CSharp.Models; using NSwag.Generation.WebApi; using Xunit; @@ -28,7 +30,10 @@ public void Bar() public async Task When_controllerstyleispartial_and_usecancellationtokenistrue_and_requesthasnoparameter_then_cancellationtoken_is_added() { // Arrange - var swaggerGen = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var swaggerGen = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); var document = await swaggerGen.GenerateForControllerAsync(); // Act @@ -49,7 +54,10 @@ public async Task When_controllerstyleispartial_and_usecancellationtokenistrue_a public async Task When_controllerstyleispartial_and_usecancellationtokenistrue_and_requesthasparameter_then_cancellationtoken_is_added() { // Arrange - var swaggerGen = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var swaggerGen = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); var document = await swaggerGen.GenerateForControllerAsync(); // Act @@ -71,7 +79,11 @@ public async Task When_controllerstyleispartial_and_usecancellationtokenistrue_a public async Task When_controllerstyleisabstract_and_usecancellationtokenistrue_and_requesthasnoparameter_then_cancellationtoken_is_added() { // Arrange - var swaggerGen = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var swaggerGen = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); + var document = await swaggerGen.GenerateForControllerAsync(); // Act @@ -91,7 +103,11 @@ public async Task When_controllerstyleisabstract_and_usecancellationtokenistrue_ public async Task When_controllerstyleisabstract_and_usecancellationtokenistrue_and_requesthasparameter_then_cancellationtoken_is_added() { // Arrange - var swaggerGen = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var swaggerGen = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); + var document = await swaggerGen.GenerateForControllerAsync(); // Act @@ -111,7 +127,11 @@ public async Task When_controllerstyleisabstract_and_usecancellationtokenistrue_ public async Task When_usecancellationtokenparameter_notsetted_then_cancellationtoken_isnot_added() { // Arrange - var swaggerGen = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var swaggerGen = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); + var document = await swaggerGen.GenerateForControllerAsync(); // Act diff --git a/src/NSwag.CodeGeneration.CSharp.Tests/WrapResponsesTests.cs b/src/NSwag.CodeGeneration.CSharp.Tests/WrapResponsesTests.cs index 8a322a6367..f2fe7a81ce 100644 --- a/src/NSwag.CodeGeneration.CSharp.Tests/WrapResponsesTests.cs +++ b/src/NSwag.CodeGeneration.CSharp.Tests/WrapResponsesTests.cs @@ -1,6 +1,8 @@ using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.WebApi; using Xunit; @@ -27,7 +29,10 @@ public void Bar() public async Task When_success_responses_are_wrapped_then_SwaggerResponse_is_returned() { // Arrange - var swaggerGen = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var swaggerGen = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); var document = await swaggerGen.GenerateForControllerAsync(); // Act @@ -46,7 +51,10 @@ public async Task When_success_responses_are_wrapped_then_SwaggerResponse_is_ret public async Task When_success_responses_are_wrapped_then_SwaggerResponse_is_returned_web_api() { // Arrange - var swaggerGen = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var swaggerGen = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }); var document = await swaggerGen.GenerateForControllerAsync(); // Act @@ -67,7 +75,8 @@ public async Task When_success_responses_are_wrapped_then_SwaggerResponse_is_ret // Arrange var swaggerGen = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings { - IsAspNetCore = true + IsAspNetCore = true, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() }); var document = await swaggerGen.GenerateForControllerAsync(); diff --git a/src/NSwag.CodeGeneration.CSharp/NSwag.CodeGeneration.CSharp.csproj b/src/NSwag.CodeGeneration.CSharp/NSwag.CodeGeneration.CSharp.csproj index 060e91f9fb..86b41c78b0 100644 --- a/src/NSwag.CodeGeneration.CSharp/NSwag.CodeGeneration.CSharp.csproj +++ b/src/NSwag.CodeGeneration.CSharp/NSwag.CodeGeneration.CSharp.csproj @@ -1,23 +1,25 @@  - net461;netstandard2.0 + netstandard2.0;net462 + bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + - + + + + - - - - + \ No newline at end of file diff --git a/src/NSwag.CodeGeneration.Tests/CodeGenerationTests.cs b/src/NSwag.CodeGeneration.Tests/CodeGenerationTests.cs index 8d406a86d1..8dd18deccb 100644 --- a/src/NSwag.CodeGeneration.Tests/CodeGenerationTests.cs +++ b/src/NSwag.CodeGeneration.Tests/CodeGenerationTests.cs @@ -7,6 +7,7 @@ using NJsonSchema; using NJsonSchema.CodeGeneration.TypeScript; using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.CodeGeneration.CSharp; using NSwag.CodeGeneration.OperationNameGenerators; using NSwag.CodeGeneration.TypeScript; @@ -311,7 +312,7 @@ public void When_using_MultipleClientsFromOperationId_then_ensure_that_underscor private static OpenApiDocument CreateDocument() { var document = new OpenApiDocument(); - var settings = new JsonSchemaGeneratorSettings(); + var settings = new NewtonsoftJsonSchemaGeneratorSettings(); var generator = new JsonSchemaGenerator(settings); document.Paths["/Person"] = new OpenApiPathItem(); diff --git a/src/NSwag.CodeGeneration.Tests/NSwag.CodeGeneration.Tests.csproj b/src/NSwag.CodeGeneration.Tests/NSwag.CodeGeneration.Tests.csproj index 878732e56f..8c9cf1425c 100644 --- a/src/NSwag.CodeGeneration.Tests/NSwag.CodeGeneration.Tests.csproj +++ b/src/NSwag.CodeGeneration.Tests/NSwag.CodeGeneration.Tests.csproj @@ -1,13 +1,15 @@  - netcoreapp2.1 + net7.0 + + diff --git a/src/NSwag.CodeGeneration.TypeScript.Tests/AngularJSTests.cs b/src/NSwag.CodeGeneration.TypeScript.Tests/AngularJSTests.cs index e2fc3de2b2..da485990da 100644 --- a/src/NSwag.CodeGeneration.TypeScript.Tests/AngularJSTests.cs +++ b/src/NSwag.CodeGeneration.TypeScript.Tests/AngularJSTests.cs @@ -2,6 +2,9 @@ using Xunit; using NSwag.Generation.WebApi; using Microsoft.AspNetCore.Mvc; +using NJsonSchema.Generation; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; namespace NSwag.CodeGeneration.TypeScript.Tests { @@ -33,7 +36,11 @@ public void AddMessage([FromForm]Foo message, [FromForm]string messageId) public async Task When_export_types_is_true_then_add_export_before_classes() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -59,7 +66,11 @@ public async Task When_export_types_is_true_then_add_export_before_classes() public async Task When_export_types_is_false_then_dont_add_export_before_classes() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -85,7 +96,10 @@ public async Task When_export_types_is_false_then_dont_add_export_before_classes public async Task When_consumes_is_url_encoded_then_construct_url_encoded_request() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); diff --git a/src/NSwag.CodeGeneration.TypeScript.Tests/AngularTests.cs b/src/NSwag.CodeGeneration.TypeScript.Tests/AngularTests.cs index 75ccdcbf87..251a943019 100644 --- a/src/NSwag.CodeGeneration.TypeScript.Tests/AngularTests.cs +++ b/src/NSwag.CodeGeneration.TypeScript.Tests/AngularTests.cs @@ -3,6 +3,9 @@ using NSwag.Generation.WebApi; using Microsoft.AspNetCore.Mvc; using System.ComponentModel.DataAnnotations; +using NJsonSchema.Generation; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; namespace NSwag.CodeGeneration.TypeScript.Tests { @@ -74,7 +77,10 @@ public void AddMessage([FromForm]Foo message, [FromForm]string messageId) public async Task When_return_value_is_void_then_client_returns_observable_of_void() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -98,7 +104,10 @@ public async Task When_return_value_is_void_then_client_returns_observable_of_vo public async Task When_export_types_is_true_then_add_export_before_classes() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -124,7 +133,10 @@ public async Task When_export_types_is_true_then_add_export_before_classes() public async Task When_export_types_is_false_then_dont_add_export_before_classes() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -150,7 +162,10 @@ public async Task When_export_types_is_false_then_dont_add_export_before_classes public async Task When_generic_request() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -176,7 +191,10 @@ public async Task When_generic_request() public async Task When_consumes_is_url_encoded_then_construct_url_encoded_request() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); diff --git a/src/NSwag.CodeGeneration.TypeScript.Tests/AxiosTests.cs b/src/NSwag.CodeGeneration.TypeScript.Tests/AxiosTests.cs index 2114128942..bacc14e9fa 100644 --- a/src/NSwag.CodeGeneration.TypeScript.Tests/AxiosTests.cs +++ b/src/NSwag.CodeGeneration.TypeScript.Tests/AxiosTests.cs @@ -2,6 +2,9 @@ using Xunit; using NSwag.Generation.WebApi; using Microsoft.AspNetCore.Mvc; +using NJsonSchema.Generation; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; namespace NSwag.CodeGeneration.TypeScript.Tests { @@ -15,16 +18,16 @@ public class Foo public class DiscussionController : Controller { [HttpPost] - public void AddMessage([FromBody]Foo message) + public void AddMessage([FromBody] Foo message) { } } - public class UrlEncodedRequestConsumingController: Controller + public class UrlEncodedRequestConsumingController : Controller { [HttpPost] [Consumes("application/x-www-form-urlencoded")] - public void AddMessage([FromForm]Foo message, [FromForm]string messageId) + public void AddMessage([FromForm] Foo message, [FromForm] string messageId) { } } @@ -33,7 +36,11 @@ public void AddMessage([FromForm]Foo message, [FromForm]string messageId) public async Task When_export_types_is_true_then_add_export_before_classes() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -59,7 +66,11 @@ public async Task When_export_types_is_true_then_add_export_before_classes() public async Task When_export_types_is_false_then_dont_add_export_before_classes() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -85,7 +96,11 @@ public async Task When_export_types_is_false_then_dont_add_export_before_classes public async Task When_consumes_is_url_encoded_then_construct_url_encoded_request() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -110,7 +125,11 @@ public async Task When_consumes_is_url_encoded_then_construct_url_encoded_reques public async Task Add_cancel_token_to_every_call() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -134,7 +153,14 @@ public async Task Add_cancel_token_to_every_call() public async Task When_abort_signal() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); diff --git a/src/NSwag.CodeGeneration.TypeScript.Tests/FetchTests.cs b/src/NSwag.CodeGeneration.TypeScript.Tests/FetchTests.cs index 55b071134e..ee2ea26ede 100644 --- a/src/NSwag.CodeGeneration.TypeScript.Tests/FetchTests.cs +++ b/src/NSwag.CodeGeneration.TypeScript.Tests/FetchTests.cs @@ -2,6 +2,9 @@ using Xunit; using NSwag.Generation.WebApi; using Microsoft.AspNetCore.Mvc; +using NJsonSchema; +using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; namespace NSwag.CodeGeneration.TypeScript.Tests { @@ -33,7 +36,11 @@ public void AddMessage([FromForm]Foo message, [FromForm]string messageId, [FromF public async Task When_export_types_is_true_then_add_export_before_classes() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -59,7 +66,11 @@ public async Task When_export_types_is_true_then_add_export_before_classes() public async Task When_export_types_is_false_then_dont_add_export_before_classes() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -85,7 +96,11 @@ public async Task When_export_types_is_false_then_dont_add_export_before_classes public async Task When_consumes_is_url_encoded_then_construct_url_encoded_request() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -110,7 +125,11 @@ public async Task When_consumes_is_url_encoded_then_construct_url_encoded_reques public async Task When_abort_signal() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -134,7 +153,11 @@ public async Task When_abort_signal() public async Task When_no_abort_signal() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -158,7 +181,11 @@ public async Task When_no_abort_signal() public async Task When_includeHttpContext() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); // Act @@ -182,7 +209,11 @@ public async Task When_includeHttpContext() public async Task When_no_includeHttpContext() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); diff --git a/src/NSwag.CodeGeneration.TypeScript.Tests/JQueryCallbacksTests.cs b/src/NSwag.CodeGeneration.TypeScript.Tests/JQueryCallbacksTests.cs index 4cf6aab2c8..7fad26d3fb 100644 --- a/src/NSwag.CodeGeneration.TypeScript.Tests/JQueryCallbacksTests.cs +++ b/src/NSwag.CodeGeneration.TypeScript.Tests/JQueryCallbacksTests.cs @@ -2,6 +2,9 @@ using Xunit; using NSwag.Generation.WebApi; using Microsoft.AspNetCore.Mvc; +using NJsonSchema.Generation; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; namespace NSwag.CodeGeneration.TypeScript.Tests { @@ -33,7 +36,11 @@ public void AddMessage([FromForm]Foo message, [FromForm]string messageId) public async Task When_export_types_is_true_then_add_export_before_classes() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -59,7 +66,11 @@ public async Task When_export_types_is_true_then_add_export_before_classes() public async Task When_export_types_is_false_then_dont_add_export_before_classes() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -85,7 +96,11 @@ public async Task When_export_types_is_false_then_dont_add_export_before_classes public async Task When_consumes_is_url_encoded_then_construct_url_encoded_request() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); diff --git a/src/NSwag.CodeGeneration.TypeScript.Tests/JQueryPromisesTests.cs b/src/NSwag.CodeGeneration.TypeScript.Tests/JQueryPromisesTests.cs index b3bd4cd0ea..8fd5d4afcd 100644 --- a/src/NSwag.CodeGeneration.TypeScript.Tests/JQueryPromisesTests.cs +++ b/src/NSwag.CodeGeneration.TypeScript.Tests/JQueryPromisesTests.cs @@ -1,5 +1,8 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using NJsonSchema; +using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.WebApi; using Xunit; @@ -33,7 +36,11 @@ public void AddMessage([FromForm]Foo message, [FromForm]string messageId) public async Task When_export_types_is_true_then_add_export_before_classes() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -59,7 +66,11 @@ public async Task When_export_types_is_true_then_add_export_before_classes() public async Task When_export_types_is_false_then_dont_add_export_before_classes() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); @@ -85,7 +96,11 @@ public async Task When_export_types_is_false_then_dont_add_export_before_classes public async Task When_consumes_is_url_encoded_then_construct_url_encoded_request() { // Arrange - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var document = await generator.GenerateForControllerAsync(); var json = document.ToJson(); 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 fbf62de773..9b8d298348 100644 --- a/src/NSwag.CodeGeneration.TypeScript.Tests/NSwag.CodeGeneration.TypeScript.Tests.csproj +++ b/src/NSwag.CodeGeneration.TypeScript.Tests/NSwag.CodeGeneration.TypeScript.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp2.1 + net7.0 @@ -8,6 +8,7 @@ + diff --git a/src/NSwag.CodeGeneration.TypeScript.Tests/OperationParameterTests.cs b/src/NSwag.CodeGeneration.TypeScript.Tests/OperationParameterTests.cs index 2c2863238f..fe5f93e689 100644 --- a/src/NSwag.CodeGeneration.TypeScript.Tests/OperationParameterTests.cs +++ b/src/NSwag.CodeGeneration.TypeScript.Tests/OperationParameterTests.cs @@ -8,6 +8,8 @@ using NSwag.Generation.WebApi; using System.Collections.Generic; using Xunit; +using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; namespace NSwag.CodeGeneration.TypeScript.Tests { @@ -49,8 +51,11 @@ public async Task When_query_parameter_is_enum_array_then_the_enum_is_referenced var settings = new WebApiOpenApiDocumentGeneratorSettings { DefaultUrlTemplate = "api/{controller}/{action}/{id}", - SerializerSettings = serializerSettings, - SchemaType = SchemaType.Swagger2, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SerializerSettings = serializerSettings, + SchemaType = SchemaType.Swagger2 + } }; var generator = new WebApiOpenApiDocumentGenerator(settings); diff --git a/src/NSwag.CodeGeneration.TypeScript.Tests/TypeScriptDiscriminatorTests.cs b/src/NSwag.CodeGeneration.TypeScript.Tests/TypeScriptDiscriminatorTests.cs index 716b671dc5..30a2ae510d 100644 --- a/src/NSwag.CodeGeneration.TypeScript.Tests/TypeScriptDiscriminatorTests.cs +++ b/src/NSwag.CodeGeneration.TypeScript.Tests/TypeScriptDiscriminatorTests.cs @@ -2,11 +2,14 @@ using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using NJsonSchema.CodeGeneration.TypeScript; -using NJsonSchema.Converters; using NSwag.Generation.WebApi; using System.Collections.Generic; using System.Runtime.Serialization; using Xunit; +using NJsonSchema.NewtonsoftJson.Converters; +using NJsonSchema.Generation; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; namespace NSwag.CodeGeneration.TypeScript.Tests { @@ -74,8 +77,12 @@ public string TestNested(Nested param) public async Task When_parameter_is_abstract_then_generate_union() { // Arrange - var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); - var document = await swaggerGenerator.GenerateForControllerAsync(); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + + var document = await generator.GenerateForControllerAsync(); var clientGenerator = new TypeScriptClientGenerator(document, new TypeScriptClientGeneratorSettings { TypeScriptGeneratorSettings = diff --git a/src/NSwag.CodeGeneration.TypeScript.Tests/TypeScriptOperationParameterTests.cs b/src/NSwag.CodeGeneration.TypeScript.Tests/TypeScriptOperationParameterTests.cs index eb3d5ce0f7..813557d191 100644 --- a/src/NSwag.CodeGeneration.TypeScript.Tests/TypeScriptOperationParameterTests.cs +++ b/src/NSwag.CodeGeneration.TypeScript.Tests/TypeScriptOperationParameterTests.cs @@ -1,6 +1,9 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; +using NJsonSchema; using NJsonSchema.CodeGeneration.TypeScript; +using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.WebApi; using Xunit; @@ -30,8 +33,12 @@ public string Test(int a, int? b = null) public async Task When_parameter_is_nullable_and_ts20_then_it_is_a_union_type_with_undefined() { // Arrange - var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); - var document = await swaggerGenerator.GenerateForControllerAsync(); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + + var document = await generator.GenerateForControllerAsync(); var clientGenerator = new TypeScriptClientGenerator(document, new TypeScriptClientGeneratorSettings { TypeScriptGeneratorSettings = @@ -54,8 +61,12 @@ public async Task When_parameter_is_nullable_and_ts20_then_it_is_a_union_type_wi public async Task When_parameter_is_nullable_and_ts20_then_it_is_not_included_in_query_string() { // Arrange - var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); - var document = await swaggerGenerator.GenerateForControllerAsync(); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + + var document = await generator.GenerateForControllerAsync(); var clientGenerator = new TypeScriptClientGenerator(document, new TypeScriptClientGeneratorSettings { TypeScriptGeneratorSettings = @@ -78,8 +89,12 @@ public async Task When_parameter_is_nullable_and_ts20_then_it_is_not_included_in public async Task When_parameter_is_nullable_optional_and_ts20_then_it_is_a_union_type_with_undefined() { // Arrange - var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); - var document = await swaggerGenerator.GenerateForControllerAsync(); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + + var document = await generator.GenerateForControllerAsync(); var clientGenerator = new TypeScriptClientGenerator(document, new TypeScriptClientGeneratorSettings { TypeScriptGeneratorSettings = @@ -102,8 +117,12 @@ public async Task When_parameter_is_nullable_optional_and_ts20_then_it_is_a_unio public async Task When_parameter_is_nullable_optional_and_ts20_then_it_is_not_included_in_query_string() { // Arrange - var swaggerGenerator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings()); - var document = await swaggerGenerator.GenerateForControllerAsync(); + var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + + var document = await generator.GenerateForControllerAsync(); var clientGenerator = new TypeScriptClientGenerator(document, new TypeScriptClientGeneratorSettings { TypeScriptGeneratorSettings = diff --git a/src/NSwag.CodeGeneration.TypeScript/NSwag.CodeGeneration.TypeScript.csproj b/src/NSwag.CodeGeneration.TypeScript/NSwag.CodeGeneration.TypeScript.csproj index d37e36ae6a..d999cc7827 100644 --- a/src/NSwag.CodeGeneration.TypeScript/NSwag.CodeGeneration.TypeScript.csproj +++ b/src/NSwag.CodeGeneration.TypeScript/NSwag.CodeGeneration.TypeScript.csproj @@ -1,23 +1,25 @@  - net461;netstandard2.0 + netstandard2.0;net462 + bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + - + + + + - - - - + \ No newline at end of file diff --git a/src/NSwag.CodeGeneration/NSwag.CodeGeneration.csproj b/src/NSwag.CodeGeneration/NSwag.CodeGeneration.csproj index a33dea14ca..f1204ef7f8 100644 --- a/src/NSwag.CodeGeneration/NSwag.CodeGeneration.csproj +++ b/src/NSwag.CodeGeneration/NSwag.CodeGeneration.csproj @@ -1,18 +1,22 @@  - net461;netstandard2.0 + netstandard2.0;net462 + bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + - - - + + + - + + + diff --git a/src/NSwag.Commands/BaseTypeMappingContractResolver.cs b/src/NSwag.Commands/BaseTypeMappingContractResolver.cs deleted file mode 100644 index 8b93d3cc31..0000000000 --- a/src/NSwag.Commands/BaseTypeMappingContractResolver.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using Newtonsoft.Json.Serialization; - -namespace NSwag.Commands -{ - internal class BaseTypeMappingContractResolver : CamelCasePropertyNamesContractResolver - { - private readonly IDictionary _mappings; - - public BaseTypeMappingContractResolver(IDictionary mappings) - { - _mappings = mappings; - } - - public override JsonContract ResolveContract(Type type) - { - return base.ResolveContract(_mappings != null && _mappings.ContainsKey(type) ? _mappings[type] : type); - } - } -} \ No newline at end of file diff --git a/src/NSwag.Commands/Commands/CodeGeneration/CodeGeneratorCommandBase.cs b/src/NSwag.Commands/Commands/CodeGeneration/CodeGeneratorCommandBase.cs index 42e003e7ee..3f866553aa 100644 --- a/src/NSwag.Commands/Commands/CodeGeneration/CodeGeneratorCommandBase.cs +++ b/src/NSwag.Commands/Commands/CodeGeneration/CodeGeneratorCommandBase.cs @@ -8,8 +8,6 @@ using NConsole; using Newtonsoft.Json; -using NJsonSchema; -using NJsonSchema.CodeGeneration; using NSwag.CodeGeneration; namespace NSwag.Commands.CodeGeneration @@ -31,33 +29,5 @@ public string TemplateDirectory get { return Settings.CodeGeneratorSettings.TemplateDirectory; } set { Settings.CodeGeneratorSettings.TemplateDirectory = value; } } - - [Argument(Name = "TypeNameGenerator", IsRequired = false, Description = "The custom ITypeNameGenerator implementation type in the form 'assemblyName:fullTypeName' or 'fullTypeName').")] - public string TypeNameGeneratorType { get; set; } - - [Argument(Name = "PropertyNameGeneratorType", IsRequired = false, Description = "The custom IPropertyNameGenerator implementation type in the form 'assemblyName:fullTypeName' or 'fullTypeName').")] - public string PropertyNameGeneratorType { get; set; } - - [Argument(Name = "EnumNameGeneratorType", IsRequired = false, Description = "The custom IEnumNameGenerator implementation type in the form 'assemblyName:fullTypeName' or 'fullTypeName').")] - public string EnumNameGeneratorType { get; set; } - - // TODO: Use InitializeCustomTypes method - public void InitializeCustomTypes(AssemblyLoader.AssemblyLoader assemblyLoader) - { - if (!string.IsNullOrEmpty(TypeNameGeneratorType)) - { - Settings.CodeGeneratorSettings.TypeNameGenerator = (ITypeNameGenerator)assemblyLoader.CreateInstance(TypeNameGeneratorType); - } - - if (!string.IsNullOrEmpty(PropertyNameGeneratorType)) - { - Settings.CodeGeneratorSettings.PropertyNameGenerator = (IPropertyNameGenerator)assemblyLoader.CreateInstance(PropertyNameGeneratorType); - } - - if (!string.IsNullOrEmpty(EnumNameGeneratorType)) - { - Settings.CodeGeneratorSettings.EnumNameGenerator = (IEnumNameGenerator)assemblyLoader.CreateInstance(EnumNameGeneratorType); - } - } } } \ No newline at end of file diff --git a/src/NSwag.Commands/Commands/Document/ExecuteDocumentCommand.cs b/src/NSwag.Commands/Commands/Document/ExecuteDocumentCommand.cs index 6914ceb972..e788af5317 100644 --- a/src/NSwag.Commands/Commands/Document/ExecuteDocumentCommand.cs +++ b/src/NSwag.Commands/Commands/Document/ExecuteDocumentCommand.cs @@ -70,16 +70,6 @@ private async Task ExecuteDocumentAsync(IConsoleHost host, string filePath) "Change the runtime with the '/runtime:" + document.Runtime + "' parameter " + "or run the file with the correct command line binary."); } - - if (document.SelectedSwaggerGenerator == document.SwaggerGenerators.WebApiToOpenApiCommand && - document.SwaggerGenerators.WebApiToOpenApiCommand.IsAspNetCore == false && - document.Runtime != Runtime.Debug && - document.Runtime != Runtime.WinX86 && - document.Runtime != Runtime.WinX64) - { - throw new InvalidOperationException("The runtime " + document.Runtime + " in the document must be used " + - "with ASP.NET Core. Enable /isAspNetCore:true."); - } } await document.ExecuteAsync(); diff --git a/src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiCommand.cs b/src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiCommand.cs index 9002332e57..f3e1c780dc 100644 --- a/src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiCommand.cs +++ b/src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiCommand.cs @@ -10,20 +10,12 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Reflection; using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.Extensions.DependencyInjection; using NConsole; using Newtonsoft.Json; -using NSwag.Generation.AspNetCore; -using NJsonSchema.Yaml; -using NJsonSchema; -using Microsoft.AspNetCore.Hosting; using NSwag.Generation; -using NJsonSchema.Generation; -using Namotion.Reflection; #if NETCOREAPP || NETSTANDARD using System.Runtime.Loader; @@ -33,19 +25,16 @@ namespace NSwag.Commands.Generation.AspNetCore { /// The generator. [Command(Name = "aspnetcore2openapi", Description = "Generates a Swagger specification ASP.NET Core Mvc application using ApiExplorer.")] - public class AspNetCoreToOpenApiCommand : AspNetCoreToSwaggerCommand - { - } - - /// The generator. - [Command(Name = "aspnetcore2swagger", Description = "Generates a Swagger specification ASP.NET Core Mvc application using ApiExplorer (obsolete: use aspnetcore2openapi instead).")] - public class AspNetCoreToSwaggerCommand : OpenApiGeneratorCommandBase + public class AspNetCoreToOpenApiCommand : OutputCommandBase { private const string LauncherBinaryName = "NSwag.AspNetCore.Launcher"; [Argument(Name = nameof(Project), IsRequired = false, Description = "The project to use.")] public string Project { get; set; } + [Argument(Name = "DocumentName", IsRequired = false, Description = "The document name to use in SwaggerDocumentProvider (default: v1).")] + public string DocumentName { get; set; } = "v1"; + [Argument(Name = nameof(MSBuildProjectExtensionsPath), IsRequired = false, Description = "The MSBuild project extensions path. Defaults to \"obj\".")] public string MSBuildProjectExtensionsPath { get; set; } @@ -70,180 +59,153 @@ public class AspNetCoreToSwaggerCommand : OpenApiGeneratorCommandBase Settings.RequireParametersWithoutDefault; - set => Settings.RequireParametersWithoutDefault = value; - } - - [Argument(Name = "ApiGroupNames", IsRequired = false, Description = "The ASP.NET Core API Explorer group names to include (comma separated, default: empty = all).")] - public string[] ApiGroupNames - { - get => Settings.ApiGroupNames; - set => Settings.ApiGroupNames = value; - } + [Argument(Name = nameof(AspNetCoreEnvironment), IsRequired = false, Description = "Sets the ASPNETCORE_ENVIRONMENT if provided (default: empty).")] + public string AspNetCoreEnvironment { get; set; } public override async Task RunAsync(CommandLineProcessor processor, IConsoleHost host) { - if (!string.IsNullOrEmpty(Project) && AssemblyPaths.Any()) + var verboseHost = Verbose ? host : null; + + var projectFile = ProjectMetadata.FindProject(Project); + var projectMetadata = await ProjectMetadata.GetProjectMetadata( + projectFile, + MSBuildProjectExtensionsPath, + TargetFramework, + Configuration, + Runtime, + NoBuild, + MSBuildOutputPath, + verboseHost).ConfigureAwait(false); + + if (!File.Exists(Path.Combine(projectMetadata.OutputPath, projectMetadata.TargetFileName))) { - throw new InvalidOperationException("Either provide a Project or an assembly but not both."); + throw new InvalidOperationException($"Project outputs could not be located in " + + $"'{projectMetadata.OutputPath}'. Ensure that the project has been built."); } - if (string.IsNullOrEmpty(Project)) + var cleanupFiles = new List(); + + var args = new List(); + string executable; + +#if NET462 + var toolDirectory = AppDomain.CurrentDomain.BaseDirectory; + if (!Directory.Exists(toolDirectory)) { - // Run with assembly - return await base.RunAsync(processor, host); + toolDirectory = Path.GetDirectoryName(typeof(AspNetCoreToOpenApiCommand).GetTypeInfo().Assembly.Location); } - else + + if (projectMetadata.TargetFrameworkIdentifier == ".NETFramework") { - // Run with .csproj - var verboseHost = Verbose ? host : null; - - var projectFile = ProjectMetadata.FindProject(Project); - var projectMetadata = await ProjectMetadata.GetProjectMetadata( - projectFile, - MSBuildProjectExtensionsPath, - TargetFramework, - Configuration, - Runtime, - NoBuild, - MSBuildOutputPath, - verboseHost).ConfigureAwait(false); - - if (!File.Exists(Path.Combine(projectMetadata.OutputPath, projectMetadata.TargetFileName))) + string binaryName; + var is32BitProject = string.Equals(projectMetadata.PlatformTarget, "x86", StringComparison.OrdinalIgnoreCase); + if (is32BitProject) { - throw new InvalidOperationException($"Project outputs could not be located in " + - $"'{projectMetadata.OutputPath}'. Ensure that the project has been built."); - } - - var cleanupFiles = new List(); - - var args = new List(); - string executable; + if (Environment.Is64BitProcess) + { + throw new InvalidOperationException($"The ouput of {projectFile} is a 32-bit application and requires NSwag.Console.x86 to be processed."); + } -#if NET461 - var toolDirectory = AppDomain.CurrentDomain.BaseDirectory; - if (!Directory.Exists(toolDirectory)) - { - toolDirectory = Path.GetDirectoryName(typeof(AspNetCoreToSwaggerCommand).GetTypeInfo().Assembly.Location); + binaryName = LauncherBinaryName + ".x86.exe"; } - - if (projectMetadata.TargetFrameworkIdentifier == ".NETFramework") + else { - string binaryName; - var is32BitProject = string.Equals(projectMetadata.PlatformTarget, "x86", StringComparison.OrdinalIgnoreCase); - if (is32BitProject) + if (!Environment.Is64BitProcess) { - if (Environment.Is64BitProcess) - { - throw new InvalidOperationException($"The ouput of {projectFile} is a 32-bit application and requires NSwag.Console.x86 to be processed."); - } - - binaryName = LauncherBinaryName + ".x86.exe"; + throw new InvalidOperationException($"The ouput of {projectFile} is a 64-bit application and requires NSwag.Console to be processed."); } - else - { - if (!Environment.Is64BitProcess) - { - throw new InvalidOperationException($"The ouput of {projectFile} is a 64-bit application and requires NSwag.Console to be processed."); - } - binaryName = LauncherBinaryName + ".exe"; - } + binaryName = LauncherBinaryName + ".exe"; + } - var executableSource = Path.Combine(toolDirectory, binaryName); - if (!File.Exists(executableSource)) - { - throw new InvalidOperationException($"Unable to locate {binaryName} in {toolDirectory}."); - } + var executableSource = Path.Combine(toolDirectory, binaryName); + if (!File.Exists(executableSource)) + { + throw new InvalidOperationException($"Unable to locate {binaryName} in {toolDirectory}."); + } - executable = Path.Combine(projectMetadata.OutputPath, binaryName); - File.Copy(executableSource, executable, overwrite: true); - cleanupFiles.Add(executable); + executable = Path.Combine(projectMetadata.OutputPath, binaryName); + File.Copy(executableSource, executable, overwrite: true); + cleanupFiles.Add(executable); - var appConfig = Path.Combine(projectMetadata.OutputPath, projectMetadata.TargetFileName + ".config"); - if (File.Exists(appConfig)) - { - var copiedAppConfig = Path.ChangeExtension(executable, ".exe.config"); - File.Copy(appConfig, copiedAppConfig, overwrite: true); - cleanupFiles.Add(copiedAppConfig); - } - } -#elif NETCOREAPP || NETSTANDARD - var toolDirectory = AppContext.BaseDirectory; - if (!Directory.Exists(toolDirectory)) + var appConfig = Path.Combine(projectMetadata.OutputPath, projectMetadata.TargetFileName + ".config"); + if (File.Exists(appConfig)) { - toolDirectory = Path.GetDirectoryName(typeof(AspNetCoreToSwaggerCommand).GetTypeInfo().Assembly.Location); + var copiedAppConfig = Path.ChangeExtension(executable, ".exe.config"); + File.Copy(appConfig, copiedAppConfig, overwrite: true); + cleanupFiles.Add(copiedAppConfig); } + } +#else + var toolDirectory = AppContext.BaseDirectory; + if (!Directory.Exists(toolDirectory)) + { + toolDirectory = Path.GetDirectoryName(typeof(AspNetCoreToOpenApiCommand).GetTypeInfo().Assembly.Location); + } - if (projectMetadata.TargetFrameworkIdentifier == ".NETCoreApp" || - projectMetadata.TargetFrameworkIdentifier == "net5.0") - { - executable = "dotnet"; - args.Add("exec"); - args.Add("--depsfile"); - args.Add(projectMetadata.ProjectDepsFilePath); + if (projectMetadata.TargetFrameworkIdentifier == ".NETCoreApp" || + projectMetadata.TargetFrameworkIdentifier == "net6.0" || + projectMetadata.TargetFrameworkIdentifier == "net7.0") + { + executable = "dotnet"; + args.Add("exec"); + args.Add("--depsfile"); + args.Add(projectMetadata.ProjectDepsFilePath); - args.Add("--runtimeconfig"); - args.Add(projectMetadata.ProjectRuntimeConfigFilePath); + args.Add("--runtimeconfig"); + args.Add(projectMetadata.ProjectRuntimeConfigFilePath); - var binaryName = LauncherBinaryName + ".dll"; - var executorBinary = Path.Combine(toolDirectory, binaryName); + var binaryName = LauncherBinaryName + ".dll"; + var executorBinary = Path.Combine(toolDirectory, binaryName); - if (!File.Exists(executorBinary)) - { - binaryName = LauncherBinaryName + ".exe"; - executorBinary = Path.Combine(toolDirectory, binaryName); - } - - if (!File.Exists(executorBinary)) - { - throw new InvalidOperationException($"Unable to locate {binaryName} in {toolDirectory}."); - } - - args.Add(executorBinary); - } -#endif - else + if (!File.Exists(executorBinary)) { - throw new InvalidOperationException($"Unsupported target framework '{projectMetadata.TargetFrameworkIdentifier}'."); + binaryName = LauncherBinaryName + ".exe"; + executorBinary = Path.Combine(toolDirectory, binaryName); } - var commandFile = Path.GetTempFileName(); - var outputFile = Path.GetTempFileName(); - File.WriteAllText(commandFile, JsonConvert.SerializeObject(this)); - cleanupFiles.Add(commandFile); - cleanupFiles.Add(outputFile); - - args.Add(commandFile); - args.Add(outputFile); - args.Add(projectMetadata.AssemblyName); - args.Add(toolDirectory); - - try + if (!File.Exists(executorBinary)) { - var exitCode = await Exe.RunAsync(executable, args, verboseHost).ConfigureAwait(false); - if (exitCode != 0) - { - throw new InvalidOperationException($"Swagger generation failed with non-zero exit code '{exitCode}'."); - } + throw new InvalidOperationException($"Unable to locate {binaryName} in {toolDirectory}."); + } + + args.Add(executorBinary); + } +#endif + else + { + throw new InvalidOperationException($"Unsupported target framework '{projectMetadata.TargetFrameworkIdentifier}'."); + } - host?.WriteMessage($"Output written to {outputFile}.{Environment.NewLine}"); + var commandFile = Path.GetTempFileName(); + var outputFile = Path.GetTempFileName(); + File.WriteAllText(commandFile, JsonConvert.SerializeObject(this)); + cleanupFiles.Add(commandFile); + cleanupFiles.Add(outputFile); - JsonReferenceResolver ReferenceResolverFactory(OpenApiDocument d) => new JsonAndYamlReferenceResolver(new JsonSchemaResolver(d, Settings)); + args.Add(commandFile); + args.Add(outputFile); + args.Add(projectMetadata.AssemblyName); + args.Add(toolDirectory); - var documentJson = File.ReadAllText(outputFile); - var document = await OpenApiDocument.FromJsonAsync(documentJson, null, OutputType, ReferenceResolverFactory).ConfigureAwait(false); - await this.TryWriteDocumentOutputAsync(host, NewLineBehavior, () => document).ConfigureAwait(false); - return document; - } - finally + try + { + var exitCode = await Exe.RunAsync(executable, args, verboseHost).ConfigureAwait(false); + if (exitCode != 0) { - TryDeleteFiles(cleanupFiles); + throw new InvalidOperationException($"Swagger generation failed with non-zero exit code '{exitCode}'."); } + + host?.WriteMessage($"Output written to {outputFile}.{Environment.NewLine}"); + + var documentJson = File.ReadAllText(outputFile); + var document = await OpenApiDocument.FromJsonAsync(documentJson, null).ConfigureAwait(false); + await this.TryWriteDocumentOutputAsync(host, NewLineBehavior, () => document).ConfigureAwait(false); + return document; + } + finally + { + TryDeleteFiles(cleanupFiles); } } @@ -268,30 +230,14 @@ internal string ChangeWorkingDirectoryAndSetAspNetCoreEnvironment() Directory.SetCurrentDirectory(workingDirectory); } } - else if (AssemblyPaths.Any()) - { - var workingDirectory = Path.GetDirectoryName(AssemblyPaths.First()); - if (Directory.Exists(workingDirectory)) - { - Directory.SetCurrentDirectory(workingDirectory); - } - } return currentWorkingDirectory; } - public async Task GenerateDocumentAsync(AssemblyLoader.AssemblyLoader assemblyLoader, IServiceProvider serviceProvider, string currentWorkingDirectory) + public async Task GenerateDocumentAsync(IServiceProvider serviceProvider, string currentWorkingDirectory) { Directory.SetCurrentDirectory(currentWorkingDirectory); - - if (UseDocumentProvider) - { - return await GenerateDocumentWithDocumentProviderAsync(serviceProvider); - } - else - { - return await GenerateDocumentWithApiDescriptionAsync(assemblyLoader, serviceProvider, currentWorkingDirectory); - } + return await GenerateDocumentWithDocumentProviderAsync(serviceProvider); } private async Task GenerateDocumentWithDocumentProviderAsync(IServiceProvider serviceProvider) @@ -301,29 +247,6 @@ private async Task GenerateDocumentWithDocumentProviderAsync(IS return document; } - private async Task GenerateDocumentWithApiDescriptionAsync(AssemblyLoader.AssemblyLoader assemblyLoader, IServiceProvider serviceProvider, string currentWorkingDirectory) - { - InitializeCustomTypes(assemblyLoader); - - // In the case of KeyNotFoundException, see https://github.com/aspnet/Mvc/issues/5690 - var apiDescriptionProvider = serviceProvider.GetRequiredService(); - - var settings = await CreateSettingsAsync(assemblyLoader, serviceProvider, currentWorkingDirectory); - var generator = new AspNetCoreOpenApiDocumentGenerator(settings); - var document = await generator.GenerateAsync(apiDescriptionProvider.ApiDescriptionGroups).ConfigureAwait(false); - - PostprocessDocument(document); - - return document; - } - - protected override async Task RunIsolatedAsync(AssemblyLoader.AssemblyLoader assemblyLoader) - { - var currentWorkingDirectory = ChangeWorkingDirectoryAndSetAspNetCoreEnvironment(); - var document = await GenerateDocumentAsync(assemblyLoader, GetServiceProvider(assemblyLoader), currentWorkingDirectory); - return UseDocumentProvider ? document.ToJson() : document.ToJson(OutputType); - } - private static void TryDeleteFiles(List files) { foreach (var file in files) diff --git a/src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiGeneratorCommandEntryPoint.cs b/src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiGeneratorCommandEntryPoint.cs index a456b9cd81..3752d116e6 100644 --- a/src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiGeneratorCommandEntryPoint.cs +++ b/src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiGeneratorCommandEntryPoint.cs @@ -19,17 +19,15 @@ internal class AspNetCoreToOpenApiGeneratorCommandEntryPoint { public static void Process(string commandContent, string outputFile, string applicationName) { - var command = JsonConvert.DeserializeObject(commandContent); + var command = JsonConvert.DeserializeObject(commandContent); var previousWorkingDirectory = command.ChangeWorkingDirectoryAndSetAspNetCoreEnvironment(); var assemblyName = new AssemblyName(applicationName); var assembly = Assembly.Load(assemblyName); var serviceProvider = ServiceProviderResolver.GetServiceProvider(assembly); - var assemblyLoader = new AssemblyLoader.AssemblyLoader(); - var document = command.GenerateDocumentAsync(assemblyLoader, serviceProvider, previousWorkingDirectory).GetAwaiter().GetResult(); - - var json = command.UseDocumentProvider ? document.ToJson() : document.ToJson(command.OutputType); + var document = command.GenerateDocumentAsync(serviceProvider, previousWorkingDirectory).GetAwaiter().GetResult(); + var json = document.ToJson(); var outputPathDirectory = Path.GetDirectoryName(outputFile); Directory.CreateDirectory(outputPathDirectory); diff --git a/src/NSwag.Commands/Commands/Generation/ListTypesCommand.cs b/src/NSwag.Commands/Commands/Generation/ListTypesCommand.cs deleted file mode 100644 index 2c1b8ff22b..0000000000 --- a/src/NSwag.Commands/Commands/Generation/ListTypesCommand.cs +++ /dev/null @@ -1,71 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Rico Suter. All rights reserved. -// -// https://github.com/RicoSuter/NSwag/blob/master/LICENSE.md -// Rico Suter, mail@rsuter.com -//----------------------------------------------------------------------- - -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; -using NConsole; -using NJsonSchema.Infrastructure; -using NSwag.AssemblyLoader.Utilities; -using System.IO; - -namespace NSwag.Commands.Generation -{ - [Command(Name = "list-types", Description = "List all types for the given assembly and settings.")] - public class ListTypesCommand : IsolatedCommandBase - { - [Argument(Name = nameof(File), IsRequired = false, Description = "The nswag.json configuration file path.")] - public string File { get; set; } - - [Argument(Name = nameof(Variables), IsRequired = false)] - public string Variables { get; set; } - - public override async Task RunAsync(CommandLineProcessor processor, IConsoleHost host) - { - if (!string.IsNullOrEmpty(File)) - { - var document = await NSwagDocument.LoadWithTransformationsAsync(File, Variables); - var command = (TypesToSwaggerCommand)document.SelectedSwaggerGenerator; - - AssemblyPaths = command.AssemblyPaths; - AssemblyConfig = command.AssemblyConfig; - ReferencePaths = command.ReferencePaths; - } - - var classNames = await RunIsolatedAsync(!string.IsNullOrEmpty(File) ? Path.GetDirectoryName(File) : null); - - host.WriteMessage("\r\n"); - foreach (var className in classNames) - { - host.WriteMessage(className + "\r\n"); - } - - host.WriteMessage("\r\n"); - - return classNames; - } - - protected override Task RunIsolatedAsync(AssemblyLoader.AssemblyLoader assemblyLoader) - { -#if NETFRAMEWORK - var result = PathUtilities.ExpandFileWildcards(AssemblyPaths) - .Select(Assembly.LoadFrom) -#else - var currentDirectory = DynamicApis.DirectoryGetCurrentDirectory(); - var result = PathUtilities.ExpandFileWildcards(AssemblyPaths) - .Select(p => assemblyLoader.Context.LoadFromAssemblyPath(PathUtilities.MakeAbsolutePath(p, currentDirectory))) -#endif - .SelectMany(a => a.ExportedTypes) - .Select(t => t.FullName) - .OrderBy(c => c) - .ToArray(); - - return Task.FromResult(result); - } - } -} \ No newline at end of file diff --git a/src/NSwag.Commands/Commands/Generation/ListWebApiControllersCommand.cs b/src/NSwag.Commands/Commands/Generation/ListWebApiControllersCommand.cs deleted file mode 100644 index 80a3c693dc..0000000000 --- a/src/NSwag.Commands/Commands/Generation/ListWebApiControllersCommand.cs +++ /dev/null @@ -1,73 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Rico Suter. All rights reserved. -// -// https://github.com/RicoSuter/NSwag/blob/master/LICENSE.md -// Rico Suter, mail@rsuter.com -//----------------------------------------------------------------------- - -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; -using NConsole; -using NJsonSchema.Infrastructure; -using NSwag.AssemblyLoader.Utilities; -using NSwag.Generation.WebApi; -using System.IO; -using NSwag.Commands.Generation.WebApi; - -namespace NSwag.Commands.Generation -{ - [Command(Name = "list-controllers", Description = "List all controllers classes for the given assembly and settings.")] - public class ListWebApiControllersCommand : IsolatedCommandBase - { - [Argument(Name = nameof(File), IsRequired = false, Description = "The nswag.json configuration file path.")] - public string File { get; set; } - - [Argument(Name = nameof(Variables), IsRequired = false)] - public string Variables { get; set; } - - public override async Task RunAsync(CommandLineProcessor processor, IConsoleHost host) - { - if (!string.IsNullOrEmpty(File)) - { - var document = await NSwagDocument.LoadWithTransformationsAsync(File, Variables); - var command = (WebApiToSwaggerCommand)document.SelectedSwaggerGenerator; - - AssemblyPaths = command.AssemblyPaths; - AssemblyConfig = command.AssemblyConfig; - ReferencePaths = command.ReferencePaths; - } - - var classNames = await RunIsolatedAsync(!string.IsNullOrEmpty(File) ? Path.GetDirectoryName(File) : null); - - host.WriteMessage("\r\n"); - foreach (var className in classNames) - { - host.WriteMessage(className + "\r\n"); - } - - host.WriteMessage("\r\n"); - - return classNames; - } - - protected override Task RunIsolatedAsync(AssemblyLoader.AssemblyLoader assemblyLoader) - { -#if NETFRAMEWORK - var result = PathUtilities.ExpandFileWildcards(AssemblyPaths) - .Select(Assembly.LoadFrom) -#else - var currentDirectory = DynamicApis.DirectoryGetCurrentDirectory(); - var result = PathUtilities.ExpandFileWildcards(AssemblyPaths) - .Select(p => assemblyLoader.Context.LoadFromAssemblyPath(PathUtilities.MakeAbsolutePath(p, currentDirectory))) -#endif - .SelectMany(WebApiOpenApiDocumentGenerator.GetControllerClasses) - .Select(t => t.FullName) - .OrderBy(c => c) - .ToArray(); - - return Task.FromResult(result); - } - } -} \ No newline at end of file diff --git a/src/NSwag.Commands/Commands/Generation/OpenApiGeneratorCommandBase.cs b/src/NSwag.Commands/Commands/Generation/OpenApiGeneratorCommandBase.cs deleted file mode 100644 index 0b3acbf67f..0000000000 --- a/src/NSwag.Commands/Commands/Generation/OpenApiGeneratorCommandBase.cs +++ /dev/null @@ -1,422 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Rico Suter. All rights reserved. -// -// https://github.com/RicoSuter/NSwag/blob/master/LICENSE.md -// Rico Suter, mail@rsuter.com -//----------------------------------------------------------------------- -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; -using NConsole; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; -using NJsonSchema; -using NJsonSchema.Generation; -using NJsonSchema.Infrastructure; -using NSwag.AssemblyLoader.Utilities; -using NSwag.Generation; -using NSwag.Generation.AspNetCore; -using NSwag.Generation.Processors; - -namespace NSwag.Commands.Generation -{ - /// - public abstract class OpenApiGeneratorCommandBase : IsolatedSwaggerOutputCommandBase - where TSettings : OpenApiDocumentGeneratorSettings, new() - { - /// Initializes a new instance of the class. - protected OpenApiGeneratorCommandBase() - { - Settings = new TSettings(); - } - - [JsonIgnore] - protected override TSettings Settings { get; } - - [Argument(Name = nameof(DefaultPropertyNameHandling), IsRequired = false, Description = "The default property name handling ('Default' or 'CamelCase').")] - public PropertyNameHandling DefaultPropertyNameHandling - { - get => Settings.DefaultPropertyNameHandling; - set => Settings.DefaultPropertyNameHandling = value; - } - - [Argument(Name = nameof(DefaultReferenceTypeNullHandling), IsRequired = false, Description = "The default reference type null handling (Null (default) or NotNull).")] - public ReferenceTypeNullHandling DefaultReferenceTypeNullHandling - { - get => Settings.DefaultReferenceTypeNullHandling; - set => Settings.DefaultReferenceTypeNullHandling = value; - } - - [Argument(Name = nameof(DefaultDictionaryValueReferenceTypeNullHandling), IsRequired = false, Description = "The default reference type null handling of dictionary value types (NotNull (default) or Null).")] - public ReferenceTypeNullHandling DefaultDictionaryValueReferenceTypeNullHandling - { - get => Settings.DefaultDictionaryValueReferenceTypeNullHandling; - set => Settings.DefaultDictionaryValueReferenceTypeNullHandling = value; - } - - [Argument(Name = nameof(DefaultResponseReferenceTypeNullHandling), IsRequired = false, Description = "The default response reference type null handling (default: NotNull (default) or Null).")] - public ReferenceTypeNullHandling DefaultResponseReferenceTypeNullHandling - { - get => Settings.DefaultResponseReferenceTypeNullHandling; - set => Settings.DefaultResponseReferenceTypeNullHandling = value; - } - - [Argument(Name = nameof(GenerateOriginalParameterNames), IsRequired = false, Description = "Generate x-originalName properties when parameter name is differnt in .NET and HTTP (default: true).")] - public bool GenerateOriginalParameterNames - { - get => Settings.GenerateOriginalParameterNames; - set => Settings.GenerateOriginalParameterNames = value; - } - - [Argument(Name = "DefaultEnumHandling", IsRequired = false, Description = "The default enum handling ('String' or 'Integer'), default: Integer.")] - public EnumHandling DefaultEnumHandling - { - get => Settings.DefaultEnumHandling; - set => Settings.DefaultEnumHandling = value; - } - - [Argument(Name = "FlattenInheritanceHierarchy", IsRequired = false, Description = "Flatten the inheritance hierarchy instead of using allOf to describe inheritance (default: false).")] - public bool FlattenInheritanceHierarchy - { - get => Settings.FlattenInheritanceHierarchy; - set => Settings.FlattenInheritanceHierarchy = value; - } - - [Argument(Name = "GenerateKnownTypes", IsRequired = false, Description = "Generate schemas for types in KnownTypeAttribute attributes (default: true).")] - public bool GenerateKnownTypes - { - get => Settings.GenerateKnownTypes; - set => Settings.GenerateKnownTypes = value; - } - - [Argument(Name = "GenerateEnumMappingDescription", IsRequired = false, - Description = "Generate a description with number to enum name mappings (for integer enums only, default: false).")] - public bool GenerateEnumMappingDescription - { - get => Settings.GenerateEnumMappingDescription; - set => Settings.GenerateEnumMappingDescription = value; - } - - [Argument(Name = "GenerateXmlObjects", IsRequired = false, Description = "Generate xmlObject representation for definitions (default: false).")] - public bool GenerateXmlObjects - { - get => Settings.GenerateXmlObjects; - set => Settings.GenerateXmlObjects = value; - } - - [Argument(Name = "GenerateAbstractProperties", IsRequired = false, Description = "Generate abstract properties (i.e. interface and abstract properties. " + - "Properties may defined multiple times in a inheritance hierarchy, default: false).")] - public bool GenerateAbstractProperties - { - get => Settings.GenerateAbstractProperties; - set => Settings.GenerateAbstractProperties = value; - } - - [Argument(Name = "GenerateAbstractSchemas", IsRequired = false, Description = "Generate the x-abstract flag on schemas (default: true).")] - public bool GenerateAbstractSchemas - { - get => Settings.GenerateAbstractSchemas; - set => Settings.GenerateAbstractSchemas = value; - } - - [Argument(Name = "IgnoreObsoleteProperties", IsRequired = false, Description = "Ignore properties with the ObsoleteAttribute (default: false).")] - public bool IgnoreObsoleteProperties - { - get => Settings.IgnoreObsoleteProperties; - set => Settings.IgnoreObsoleteProperties = value; - } - - [Argument(Name = "AllowReferencesWithProperties", IsRequired = false, Description = "Use $ref references even if additional properties are defined on " + - "the object (otherwise allOf/oneOf with $ref is used, default: false).")] - public bool AllowReferencesWithProperties - { - get => Settings.AllowReferencesWithProperties; - set => Settings.AllowReferencesWithProperties = value; - } - - [Argument(Name = "UseXmlDocumentation", IsRequired = false, Description = "Read XML Docs files (default: true).")] - public bool UseXmlDocumentation - { - get => Settings.UseXmlDocumentation; - set => Settings.UseXmlDocumentation = value; - } - - [Argument(Name = "ResolveExternalXmlDocumentation", IsRequired = false, Description = "Resolve the XML Docs from the NuGet cache or .NET SDK directory (default: true).")] - public bool ResolveExternalXmlDocumentation - { - get => Settings.ResolveExternalXmlDocumentation; - set => Settings.ResolveExternalXmlDocumentation = value; - } - - [Argument(Name = "ExcludedTypeNames", IsRequired = false, Description = "The excluded type names (same as JsonSchemaIgnoreAttribute).")] - public string[] ExcludedTypeNames - { - get => Settings.ExcludedTypeNames; - set => Settings.ExcludedTypeNames = value; - } - - [Argument(Name = "ServiceHost", IsRequired = false, Description = "Overrides the service host of the web service (optional, use '.' to remove the hostname).")] - public string ServiceHost { get; set; } - - [Argument(Name = "ServiceBasePath", IsRequired = false, Description = "The basePath of the Swagger specification (optional).")] - public string ServiceBasePath { get; set; } - - [Argument(Name = "ServiceSchemes", IsRequired = false, Description = "Overrides the allowed schemes of the web service (optional, comma separated, 'http', 'https', 'ws', 'wss').")] - public string[] ServiceSchemes { get; set; } = new string[0]; - - [Argument(Name = "InfoTitle", IsRequired = false, Description = "Specify the title of the Swagger specification (ignored when DocumentTemplate is set).")] - public string InfoTitle - { - get => Settings.Title; - set => Settings.Title = value; - } - - [Argument(Name = "InfoDescription", IsRequired = false, Description = "Specify the description of the Swagger specification (ignored when DocumentTemplate is set).")] - public string InfoDescription - { - get => Settings.Description; - set => Settings.Description = value; - } - - [Argument(Name = "InfoVersion", IsRequired = false, Description = "Specify the version of the Swagger specification (default: 1.0.0, ignored when DocumentTemplate is set).")] - public string InfoVersion - { - get => Settings.Version; - set => Settings.Version = value; - } - - [Argument(Name = "DocumentTemplate", IsRequired = false, Description = "Specifies the Swagger document template (may be a path or JSON, default: none).")] - public string DocumentTemplate { get; set; } - - [Argument(Name = "DocumentProcessors", IsRequired = false, Description = "The document processor type names in the form 'assemblyName:fullTypeName' or 'fullTypeName'.")] - public string[] DocumentProcessorTypes { get; set; } = new string[0]; - - [Argument(Name = "OperationProcessors", IsRequired = false, Description = "The operation processor type names in the form 'assemblyName:fullTypeName' or 'fullTypeName' or ':assemblyName:fullTypeName' or ':fullTypeName'. Begin name with ':' to prepend processors (required when used to filter out other operations).")] - public string[] OperationProcessorTypes { get; set; } = new string[0]; - - [Argument(Name = "TypeNameGenerator", IsRequired = false, Description = "The custom ITypeNameGenerator implementation type in the form 'assemblyName:fullTypeName' or 'fullTypeName'.")] - public string TypeNameGeneratorType { get; set; } - - [Argument(Name = "SchemaNameGenerator", IsRequired = false, Description = "The custom ISchemaNameGenerator implementation type in the form 'assemblyName:fullTypeName' or 'fullTypeName'.")] - public string SchemaNameGeneratorType { get; set; } - - [Argument(Name = "ContractResolver", IsRequired = false, Description = "DEPRECATED: The custom IContractResolver implementation type in the form 'assemblyName:fullTypeName' or 'fullTypeName'.")] - public string ContractResolverType { get; set; } - - [Argument(Name = "SerializerSettings", IsRequired = false, Description = "The custom JsonSerializerSettings implementation type in the form 'assemblyName:fullTypeName' or 'fullTypeName'.")] - public string SerializerSettingsType { get; set; } - - [Argument(Name = "UseDocumentProvider", IsRequired = false, Description = "Generate document using SwaggerDocumentProvider (configuration from AddOpenApiDocument()/AddSwaggerDocument(), most CLI settings will be ignored).")] - public bool UseDocumentProvider { get; set; } = true; - - [Argument(Name = "DocumentName", IsRequired = false, Description = "The document name to use in SwaggerDocumentProvider (default: v1).")] - public string DocumentName { get; set; } = "v1"; - - [Argument(Name = "AspNetCoreEnvironment", IsRequired = false, Description = "Sets the ASPNETCORE_ENVIRONMENT if provided (default: empty).")] - public string AspNetCoreEnvironment { get; set; } - - [Argument(Name = "CreateWebHostBuilderMethod", IsRequired = false, Description = "The CreateWebHostBuilder method in the form 'assemblyName:fullTypeName.methodName' or 'fullTypeName.methodName'.")] - public string CreateWebHostBuilderMethod { get; set; } - - [Argument(Name = "Startup", IsRequired = false, Description = "The Startup class type in the form 'assemblyName:fullTypeName' or 'fullTypeName'.")] - public string StartupType { get; set; } - - [Argument(Name = "AllowNullableBodyParameters", IsRequired = false, Description = "Nullable body parameters are allowed (ignored when MvcOptions.AllowEmptyInputInBodyModelBinding is available (ASP.NET Core 2.0+), default: true).")] - public bool AllowNullableBodyParameters - { - get => Settings.AllowNullableBodyParameters; - set => Settings.AllowNullableBodyParameters = value; - } - - [Argument(Name = "UseHttpAttributeNameAsOperationId", IsRequired = false, Description = "Gets or sets a value indicating whether the HttpMethodAttribute Name property shall be used as OperationId.")] - public bool UseHttpAttributeNameAsOperationId - { - get => Settings.UseHttpAttributeNameAsOperationId; - set => Settings.UseHttpAttributeNameAsOperationId = value; - } - - public async Task CreateSettingsAsync(AssemblyLoader.AssemblyLoader assemblyLoader, IServiceProvider serviceProvider, string workingDirectory) - { - var mvcOptions = serviceProvider?.GetRequiredService>().Value; -#if NETCOREAPP3_0_OR_GREATER - JsonSerializerSettings serializerSettings; - try - { - var mvcJsonOptions = serviceProvider?.GetRequiredService>(); - serializerSettings = mvcJsonOptions?.Value?.SerializerSettings; - } - catch - { - serializerSettings = AspNetCoreOpenApiDocumentGenerator.GetSystemTextJsonSettings(serviceProvider); - } -#else - var mvcJsonOptions = serviceProvider?.GetRequiredService>(); - var serializerSettings = mvcJsonOptions?.Value?.SerializerSettings; -#endif - - Settings.ApplySettings(serializerSettings, mvcOptions); - Settings.DocumentTemplate = await GetDocumentTemplateAsync(workingDirectory); - - InitializeCustomTypes(assemblyLoader); - - return Settings; - } - - protected IServiceProvider GetServiceProvider(AssemblyLoader.AssemblyLoader assemblyLoader) - { - if (!string.IsNullOrEmpty(CreateWebHostBuilderMethod)) - { - // Load configured CreateWebHostBuilder method from program type - var segments = CreateWebHostBuilderMethod.Split('.'); - - var programTypeName = string.Join(".", segments.Take(segments.Length - 1)); - var programType = assemblyLoader.GetType(programTypeName) ?? - throw new InvalidOperationException("The Program class could not be determined."); - - var method = programType.GetRuntimeMethod(segments.Last(), new[] { typeof(string[]) }); - if (method != null) - { - return ((IWebHostBuilder)method.Invoke(null, new object[] { new string[0] })).Build().Services; - } - else - { - method = programType.GetRuntimeMethod(segments.Last(), new Type[0]); - if (method != null) - { - return ((IWebHostBuilder)method.Invoke(null, new object[0])).Build().Services; - } - else - { - throw new InvalidOperationException("The CreateWebHostBuilderMethod '" + CreateWebHostBuilderMethod + "' could not be found."); - } - } - } - else if (!string.IsNullOrEmpty(StartupType)) - { - // Load configured startup type (obsolete) - var startupType = assemblyLoader.GetType(StartupType); - return WebHost.CreateDefaultBuilder().UseStartup(startupType).Build().Services; - } - else - { - var assemblies = LoadAssemblies(AssemblyPaths, assemblyLoader); - var firstAssembly = assemblies.FirstOrDefault() ?? throw new InvalidOperationException("No assembly are be loaded from AssemblyPaths."); - return ServiceProviderResolver.GetServiceProvider(firstAssembly); - } - } - - protected void InitializeCustomTypes(AssemblyLoader.AssemblyLoader assemblyLoader) - { - if (DocumentProcessorTypes != null) - { - foreach (var p in DocumentProcessorTypes) - { - var processor = (IDocumentProcessor)assemblyLoader.CreateInstance(p); - Settings.DocumentProcessors.Add(processor); - } - } - - if (OperationProcessorTypes != null) - { - var prependIndex = 0; - foreach (var p in OperationProcessorTypes) - { - var processor = (IOperationProcessor)assemblyLoader.CreateInstance(p[0] == ':' ? p.Substring(1) : p); - if (p[0] == ':') - { - Settings.OperationProcessors.Insert(prependIndex++, processor); - } - else - { - Settings.OperationProcessors.Add(processor); - } - } - } - - if (!string.IsNullOrEmpty(TypeNameGeneratorType)) - { - Settings.TypeNameGenerator = (ITypeNameGenerator)assemblyLoader.CreateInstance(TypeNameGeneratorType); - } - - if (!string.IsNullOrEmpty(SchemaNameGeneratorType)) - { - Settings.SchemaNameGenerator = (ISchemaNameGenerator)assemblyLoader.CreateInstance(SchemaNameGeneratorType); - } - - if (!string.IsNullOrEmpty(ContractResolverType)) - { - Settings.ContractResolver = (IContractResolver)assemblyLoader.CreateInstance(ContractResolverType); - } - - if (!string.IsNullOrEmpty(SerializerSettingsType)) - { - Settings.SerializerSettings = (JsonSerializerSettings)assemblyLoader.CreateInstance(SerializerSettingsType); - } - } - - protected void PostprocessDocument(OpenApiDocument document) - { - if (ServiceHost == ".") - { - document.Host = string.Empty; - } - else if (!string.IsNullOrEmpty(ServiceHost)) - { - document.Host = ServiceHost; - } - - if (ServiceSchemes != null && ServiceSchemes.Any()) - { - document.Schemes = ServiceSchemes - .Select(s => (OpenApiSchema)Enum.Parse(typeof(OpenApiSchema), s, true)) - .ToList(); - } - - if (!string.IsNullOrEmpty(ServiceBasePath)) - { - document.BasePath = ServiceBasePath; - } - } - - private async Task GetDocumentTemplateAsync(string workingDirectory) - { - if (!string.IsNullOrEmpty(DocumentTemplate)) - { - var file = PathUtilities.MakeAbsolutePath(DocumentTemplate, workingDirectory); - if (DynamicApis.FileExists(file)) - { - var json = DynamicApis.FileReadAllText(file); - if (json.StartsWith("{") == false) - { - return (await OpenApiYamlDocument.FromYamlAsync(json)).ToJson(); - } - else - { - return json; - } - } - else if (DocumentTemplate.StartsWith("{") == false) - { - return (await OpenApiYamlDocument.FromYamlAsync(DocumentTemplate)).ToJson(); - } - else - { - return DocumentTemplate; - } - } - else - { - return null; - } - } - } -} diff --git a/src/NSwag.Commands/Commands/Generation/TypesToOpenApiCommand.cs b/src/NSwag.Commands/Commands/Generation/TypesToOpenApiCommand.cs deleted file mode 100644 index f9f4dd981d..0000000000 --- a/src/NSwag.Commands/Commands/Generation/TypesToOpenApiCommand.cs +++ /dev/null @@ -1,159 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Rico Suter. All rights reserved. -// -// https://github.com/RicoSuter/NSwag/blob/master/LICENSE.md -// Rico Suter, mail@rsuter.com -//----------------------------------------------------------------------- - -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; -using NConsole; -using Newtonsoft.Json; -using NJsonSchema; -using NJsonSchema.Generation; -using NJsonSchema.Infrastructure; -using NSwag.AssemblyLoader.Utilities; - -namespace NSwag.Commands.Generation -{ - /// - [Command(Name = "types2openapi")] - public class TypesToOpenApiCommand : TypesToSwaggerCommand - { - } - - /// - [Command(Name = "types2swagger")] - public class TypesToSwaggerCommand : IsolatedSwaggerOutputCommandBase - { - /// Initializes a new instance of the class. - public TypesToSwaggerCommand() - { - Settings = new JsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 }; - ClassNames = new string[] { }; - } - - [JsonIgnore] - protected override JsonSchemaGeneratorSettings Settings { get; } - - [Argument(Name = "ClassNames", Description = "The class names.")] - public string[] ClassNames { get; set; } - - [Argument(Name = "DefaultPropertyNameHandling", IsRequired = false, Description = "The default property name handling ('Default' or 'CamelCase').")] - public PropertyNameHandling DefaultPropertyNameHandling - { - get { return Settings.DefaultPropertyNameHandling; } - set { Settings.DefaultPropertyNameHandling = value; } - } - - [Argument(Name = nameof(DefaultReferenceTypeNullHandling), IsRequired = false, Description = "The default reference type null handling (Null (default) or NotNull).")] - public ReferenceTypeNullHandling DefaultReferenceTypeNullHandling - { - get => Settings.DefaultReferenceTypeNullHandling; - set => Settings.DefaultReferenceTypeNullHandling = value; - } - - [Argument(Name = nameof(DefaultDictionaryValueReferenceTypeNullHandling), IsRequired = false, Description = "The default reference type null handling of dictionary value types (NotNull (default) or Null).")] - public ReferenceTypeNullHandling DefaultDictionaryValueReferenceTypeNullHandling - { - get => Settings.DefaultDictionaryValueReferenceTypeNullHandling; - set => Settings.DefaultDictionaryValueReferenceTypeNullHandling = value; - } - - [Argument(Name = "DefaultEnumHandling", IsRequired = false, Description = "The default enum handling ('String' or 'Integer'), default: Integer.")] - public EnumHandling DefaultEnumHandling - { - get { return Settings.DefaultEnumHandling; } - set { Settings.DefaultEnumHandling = value; } - } - - [Argument(Name = "FlattenInheritanceHierarchy", IsRequired = false, Description = "Flatten the inheritance hierarchy instead of using allOf to describe inheritance (default: false).")] - public bool FlattenInheritanceHierarchy - { - get { return Settings.FlattenInheritanceHierarchy; } - set { Settings.FlattenInheritanceHierarchy = value; } - } - - [Argument(Name = "IgnoreObsoleteProperties", IsRequired = false, Description = "Ignore properties with the ObsoleteAttribute (default: false).")] - public bool IgnoreObsoleteProperties - { - get { return Settings.IgnoreObsoleteProperties; } - set { Settings.IgnoreObsoleteProperties = value; } - } - - [Argument(Name = "AllowReferencesWithProperties", IsRequired = false, Description = "Use $ref references even if additional properties are defined on " + - "the object (otherwise allOf/oneOf with $ref is used, default: false).")] - public bool AllowReferencesWithProperties - { - get { return Settings.AllowReferencesWithProperties; } - set { Settings.AllowReferencesWithProperties = value; } - } - - [Argument(Name = "GenerateKnownTypes", IsRequired = false, Description = "Generate schemas for types in KnownTypeAttribute attributes (default: true).")] - public bool GenerateKnownTypes - { - get { return Settings.GenerateKnownTypes; } - set { Settings.GenerateKnownTypes = value; } - } - - [Argument(Name = "GenerateEnumMappingDescription", IsRequired = false, - Description = "Generate a description with number to enum name mappings (for integer enums only, default: false).")] - public bool GenerateEnumMappingDescription - { - get => Settings.GenerateEnumMappingDescription; - set => Settings.GenerateEnumMappingDescription = value; - } - - [Argument(Name = "GenerateXmlObjects", IsRequired = false, Description = "Generate xmlObject representation for definitions (default: false).")] - public bool GenerateXmlObjects - { - get { return Settings.GenerateXmlObjects; } - set { Settings.GenerateXmlObjects = value; } - } - - [Argument(Name = "UseXmlDocumentation", IsRequired = false, Description = "Read XML Docs files (default: true).")] - public bool UseXmlDocumentation - { - get => Settings.UseXmlDocumentation; - set => Settings.UseXmlDocumentation = value; - } - - [Argument(Name = "ResolveExternalXmlDocumentation", IsRequired = false, Description = "Resolve the XML Docs from the NuGet cache or .NET SDK directory (default: true).")] - public bool ResolveExternalXmlDocumentation - { - get => Settings.ResolveExternalXmlDocumentation; - set => Settings.ResolveExternalXmlDocumentation = value; - } - - protected override Task RunIsolatedAsync(AssemblyLoader.AssemblyLoader assemblyLoader) - { - var document = new OpenApiDocument(); - var generator = new JsonSchemaGenerator(Settings); - var schemaResolver = new OpenApiSchemaResolver(document, Settings); - -#if NETFRAMEWORK - var assemblies = PathUtilities.ExpandFileWildcards(AssemblyPaths) - .Select(path => Assembly.LoadFrom(path)).ToArray(); -#else - var currentDirectory = DynamicApis.DirectoryGetCurrentDirectory(); - var assemblies = PathUtilities.ExpandFileWildcards(AssemblyPaths) - .Select(path => assemblyLoader.Context.LoadFromAssemblyPath(PathUtilities.MakeAbsolutePath(path, currentDirectory))).ToArray(); -#endif - - var allExportedClassNames = assemblies.SelectMany(a => a.ExportedTypes).Select(t => t.FullName).ToList(); - var matchedClassNames = ClassNames - .SelectMany(n => PathUtilities.FindWildcardMatches(n, allExportedClassNames, '.')) - .Distinct(); - - foreach (var className in matchedClassNames) - { - var type = assemblies.Select(a => a.GetType(className)).FirstOrDefault(t => t != null); - generator.Generate(type, schemaResolver); - } - - return Task.FromResult(document.ToJson(OutputType)); - } - } -} \ No newline at end of file diff --git a/src/NSwag.Commands/Commands/Generation/WebApi/WebApiToOpenApiCommand.cs b/src/NSwag.Commands/Commands/Generation/WebApi/WebApiToOpenApiCommand.cs deleted file mode 100644 index 65f048b364..0000000000 --- a/src/NSwag.Commands/Commands/Generation/WebApi/WebApiToOpenApiCommand.cs +++ /dev/null @@ -1,167 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Rico Suter. All rights reserved. -// -// https://github.com/RicoSuter/NSwag/blob/master/LICENSE.md -// Rico Suter, mail@rsuter.com -//----------------------------------------------------------------------- -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; -using Namotion.Reflection; -using NConsole; -using Newtonsoft.Json; -using NJsonSchema.Infrastructure; -using NSwag.AssemblyLoader.Utilities; -using NSwag.Generation.Processors; -using NSwag.Generation.WebApi; - -namespace NSwag.Commands.Generation.WebApi -{ - /// The generator. - [Command(Name = "webapi2openapi", Description = "Generates a Swagger/OpenAPI specification for a controller or controllers contained in a .NET Web API assembly.")] - public class WebApiToOpenApiCommand : WebApiToSwaggerCommand - { - } - - /// The generator. - [Command(Name = "webapi2swagger", Description = "Generates a Swagger/OpenAPI specification for a controller or controllers contained in a .NET Web API assembly (obsolete: use webapi2openapi instead).")] - public class WebApiToSwaggerCommand : OpenApiGeneratorCommandBase - { - /// Initializes a new instance of the class. - public WebApiToSwaggerCommand() - { - ControllerNames = new string[] { }; - } - - [JsonIgnore] - [Argument(Name = "Controller", IsRequired = false, Description = "The Web API controller full class name or empty to load all controllers from the assembly.")] - public string ControllerName - { - get => ControllerNames.FirstOrDefault(); - set => ControllerNames = new[] { value }; - } - - [Argument(Name = "Controllers", IsRequired = false, Description = "The Web API controller full class names or empty to load all controllers from the assembly (comma separated).")] - public string[] ControllerNames { get; set; } - - [Argument(Name = "AspNetCore", IsRequired = false, Description = "Specifies whether the controllers are hosted by ASP.NET Core.")] - public bool IsAspNetCore - { - get => Settings.IsAspNetCore; - set => Settings.IsAspNetCore = value; - } - - [Argument(Name = "ResolveJsonOptions", IsRequired = false, Description = "Specifies whether to resolve MvcJsonOptions to infer serializer settings (recommended, default: false, only available when IsAspNetCore is set).")] - public bool ResolveJsonOptions { get; set; } - - [Argument(Name = "DefaultUrlTemplate", IsRequired = false, Description = "The Web API default URL template (default for Web API: 'api/{controller}/{id}'; for MVC projects: '{controller}/{action}/{id?}').")] - public string DefaultUrlTemplate - { - get => Settings.DefaultUrlTemplate; - set => Settings.DefaultUrlTemplate = value; - } - - [Argument(Name = "AddMissingPathParameters", IsRequired = false, Description = "Specifies whether to add path parameters which are missing in the action method (default: false).")] - public bool AddMissingPathParameters - { - get => Settings.AddMissingPathParameters; - set => Settings.AddMissingPathParameters = value; - } - - [Argument(Name = "IncludedVersions", IsRequired = false, Description = "The included API versions used by the ApiVersionProcessor (comma separated, default: empty = all).")] - public string[] IncludedVersions - { - get => Settings.OperationProcessors.TryGet().IncludedVersions; - set => Settings.OperationProcessors.TryGet().IncludedVersions = value; - } - - protected override async Task RunIsolatedAsync(AssemblyLoader.AssemblyLoader assemblyLoader) - { - var controllerNames = ControllerNames.Where(s => !string.IsNullOrWhiteSpace(s)).Distinct().ToList(); - if (!controllerNames.Any() && AssemblyPaths?.Length > 0) - { - controllerNames = GetControllerNames(assemblyLoader).ToList(); - } - - var controllerTypes = GetControllerTypes(controllerNames, assemblyLoader); - - WebApiOpenApiDocumentGeneratorSettings settings; - var workingDirectory = Directory.GetCurrentDirectory(); - if (IsAspNetCore && ResolveJsonOptions) - { - settings = await CreateSettingsAsync(assemblyLoader, GetServiceProvider(assemblyLoader), workingDirectory); - } - else - { - settings = await CreateSettingsAsync(assemblyLoader, null, workingDirectory); - } - - var generator = new WebApiOpenApiDocumentGenerator(settings); - var document = await generator.GenerateForControllersAsync(controllerTypes).ConfigureAwait(false); - - PostprocessDocument(document); - - return document.ToJson(OutputType); - } - - private string[] GetControllerNames(AssemblyLoader.AssemblyLoader assemblyLoader) - { -#if NETFRAMEWORK - return PathUtilities.ExpandFileWildcards(AssemblyPaths) - .Select(Assembly.LoadFrom) -#else - var currentDirectory = DynamicApis.DirectoryGetCurrentDirectory(); - return PathUtilities.ExpandFileWildcards(AssemblyPaths) - .Select(p => assemblyLoader.Context.LoadFromAssemblyPath(PathUtilities.MakeAbsolutePath(p, currentDirectory))) -#endif - .SelectMany(WebApiOpenApiDocumentGenerator.GetControllerClasses) - .Select(t => t.FullName) - .OrderBy(c => c) - .ToArray(); - } - - private List GetControllerTypes(IEnumerable controllerNames, AssemblyLoader.AssemblyLoader assemblyLoader) -#pragma warning restore 1998 - { - if (AssemblyPaths == null || AssemblyPaths.Length == 0) - { - throw new InvalidOperationException("No assembly paths have been provided."); - } - - var assemblies = LoadAssemblies(AssemblyPaths, assemblyLoader); - - var allExportedNames = assemblies.SelectMany(a => a.ExportedTypes).Select(t => t.FullName).ToList(); - var matchedControllerNames = controllerNames - .SelectMany(n => PathUtilities.FindWildcardMatches(n, allExportedNames, '.')) - .Distinct(); - - var controllerNamesWithoutWildcard = controllerNames.Where(n => !n.Contains("*")).ToArray(); - if (controllerNamesWithoutWildcard.Any(n => !matchedControllerNames.Contains(n))) - { - throw new TypeLoadException("Unable to load type for controllers: " + string.Join(", ", controllerNamesWithoutWildcard)); - } - - var controllerTypes = new List(); - foreach (var className in matchedControllerNames) - { - var controllerType = assemblies.Select(a => a.GetType(className)).FirstOrDefault(t => t != null); - if (controllerType != null) - { - controllerTypes.Add(controllerType); - } - else - { - throw new TypeLoadException("Unable to load type for controller: " + className); - } - } - - return controllerTypes; - } - } -} diff --git a/src/NSwag.Commands/Commands/IsolatedCommandBase.cs b/src/NSwag.Commands/Commands/IsolatedCommandBase.cs deleted file mode 100644 index bb4f1d661a..0000000000 --- a/src/NSwag.Commands/Commands/IsolatedCommandBase.cs +++ /dev/null @@ -1,148 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Rico Suter. All rights reserved. -// -// https://github.com/RicoSuter/NSwag/blob/master/LICENSE.md -// Rico Suter, mail@rsuter.com -//----------------------------------------------------------------------- - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using Namotion.Reflection; -using NConsole; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using NJsonSchema; -using NSwag.Annotations; -using NSwag.AssemblyLoader; -using NSwag.AssemblyLoader.Utilities; -using NSwag.Generation; -using NSwag.Generation.AspNetCore; -using NSwag.Generation.WebApi; - -namespace NSwag.Commands -{ - /// A command which is run in isolation. - public abstract class IsolatedCommandBase : IConsoleCommand - { - [Argument(Name = "Assembly", IsRequired = false, Description = "The path or paths to the .NET assemblies (comma separated).")] - public string[] AssemblyPaths { get; set; } = new string[0]; - - [Argument(Name = "AssemblyConfig", IsRequired = false, Description = "The path to the assembly App.config or Web.config (optional).")] - public string AssemblyConfig { get; set; } - - [Argument(Name = "ReferencePaths", IsRequired = false, Description = "The paths to search for referenced assembly files (comma separated).")] - public string[] ReferencePaths { get; set; } = new string[0]; - - [Argument(Name = "UseNuGetCache", IsRequired = false, Description = "Determines if local Nuget's cache folder should be put in the ReferencePaths by default")] - public bool UseNuGetCache { get; set; } = false; - - public abstract Task RunAsync(CommandLineProcessor processor, IConsoleHost host); - - protected Task RunIsolatedAsync(string configurationFile) - { - var assemblyDirectory = AssemblyPaths.Any() ? Path.GetDirectoryName(Path.GetFullPath(PathUtilities.ExpandFileWildcards(AssemblyPaths).First())) : configurationFile; - var bindingRedirects = GetBindingRedirects(); - var assemblies = GetAssemblies(assemblyDirectory); - - if (UseNuGetCache) - { - var defaultNugetPackages = LoadDefaultNugetCache(); - ReferencePaths = ReferencePaths.Concat(defaultNugetPackages).ToArray(); - } - - using (var isolated = new AppDomainIsolation(assemblyDirectory, AssemblyConfig, bindingRedirects, assemblies)) - { - return Task.FromResult(isolated.Object.Run(GetType().FullName, JsonConvert.SerializeObject(this), AssemblyPaths, ReferencePaths)); - } - } - - protected abstract Task RunIsolatedAsync(AssemblyLoader.AssemblyLoader assemblyLoader); - - private class IsolatedCommandAssemblyLoader : AssemblyLoader.AssemblyLoader - { - internal TResult Run(string commandType, string commandData, string[] assemblyPaths, string[] referencePaths) - { - RegisterReferencePaths(GetAllReferencePaths(assemblyPaths, referencePaths)); - - var type = Type.GetType(commandType); - var command = (IsolatedCommandBase)JsonConvert.DeserializeObject(commandData, type); - - return command.RunIsolatedAsync(this).GetAwaiter().GetResult(); - } - } - - private static string[] GetAllReferencePaths(string[] assemblyPaths, string[] referencePaths) - { - return assemblyPaths.Select(p => Path.GetDirectoryName(PathUtilities.MakeAbsolutePath(p, Directory.GetCurrentDirectory()))) - .Concat(referencePaths) - .Distinct() - .ToArray(); - } - - private static string[] LoadDefaultNugetCache() - { - var path = Environment.GetEnvironmentVariable("NUGET_PACKAGES"); - - if (String.IsNullOrEmpty(path)) - { - var envHome = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "USERPROFILE" : "HOME"; - var home = Environment.GetEnvironmentVariable(envHome); - path = Path.Combine(home, ".nuget", "packages"); - } - - return new[] { Path.GetFullPath(path) }; - } - -#if NET461 - public IEnumerable GetAssemblies(string assemblyDirectory) - { - var codeBaseDirectory = Path.GetDirectoryName(new Uri(typeof(IsolatedCommandBase<>).GetTypeInfo().Assembly.CodeBase).LocalPath); - - yield return codeBaseDirectory + Path.DirectorySeparatorChar + "Newtonsoft.Json.dll"; - yield return codeBaseDirectory + Path.DirectorySeparatorChar + "NJsonSchema.dll"; - yield return codeBaseDirectory + Path.DirectorySeparatorChar + "NSwag.Core.dll"; - yield return codeBaseDirectory + Path.DirectorySeparatorChar + "NSwag.Commands.dll"; - yield return codeBaseDirectory + Path.DirectorySeparatorChar + "NSwag.Generation.dll"; - yield return codeBaseDirectory + Path.DirectorySeparatorChar + "NSwag.Generation.WebApi.dll"; - yield return codeBaseDirectory + Path.DirectorySeparatorChar + "NSwag.Generation.AspNetCore.dll"; - } -#else - public IEnumerable GetAssemblies(string assemblyDirectory) - { - yield return typeof(JToken).GetTypeInfo().Assembly; - yield return typeof(ContextualType).GetTypeInfo().Assembly; - yield return typeof(JsonSchema).GetTypeInfo().Assembly; - yield return typeof(OpenApiDocument).GetTypeInfo().Assembly; - yield return typeof(InputOutputCommandBase).GetTypeInfo().Assembly; - yield return typeof(OpenApiSchemaGenerator).GetTypeInfo().Assembly; - yield return typeof(WebApiOpenApiDocumentGenerator).GetTypeInfo().Assembly; - yield return typeof(AspNetCoreOpenApiDocumentGeneratorSettings).GetTypeInfo().Assembly; - yield return typeof(OpenApiYamlDocument).GetTypeInfo().Assembly; - } -#endif - - public IEnumerable GetBindingRedirects() - { -#if NET461 - yield return new BindingRedirect("Newtonsoft.Json", typeof(JToken), "30ad4fe6b2a6aeed"); - yield return new BindingRedirect("Namotion.Reflection", typeof(ContextualType), "c2f9c3bdfae56102"); - yield return new BindingRedirect("NJsonSchema", typeof(JsonSchema), "c2f9c3bdfae56102"); - yield return new BindingRedirect("NSwag.Core", typeof(OpenApiDocument), "c2d88086e098d109"); - yield return new BindingRedirect("NSwag.Generation", typeof(OpenApiSchemaGenerator), "c2d88086e098d109"); - yield return new BindingRedirect("NSwag.Generation.WebApi", typeof(WebApiOpenApiDocumentGenerator), "c2d88086e098d109"); - yield return new BindingRedirect("NSwag.Generation.AspNetCore", typeof(AspNetCoreOpenApiDocumentGenerator), "c2d88086e098d109"); - yield return new BindingRedirect("NSwag.Annotations", typeof(SwaggerTagsAttribute), "c2d88086e098d109"); - yield return new BindingRedirect("NSwag.Core.Yaml", typeof(OpenApiYamlDocument), "c2d88086e098d109"); - yield return new BindingRedirect("System.Runtime", "4.0.0.0", "b03f5f7f11d50a3a"); -#else - return new BindingRedirect[0]; -#endif - } - } -} diff --git a/src/NSwag.Commands/Commands/IsolatedSwaggerOutputCommandBase.cs b/src/NSwag.Commands/Commands/IsolatedSwaggerOutputCommandBase.cs deleted file mode 100644 index 6e0d9bc582..0000000000 --- a/src/NSwag.Commands/Commands/IsolatedSwaggerOutputCommandBase.cs +++ /dev/null @@ -1,71 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Rico Suter. All rights reserved. -// -// https://github.com/RicoSuter/NSwag/blob/master/LICENSE.md -// Rico Suter, mail@rsuter.com -//----------------------------------------------------------------------- -#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member - -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Threading.Tasks; -using NConsole; -using Newtonsoft.Json; -using NJsonSchema; -using NJsonSchema.Generation; -using NJsonSchema.Infrastructure; -using NJsonSchema.Yaml; -using NSwag.AssemblyLoader.Utilities; - -namespace NSwag.Commands -{ - /// A command which is run in isolation. - public abstract class IsolatedSwaggerOutputCommandBase : IsolatedCommandBase, IOutputCommand - where T : JsonSchemaGeneratorSettings - { - [JsonIgnore] - protected abstract T Settings { get; } - - [Argument(Name = "Output", IsRequired = false, Description = "The output file path (optional).")] - [JsonProperty("output", NullValueHandling = NullValueHandling.Include)] - public string OutputFilePath { get; set; } - - [Argument(Name = "OutputType", IsRequired = false, Description = "Specifies the output schema type, ignored when UseDocumentProvider is enabled (Swagger2|OpenApi3, default: Swagger2).")] - public SchemaType OutputType - { - get { return Settings.SchemaType; } - set { Settings.SchemaType = value; } - } - - [Argument(Name = "NewLineBehavior", IsRequired = false, Description = "The new line behavior (Auto (OS default), CRLF, LF).")] - [JsonProperty("newLineBehavior", NullValueHandling = NullValueHandling.Include)] - public NewLineBehavior NewLineBehavior { get; set; } = NewLineBehavior.Auto; - - public override async Task RunAsync(CommandLineProcessor processor, IConsoleHost host) - { - JsonReferenceResolver ReferenceResolverFactory(OpenApiDocument d) => - new JsonAndYamlReferenceResolver(new JsonSchemaResolver(d, Settings)); - - var documentJson = await RunIsolatedAsync((string)null); - var document = await OpenApiDocument.FromJsonAsync(documentJson, null, OutputType, ReferenceResolverFactory).ConfigureAwait(false); - await this.TryWriteDocumentOutputAsync(host, NewLineBehavior, () => document).ConfigureAwait(false); - return document; - } - - protected Assembly[] LoadAssemblies(IEnumerable assemblyPaths, AssemblyLoader.AssemblyLoader assemblyLoader) - { -#if NETFRAMEWORK - var assemblies = PathUtilities.ExpandFileWildcards(assemblyPaths) - .Select(path => Assembly.LoadFrom(path)).ToArray(); -#else - var currentDirectory = DynamicApis.DirectoryGetCurrentDirectory(); - var assemblies = PathUtilities.ExpandFileWildcards(assemblyPaths) - .Select(path => assemblyLoader.Context.LoadFromAssemblyPath(PathUtilities.MakeAbsolutePath(path, currentDirectory))) - .ToArray(); -#endif - return assemblies; - } - } -} \ No newline at end of file diff --git a/src/NSwag.Commands/NSwag.Commands.csproj b/src/NSwag.Commands/NSwag.Commands.csproj index 3961cc38d7..7f4ef0ea72 100644 --- a/src/NSwag.Commands/NSwag.Commands.csproj +++ b/src/NSwag.Commands/NSwag.Commands.csproj @@ -1,72 +1,63 @@  - - net461;netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 + net462;netcoreapp3.1;net6.0;net7.0 bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml $(NoWarn),618,1591 - + - + - + - - + - - - - - - - - - + - - + - - - + + - - + + + + + + - - + + - + - @@ -76,5 +67,4 @@ - - + \ No newline at end of file diff --git a/src/NSwag.Commands/NSwagDocument.cs b/src/NSwag.Commands/NSwagDocument.cs index 898401894b..a31fdede8d 100644 --- a/src/NSwag.Commands/NSwagDocument.cs +++ b/src/NSwag.Commands/NSwagDocument.cs @@ -12,12 +12,10 @@ using System.IO; using System.Linq; using System.Reflection; +using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; -using NSwag.AssemblyLoader.Utilities; -using NSwag.Commands.Generation; using NSwag.Commands.Generation.AspNetCore; -using NSwag.Commands.Generation.WebApi; namespace NSwag.Commands { @@ -25,7 +23,7 @@ namespace NSwag.Commands /// public class NSwagDocument : NSwagDocumentBase { -#if NET461 +#if NET462 /// Gets or sets the root binary directory where the command line executables loaded from. public static string RootBinaryDirectory { get; set; } = @@ -36,8 +34,6 @@ public class NSwagDocument : NSwagDocumentBase public NSwagDocument() { SwaggerGenerators.AspNetCoreToOpenApiCommand = new AspNetCoreToOpenApiCommand(); - SwaggerGenerators.WebApiToOpenApiCommand = new WebApiToOpenApiCommand(); - SwaggerGenerators.TypesToOpenApiCommand = new TypesToOpenApiCommand(); } /// Creates a new NSwagDocument. @@ -52,12 +48,7 @@ public static NSwagDocument Create() /// The document. public static Task LoadAsync(string filePath) { - return LoadAsync(filePath, null, false, new Dictionary - { - { typeof(AspNetCoreToSwaggerCommand), typeof(AspNetCoreToSwaggerCommand) }, - { typeof(WebApiToSwaggerCommand), typeof(WebApiToSwaggerCommand) }, - { typeof(TypesToSwaggerCommand), typeof(TypesToSwaggerCommand) } - }); + return LoadAsync(filePath, null, false); } /// Loads an existing NSwagDocument with environment variable expansions and variables. @@ -66,12 +57,7 @@ public static Task LoadAsync(string filePath) /// The document. public static Task LoadWithTransformationsAsync(string filePath, string variables) { - return LoadAsync(filePath, variables, true, new Dictionary - { - { typeof(AspNetCoreToSwaggerCommand), typeof(AspNetCoreToSwaggerCommand) }, - { typeof(WebApiToSwaggerCommand), typeof(WebApiToSwaggerCommand) }, - { typeof(TypesToSwaggerCommand), typeof(TypesToSwaggerCommand) } - }); + return LoadAsync(filePath, variables, true); } /// Executes the document. @@ -151,52 +137,6 @@ public async Task ExecuteCommandLineAsync(bool r } } - /// Gets the available controller types by calling the command line. - /// The controller names. - public async Task GetControllersFromCommandLineAsync() - { - if (SelectedSwaggerGenerator is not WebApiToSwaggerCommand) - { - return Array.Empty(); - } - - var baseFilename = System.IO.Path.GetTempPath() + "nswag_document_" + Guid.NewGuid(); - var configFilename = baseFilename + "_config.json"; - File.WriteAllText(configFilename, ToJson()); - try - { - var command = "list-controllers /file:\"" + configFilename + "\""; - return GetListFromCommandLineOutput(await StartCommandLineProcessAsync(command)); - } - finally - { - DeleteFileIfExists(configFilename); - } - } - - /// Gets the available controller types by calling the command line. - /// The controller names. - public async Task GetTypesFromCommandLineAsync() - { - if (SelectedSwaggerGenerator is not TypesToSwaggerCommand) - { - return Array.Empty(); - } - - var baseFilename = System.IO.Path.GetTempPath() + "nswag_document_" + Guid.NewGuid(); - var configFilename = baseFilename + "_config.json"; - File.WriteAllText(configFilename, ToJson()); - try - { - var command = "list-types /file:\"" + configFilename + "\""; - return GetListFromCommandLineOutput(await StartCommandLineProcessAsync(command)); - } - finally - { - DeleteFileIfExists(configFilename); - } - } - /// Converts to absolute path. /// The path to convert. /// The absolute path. @@ -223,15 +163,6 @@ protected override string ConvertToRelativePath(string pathToConvert) return pathToConvert?.Replace("\\", "/"); } - private string[] GetListFromCommandLineOutput(string output) - { - return output.Replace("\r\n", "\n") - .Split(new string[] { "\n\n" }, StringSplitOptions.None)[1] - .Split('\n') - .Where(t => !string.IsNullOrEmpty(t)) - .ToArray(); - } - private OpenApiDocumentExecutionResult ProcessExecutionResult(string output, string baseFilename, bool redirectOutput) { var swaggerOutput = ReadFileIfExists(SelectedSwaggerGenerator.OutputFilePath); @@ -305,21 +236,13 @@ private string GetDocumentDirectory() private string GetArgumentsPrefix() { -#if NET461 +#if NET462 - var runtime = Runtime != Runtime.Default ? Runtime : RuntimeUtilities.CurrentRuntime; - if (runtime == Runtime.NetCore21) - { - return "\"" + System.IO.Path.Combine(RootBinaryDirectory, "NetCore21/dotnet-nswag.dll") + "\" "; - } - else if (runtime == Runtime.NetCore31) + var runtime = Runtime != Runtime.Default ? Runtime : RuntimeUtilities.CurrentRuntime; + if (runtime == Runtime.NetCore31) { return "\"" + System.IO.Path.Combine(RootBinaryDirectory, "NetCore31/dotnet-nswag.dll") + "\" "; } - else if (runtime == Runtime.Net50) - { - return "\"" + System.IO.Path.Combine(RootBinaryDirectory, "Net50/dotnet-nswag.dll") + "\" "; - } else if (runtime == Runtime.Net60) { return "\"" + System.IO.Path.Combine(RootBinaryDirectory, "Net60/dotnet-nswag.dll") + "\" "; @@ -335,9 +258,9 @@ private string GetArgumentsPrefix() private string GetProgramName() { -#if NET461 +#if NET462 - var runtime = Runtime != Runtime.Default ? Runtime : RuntimeUtilities.CurrentRuntime; + var runtime = Runtime != Runtime.Default ? Runtime : RuntimeUtilities.CurrentRuntime; if (runtime == Runtime.WinX64 || runtime == Runtime.Debug) { return System.IO.Path.Combine(RootBinaryDirectory, "Win/nswag.exe"); diff --git a/src/NSwag.Commands/NSwagDocumentBase.cs b/src/NSwag.Commands/NSwagDocumentBase.cs index 4948d3e25b..4e60e2345c 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.NetCore21; + public Runtime Runtime { get; set; } = Runtime.Net60; /// Gets or sets the default variables. public string DefaultVariables { get; set; } @@ -163,13 +163,11 @@ protected static TDocument Create() /// The file path. /// The variables. /// Specifies whether to expand environment variables and convert variables. - /// The mappings. /// The document. protected static async Task LoadAsync( string filePath, string variables, - bool applyTransformations, - IDictionary mappings) + bool applyTransformations) where TDocument : NSwagDocumentBase, new() { var data = DynamicApis.FileReadAllText(filePath); @@ -178,7 +176,7 @@ protected static async Task LoadAsync( if (requiredLegacyTransformations) { // Save now to avoid transformations - var document = LoadDocument(filePath, mappings, data); + var document = LoadDocument(filePath, data); await document.SaveAsync(); } @@ -202,15 +200,12 @@ protected static async Task LoadAsync( } } - return LoadDocument(filePath, mappings, data); + return LoadDocument(filePath, data); } - private static TDocument LoadDocument(string filePath, IDictionary mappings, string data) + private static TDocument LoadDocument(string filePath, string data) where TDocument : NSwagDocumentBase, new() { - var settings = GetSerializerSettings(); - settings.ContractResolver = new BaseTypeMappingContractResolver(mappings); - var document = FromJson(filePath, data); return document; } @@ -325,31 +320,8 @@ private void ConvertToAbsolutePaths() } } - if (SwaggerGenerators.WebApiToOpenApiCommand != null) - { - SwaggerGenerators.WebApiToOpenApiCommand.AssemblyPaths = - SwaggerGenerators.WebApiToOpenApiCommand.AssemblyPaths.Select(ConvertToAbsolutePath).ToArray(); - SwaggerGenerators.WebApiToOpenApiCommand.ReferencePaths = - SwaggerGenerators.WebApiToOpenApiCommand.ReferencePaths.Select(ConvertToAbsolutePath).ToArray(); - - SwaggerGenerators.WebApiToOpenApiCommand.DocumentTemplate = ConvertToAbsolutePath( - SwaggerGenerators.WebApiToOpenApiCommand.DocumentTemplate); - SwaggerGenerators.WebApiToOpenApiCommand.AssemblyConfig = ConvertToAbsolutePath( - SwaggerGenerators.WebApiToOpenApiCommand.AssemblyConfig); - } - if (SwaggerGenerators.AspNetCoreToOpenApiCommand != null) { - SwaggerGenerators.AspNetCoreToOpenApiCommand.AssemblyPaths = - SwaggerGenerators.AspNetCoreToOpenApiCommand.AssemblyPaths.Select(ConvertToAbsolutePath).ToArray(); - SwaggerGenerators.AspNetCoreToOpenApiCommand.ReferencePaths = - SwaggerGenerators.AspNetCoreToOpenApiCommand.ReferencePaths.Select(ConvertToAbsolutePath).ToArray(); - - SwaggerGenerators.AspNetCoreToOpenApiCommand.DocumentTemplate = ConvertToAbsolutePath( - SwaggerGenerators.AspNetCoreToOpenApiCommand.DocumentTemplate); - SwaggerGenerators.AspNetCoreToOpenApiCommand.AssemblyConfig = ConvertToAbsolutePath( - SwaggerGenerators.AspNetCoreToOpenApiCommand.AssemblyConfig); - SwaggerGenerators.AspNetCoreToOpenApiCommand.Project = ConvertToAbsolutePath( SwaggerGenerators.AspNetCoreToOpenApiCommand.Project); SwaggerGenerators.AspNetCoreToOpenApiCommand.MSBuildProjectExtensionsPath = ConvertToAbsolutePath( @@ -359,14 +331,6 @@ private void ConvertToAbsolutePaths() SwaggerGenerators.AspNetCoreToOpenApiCommand.WorkingDirectory); } - if (SwaggerGenerators.TypesToOpenApiCommand != null) - { - SwaggerGenerators.TypesToOpenApiCommand.AssemblyPaths = - SwaggerGenerators.TypesToOpenApiCommand.AssemblyPaths.Select(ConvertToAbsolutePath).ToArray(); - SwaggerGenerators.TypesToOpenApiCommand.AssemblyConfig = ConvertToAbsolutePath( - SwaggerGenerators.TypesToOpenApiCommand.AssemblyConfig); - } - if (CodeGenerators.OpenApiToTypeScriptClientCommand != null) { CodeGenerators.OpenApiToTypeScriptClientCommand.ExtensionCode = ConvertToAbsolutePath( @@ -420,31 +384,8 @@ private void ConvertToRelativePaths() } } - if (SwaggerGenerators.WebApiToOpenApiCommand != null) - { - SwaggerGenerators.WebApiToOpenApiCommand.AssemblyPaths = - SwaggerGenerators.WebApiToOpenApiCommand.AssemblyPaths.Select(ConvertToRelativePath).ToArray(); - SwaggerGenerators.WebApiToOpenApiCommand.ReferencePaths = - SwaggerGenerators.WebApiToOpenApiCommand.ReferencePaths.Select(ConvertToRelativePath).ToArray(); - - SwaggerGenerators.WebApiToOpenApiCommand.DocumentTemplate = ConvertToRelativePath( - SwaggerGenerators.WebApiToOpenApiCommand.DocumentTemplate); - SwaggerGenerators.WebApiToOpenApiCommand.AssemblyConfig = ConvertToRelativePath( - SwaggerGenerators.WebApiToOpenApiCommand.AssemblyConfig); - } - if (SwaggerGenerators.AspNetCoreToOpenApiCommand != null) { - SwaggerGenerators.AspNetCoreToOpenApiCommand.AssemblyPaths = - SwaggerGenerators.AspNetCoreToOpenApiCommand.AssemblyPaths.Select(ConvertToRelativePath).ToArray(); - SwaggerGenerators.AspNetCoreToOpenApiCommand.ReferencePaths = - SwaggerGenerators.AspNetCoreToOpenApiCommand.ReferencePaths.Select(ConvertToRelativePath).ToArray(); - - SwaggerGenerators.AspNetCoreToOpenApiCommand.DocumentTemplate = ConvertToRelativePath( - SwaggerGenerators.AspNetCoreToOpenApiCommand.DocumentTemplate); - SwaggerGenerators.AspNetCoreToOpenApiCommand.AssemblyConfig = ConvertToRelativePath( - SwaggerGenerators.AspNetCoreToOpenApiCommand.AssemblyConfig); - SwaggerGenerators.AspNetCoreToOpenApiCommand.Project = ConvertToRelativePath( SwaggerGenerators.AspNetCoreToOpenApiCommand.Project); SwaggerGenerators.AspNetCoreToOpenApiCommand.MSBuildProjectExtensionsPath = ConvertToRelativePath( @@ -454,15 +395,6 @@ private void ConvertToRelativePaths() SwaggerGenerators.AspNetCoreToOpenApiCommand.WorkingDirectory); } - - if (SwaggerGenerators.TypesToOpenApiCommand != null) - { - SwaggerGenerators.TypesToOpenApiCommand.AssemblyPaths = - SwaggerGenerators.TypesToOpenApiCommand.AssemblyPaths.Select(ConvertToRelativePath).ToArray(); - SwaggerGenerators.TypesToOpenApiCommand.AssemblyConfig = ConvertToRelativePath( - SwaggerGenerators.TypesToOpenApiCommand.AssemblyConfig); - } - if (CodeGenerators.OpenApiToTypeScriptClientCommand != null) { CodeGenerators.OpenApiToTypeScriptClientCommand.ExtensionCode = ConvertToRelativePath( diff --git a/src/NSwag.Commands/OpenApiGeneratorCollection.cs b/src/NSwag.Commands/OpenApiGeneratorCollection.cs index 83b965a4a2..87086be628 100644 --- a/src/NSwag.Commands/OpenApiGeneratorCollection.cs +++ b/src/NSwag.Commands/OpenApiGeneratorCollection.cs @@ -3,7 +3,6 @@ using NSwag.Commands.CodeGeneration; using NSwag.Commands.Generation; using NSwag.Commands.Generation.AspNetCore; -using NSwag.Commands.Generation.WebApi; namespace NSwag.Commands { @@ -18,26 +17,16 @@ public class OpenApiGeneratorCollection [JsonIgnore] public JsonSchemaToOpenApiCommand JsonSchemaToOpenApiCommand { get; set; } - /// Gets or sets the Web API to swagger command. - [JsonIgnore] - public WebApiToOpenApiCommand WebApiToOpenApiCommand { get; set; } - /// Gets or sets the ASP.NET Core to swagger command. [JsonIgnore] public AspNetCoreToOpenApiCommand AspNetCoreToOpenApiCommand { get; set; } - /// Gets or sets the assembly type to swagger command. - [JsonIgnore] - public TypesToOpenApiCommand TypesToOpenApiCommand { get; set; } - /// Gets the items. [JsonIgnore] public IEnumerable Items => new IOutputCommand[] { FromDocumentCommand, JsonSchemaToOpenApiCommand, - WebApiToOpenApiCommand, - TypesToOpenApiCommand, AspNetCoreToOpenApiCommand }; } diff --git a/src/NSwag.AssemblyLoader/Utilities/PathUtilities.cs b/src/NSwag.Commands/PathUtilities.cs similarity index 97% rename from src/NSwag.AssemblyLoader/Utilities/PathUtilities.cs rename to src/NSwag.Commands/PathUtilities.cs index bcbb8fc8b3..0595324ada 100644 --- a/src/NSwag.AssemblyLoader/Utilities/PathUtilities.cs +++ b/src/NSwag.Commands/PathUtilities.cs @@ -1,5 +1,5 @@ //----------------------------------------------------------------------- -// +// // Copyright (c) Rico Suter. All rights reserved. // // https://github.com/RicoSuter/NSwag/blob/master/LICENSE.md @@ -13,11 +13,8 @@ using System.Text; using System.Text.RegularExpressions; -namespace NSwag.AssemblyLoader.Utilities +namespace NSwag.Commands { - // TODO: Move to MyToolkit - - /// Provides file path utility methods. public static class PathUtilities { /// Expands the given wildcards (** or *) in the path. diff --git a/src/NSwag.Commands/Runtime.cs b/src/NSwag.Commands/Runtime.cs index d05b3ca628..f3b3f2b19b 100644 --- a/src/NSwag.Commands/Runtime.cs +++ b/src/NSwag.Commands/Runtime.cs @@ -20,15 +20,9 @@ public enum Runtime /// Full .NET framework, x86. WinX86, - /// .NET Core 2.1 app. - NetCore21, - /// .NET Core 3.1 app. NetCore31, - /// .NET 5 app. - Net50, - /// .NET 6 app. Net60, diff --git a/src/NSwag.Commands/RuntimeUtilities.cs b/src/NSwag.Commands/RuntimeUtilities.cs index cb9958b386..bd57f17c00 100644 --- a/src/NSwag.Commands/RuntimeUtilities.cs +++ b/src/NSwag.Commands/RuntimeUtilities.cs @@ -25,11 +25,7 @@ public static Runtime CurrentRuntime var framework = PlatformServices.Default.Application.RuntimeFramework; if (framework.Identifier == ".NETCoreApp") { - if (framework.Version.Major == 2) - { - return Runtime.NetCore21; - } - else if (framework.Version.Major >= 7) + if (framework.Version.Major >= 7) { return Runtime.Net70; } @@ -37,16 +33,12 @@ public static Runtime CurrentRuntime { return Runtime.Net60; } - else if (framework.Version.Major >= 5) - { - return Runtime.Net50; - } else if (framework.Version.Major >= 3) { return Runtime.NetCore31; } - return Runtime.NetCore21; + return Runtime.Net60; } return IntPtr.Size == 4 ? Runtime.WinX86 : Runtime.WinX64; #endif diff --git a/src/NSwag.Console.x86/NSwag.Console.x86.csproj b/src/NSwag.Console.x86/NSwag.Console.x86.csproj index 50a0134a70..198ccb4fed 100644 --- a/src/NSwag.Console.x86/NSwag.Console.x86.csproj +++ b/src/NSwag.Console.x86/NSwag.Console.x86.csproj @@ -1,6 +1,6 @@  - net461 + net462 Exe exe @@ -10,16 +10,19 @@ x86 true - + + TRACE;DEBUG;net46 + + - - + + @@ -27,13 +30,14 @@ + - + ..\libs\System.IO.dll diff --git a/src/NSwag.Console/NSwag.Console.csproj b/src/NSwag.Console/NSwag.Console.csproj index e0e14afc5a..05af4e1a73 100644 --- a/src/NSwag.Console/NSwag.Console.csproj +++ b/src/NSwag.Console/NSwag.Console.csproj @@ -1,6 +1,6 @@  - net461 + net462 Exe exe @@ -9,19 +9,23 @@ NSwag true - - TRACE;DEBUG;net46 + + + TRACE;DEBUG;net462 - + + bin\$(Configuration)\ - + + bin\$(Configuration)\ + - - + + @@ -29,13 +33,14 @@ + - + ..\libs\System.IO.dll diff --git a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET60Minimal_targetFramework=net6.0.verified.txt b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET60Minimal_targetFramework=net6.0.verified.txt new file mode 100644 index 0000000000..3b5c62e1a2 --- /dev/null +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET60Minimal_targetFramework=net6.0.verified.txt @@ -0,0 +1,95 @@ +{ + "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" + } + } + } + } + } + } + }, + "/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.Sample.NET50/openapi.json b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET60_targetFramework=net6.0.verified.txt similarity index 98% rename from src/NSwag.Sample.NET50/openapi.json rename to src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET60_targetFramework=net6.0.verified.txt index b056765f37..b41ebf2463 100644 --- a/src/NSwag.Sample.NET50/openapi.json +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET60_targetFramework=net6.0.verified.txt @@ -1,5 +1,5 @@ -{ - "x-generator": "NSwag v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v12.0.0.0))", +{ + "x-generator": "NSwag", "openapi": "3.0.0", "info": { "title": "My Title", diff --git a/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET70Minimal_targetFramework=net7.0.verified.txt b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET70Minimal_targetFramework=net7.0.verified.txt new file mode 100644 index 0000000000..3b5c62e1a2 --- /dev/null +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET70Minimal_targetFramework=net7.0.verified.txt @@ -0,0 +1,95 @@ +{ + "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" + } + } + } + } + } + } + }, + "/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.NET70_targetFramework=net7.0.verified.txt b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET70_targetFramework=net7.0.verified.txt new file mode 100644 index 0000000000..b41ebf2463 --- /dev/null +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.Should_generate_openapi_for_project_projectName=NSwag.Sample.NET70_targetFramework=net7.0.verified.txt @@ -0,0 +1,215 @@ +{ + "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/{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 new file mode 100644 index 0000000000..077b9c1858 --- /dev/null +++ b/src/NSwag.ConsoleCore.Tests/GenerateSampleSpecificationTests.cs @@ -0,0 +1,53 @@ +using System.Diagnostics; +using System.IO; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using VerifyTests; +using VerifyXunit; +using Xunit; + +namespace NSwag.ConsoleCore.Tests +{ + [UsesVerify] + public class GenerateSampleSpecificationTests + { + [Theory] + [InlineData("NSwag.Sample.NET60", "net6.0")] + [InlineData("NSwag.Sample.NET60Minimal", "net6.0")] + [InlineData("NSwag.Sample.NET70", "net7.0")] + [InlineData("NSwag.Sample.NET70Minimal", "net7.0")] + public async Task Should_generate_openapi_for_project(string projectName, string targetFramework) + { + // Arrange +#if DEBUG + var executablePath = $"../../../../NSwag.ConsoleCore/bin/Debug/{targetFramework}/dotnet-nswag.dll"; +#else + var executablePath = $"../../../../NSwag.ConsoleCore/bin/Release/{targetFramework}/dotnet-nswag.dll"; +#endif + var nswagJsonPath = $"../../../../{projectName}/nswag.json"; + var openApiJsonPath = $"../../../../{projectName}/openapi.json"; + + File.Delete(openApiJsonPath); + Assert.False(File.Exists(openApiJsonPath)); + + // Act + var process = Process.Start(new ProcessStartInfo + { + FileName = "dotnet", + Arguments = executablePath + " run " + nswagJsonPath, + CreateNoWindow = true, + }); + + process.WaitForExit(20000); + process.Kill(); + + // Assert + Assert.Equal(0, process.ExitCode); + + var json = File.ReadAllText(openApiJsonPath); + json = Regex.Replace(json, "\"NSwag v.*\"", "\"NSwag\""); + + await Verifier.Verify(json).UseParameters(projectName, targetFramework); + } + } +} \ No newline at end of file diff --git a/src/NSwag.AssemblyLoader.Tests/NSwag.AssemblyLoader.Tests.csproj b/src/NSwag.ConsoleCore.Tests/NSwag.ConsoleCore.Tests.csproj similarity index 55% rename from src/NSwag.AssemblyLoader.Tests/NSwag.AssemblyLoader.Tests.csproj rename to src/NSwag.ConsoleCore.Tests/NSwag.ConsoleCore.Tests.csproj index a9bed4490e..3b7672a41b 100644 --- a/src/NSwag.AssemblyLoader.Tests/NSwag.AssemblyLoader.Tests.csproj +++ b/src/NSwag.ConsoleCore.Tests/NSwag.ConsoleCore.Tests.csproj @@ -1,14 +1,18 @@  - netcoreapp2.1;net461 - false + net7.0 + + + - + + + diff --git a/src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj b/src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj index 2899db20f1..0ff826ddcd 100644 --- a/src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj +++ b/src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj @@ -1,6 +1,6 @@  - netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 + netcoreapp3.1;net6.0;net7.0 Exe dotnet-nswag NSwag.ConsoleCore @@ -13,37 +13,23 @@ - - - - - - + - - - - - - - - + - - + - - + diff --git a/src/NSwag.Core.Tests/NSwag.Core.Tests.csproj b/src/NSwag.Core.Tests/NSwag.Core.Tests.csproj index b9a45c53e3..a29d4eb50d 100644 --- a/src/NSwag.Core.Tests/NSwag.Core.Tests.csproj +++ b/src/NSwag.Core.Tests/NSwag.Core.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + net7.0 false $(NoWarn),618 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 bb926d4a07..b728c614e4 100644 --- a/src/NSwag.Core.Yaml.Tests/NSwag.Core.Yaml.Tests.csproj +++ b/src/NSwag.Core.Yaml.Tests/NSwag.Core.Yaml.Tests.csproj @@ -1,20 +1,25 @@  + - netcoreapp3.1 + net7.0 false + + + + \ No newline at end of file diff --git a/src/NSwag.Core.Yaml/NSwag.Core.Yaml.csproj b/src/NSwag.Core.Yaml/NSwag.Core.Yaml.csproj index a17fe1348c..77f2928146 100644 --- a/src/NSwag.Core.Yaml/NSwag.Core.Yaml.csproj +++ b/src/NSwag.Core.Yaml/NSwag.Core.Yaml.csproj @@ -1,12 +1,14 @@  - netstandard1.3;net45;netstandard2.0 + netstandard2.0;net462 NSwag + - - + + + diff --git a/src/NSwag.Core.Yaml/OpenApiYamlDocument.cs b/src/NSwag.Core.Yaml/OpenApiYamlDocument.cs index c477c3e383..3082acd6bb 100644 --- a/src/NSwag.Core.Yaml/OpenApiYamlDocument.cs +++ b/src/NSwag.Core.Yaml/OpenApiYamlDocument.cs @@ -112,7 +112,7 @@ private static Func CreateReferenceResol { return document => { - var schemaResolver = new OpenApiSchemaResolver(document, new JsonSchemaGeneratorSettings()); + var schemaResolver = new OpenApiSchemaResolver(document, new SystemTextJsonSchemaGeneratorSettings()); return new JsonAndYamlReferenceResolver(schemaResolver); }; } diff --git a/src/NSwag.Core/NSwag.Core.csproj b/src/NSwag.Core/NSwag.Core.csproj index f14f14b783..dd28fd5ad8 100644 --- a/src/NSwag.Core/NSwag.Core.csproj +++ b/src/NSwag.Core/NSwag.Core.csproj @@ -1,16 +1,19 @@  - netstandard1.0;net45;netstandard2.0 + netstandard2.0;net462 NSwag + bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + - - + + - + + diff --git a/src/NSwag.Core/OpenApiDocument.Serialization.cs b/src/NSwag.Core/OpenApiDocument.Serialization.cs index 9214e061df..58498b2184 100644 --- a/src/NSwag.Core/OpenApiDocument.Serialization.cs +++ b/src/NSwag.Core/OpenApiDocument.Serialization.cs @@ -40,7 +40,7 @@ public static PropertyRenameAndIgnoreSerializerContractResolver GetJsonSerialize return OpenApi3ContractResolver.Value; } - throw new ArgumentException("The given schema type is not supported."); + throw new ArgumentException("The schema type '" + schemaType + "' is not supported."); } private static PropertyRenameAndIgnoreSerializerContractResolver CreateJsonSerializerContractResolver(SchemaType schemaType) diff --git a/src/NSwag.Core/OpenApiDocument.cs b/src/NSwag.Core/OpenApiDocument.cs index 2683d2c645..653f4848c8 100644 --- a/src/NSwag.Core/OpenApiDocument.cs +++ b/src/NSwag.Core/OpenApiDocument.cs @@ -209,7 +209,7 @@ public static async Task FromJsonAsync(string data, string docu } else { - var schemaResolver = new OpenApiSchemaResolver(document, new JsonSchemaGeneratorSettings()); + var schemaResolver = new OpenApiSchemaResolver(document, new SystemTextJsonSchemaGeneratorSettings()); return new JsonReferenceResolver(schemaResolver); } }, contractResolver, cancellationToken).ConfigureAwait(false); diff --git a/src/NSwag.Demo.Web/App_Start/WebApiConfig.cs b/src/NSwag.Demo.Web/App_Start/WebApiConfig.cs deleted file mode 100644 index 04ec019340..0000000000 --- a/src/NSwag.Demo.Web/App_Start/WebApiConfig.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Web.Http; - -namespace NSwag.Demo.Web -{ - public static class WebApiConfig - { - public static void Register(HttpConfiguration config) - { - // Web API configuration and services - var formatters = GlobalConfiguration.Configuration.Formatters; - formatters.Remove(formatters.XmlFormatter); - - // Web API routes - config.MapHttpAttributeRoutes(); - - config.Routes.MapHttpRoute( - name: "Default", - routeTemplate: "api/{controller}/{action}/{id}", - defaults: new - { - action = RouteParameter.Optional, - id = RouteParameter.Optional - } - ); - } - } -} diff --git a/src/NSwag.Demo.Web/Controllers/BodyInputController.cs b/src/NSwag.Demo.Web/Controllers/BodyInputController.cs deleted file mode 100644 index e02b0569c0..0000000000 --- a/src/NSwag.Demo.Web/Controllers/BodyInputController.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Http; - -namespace NSwag.Demo.Web.Controllers -{ - public class BodyParameter - { - public string Foo { get; set; } - - public string Bar { get; set; } - } - - public class BodyInputController : ApiController - { - [HttpPost] - public void ObjectBody(BodyParameter body) - { - - } - - [HttpPost] - public void ArrayBody(BodyParameter[] body) - { - - } - - [HttpPost] - public void DictionaryBody(Dictionary body) - { - - } - } -} \ No newline at end of file diff --git a/src/NSwag.Demo.Web/Controllers/FileController.cs b/src/NSwag.Demo.Web/Controllers/FileController.cs deleted file mode 100644 index b5d0dbc003..0000000000 --- a/src/NSwag.Demo.Web/Controllers/FileController.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Net; -using System.Net.Http; -using System.Web; -using System.Web.Http; -using NSwag.Annotations; - -namespace NSwag.Demo.Web.Controllers -{ - public interface IFormFile - { - } - - public interface IActionResult - { - } - - public interface IFormFileCollection - { - } - - public class FileController : ApiController - { - [HttpPost, Route("upload")] - public IActionResult Upload(HttpPostedFileBase myFile, [Required] IFormFile myFile2, ICollection files, ICollection files2, IFormFileCollection files3) - { - throw new NotImplementedException(); - } - - public HttpResponseMessage GetFile() - { - HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); - response.Content = new ByteArrayContent(new byte[] { }); - response.Content.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment"); - response.Content.Headers.ContentDisposition.FileName = "Sample.png"; - return response; - } - } -} \ No newline at end of file diff --git a/src/NSwag.Demo.Web/Controllers/InheritanceController.cs b/src/NSwag.Demo.Web/Controllers/InheritanceController.cs deleted file mode 100644 index 94840c0c6e..0000000000 --- a/src/NSwag.Demo.Web/Controllers/InheritanceController.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System.Collections.Generic; -using System.Runtime.Serialization; -using System.Web.Http; -using Newtonsoft.Json; -using NJsonSchema.Converters; - -namespace NSwag.Demo.Web.Controllers -{ - public class AnimalContainer - { - public IEnumerable Animal { get; set; } - } - - [JsonConverter(typeof(JsonInheritanceConverter), "discriminator")] - [KnownType(typeof(Dog))] - public class Animal - { - public string Foo { get; set; } - } - - public class Dog : Animal - { - public string Bar { get; set; } - } - - public class InheritanceController : ApiController - { - [Route("api/Inheritance/GetAll")] - public AnimalContainer GetAll() - { - return new AnimalContainer - { - Animal = new List - { - new Dog { Foo = "dog", Bar = "bar"}, - new Animal { Foo = "animal"} - } - }; - } - } -} \ No newline at end of file diff --git a/src/NSwag.Demo.Web/Controllers/MvcController.cs b/src/NSwag.Demo.Web/Controllers/MvcController.cs deleted file mode 100644 index fc5bcb87e6..0000000000 --- a/src/NSwag.Demo.Web/Controllers/MvcController.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Web.Mvc; - -namespace NSwag.Demo.Web.Controllers -{ - // Shold not be picked up by GetControllerClasses() - public class MvcController : Controller - { - public ActionResult Index() - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/src/NSwag.Demo.Web/Controllers/PersonsController.cs b/src/NSwag.Demo.Web/Controllers/PersonsController.cs deleted file mode 100644 index ebb4f1ff51..0000000000 --- a/src/NSwag.Demo.Web/Controllers/PersonsController.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; -using System.Web.Http; -using NSwag.Annotations; -using NSwag.Demo.Web.Models; -using NSwag.Generation.WebApi; - -namespace NSwag.Demo.Web.Controllers -{ - public class MyClass - { - public string Foo { get; set; } - } - - [RoutePrefix("api/Person")] - public class PersonsController : ApiController - { - [HttpPut] - [Route("xyz/{data}")] - public string Xyz(MyClass data) - { - return "abc"; - } - - // GET: api/Person - [Obsolete] - public IEnumerable Get() - { - return new Person[] - { - new Person { FirstName = "Foo", LastName = "Bar"}, - new Person { FirstName = "Rico", LastName = "Suter"}, - }; - } - - // GET: api/Person/5 - /// Gets a person. - /// The ID of - /// the person. - /// The person. - [ResponseType(typeof(Person))] - [ResponseType("500", typeof(PersonNotFoundException))] - [Route("{id}")] - public HttpResponseMessage Get(int id) - { - return Request.CreateResponse(HttpStatusCode.OK, new Person { FirstName = "Rico", LastName = "Suter" }); - } - - // POST: api/Person - /// Creates a new person. - /// The person. - [HttpPost, Route("")] - public void Post([FromBody]Person value) - { - } - - // PUT: api/Person/5 - /// Updates the existing person. - /// The ID. - /// The person. - public void Put(int id, [FromBody]Person value) - { - } - - // DELETE: api/Person/5 - [Route("{id}")] - public void Delete(int id) - { - } - - [HttpGet] - [Route("Calculate/{a}/{b}")] - [Description("Calculates the sum of a, b and c.")] - public int Calculate(int a, int b, [Required]int c) - { - return a + b + c; - } - - [HttpGet] - [OpenApiIgnore] - public async Task Swagger() - { - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings - { - DefaultUrlTemplate = Configuration.Routes.First(r => !string.IsNullOrEmpty(r.RouteTemplate)).RouteTemplate - }); - var document = await generator.GenerateForControllerAsync(GetType()); - return new HttpResponseMessage { Content = new StringContent(document.ToJson(), Encoding.UTF8) }; - } - } - - public class PersonNotFoundException : Exception - { - public PersonNotFoundException() - { - } - - public int PersonId { get; set; } - } -} diff --git a/src/NSwag.Demo.Web/Controllers/PersonsDefaultRouteController.cs b/src/NSwag.Demo.Web/Controllers/PersonsDefaultRouteController.cs deleted file mode 100644 index 322c45bdce..0000000000 --- a/src/NSwag.Demo.Web/Controllers/PersonsDefaultRouteController.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; -using System.Web.Http; -using NSwag.Annotations; -using NSwag.Demo.Web.Models; -using NSwag.Generation.WebApi; - -namespace NSwag.Demo.Web.Controllers -{ - public class PersonsDefaultRouteController : ApiController - { - [HttpPut] - [Route("xyz/{data}")] - public string Xyz(MyClass data) - { - return "abc"; - } - - // GET: api/Person - [Obsolete] - public IEnumerable Get() - { - return new Person[] - { - new Person { FirstName = "Foo", LastName = "Bar"}, - new Person { FirstName = "Rico", LastName = "Suter"}, - }; - } - - // GET: api/Person/5 - /// Gets a person. - /// The ID of - /// the person. - /// The person. - [ResponseType(typeof(Person))] - [ResponseType("500", typeof(PersonNotFoundException))] - public HttpResponseMessage Get(int id) - { - return Request.CreateResponse(HttpStatusCode.OK, new Person { FirstName = "Rico", LastName = "Suter" }); - } - - // POST: api/Person - /// Creates a new person. - /// The person. - [HttpPost, Route("")] - public void Post([FromBody]Person value) - { - } - - // PUT: api/Person/5 - /// Updates the existing person. - /// The ID. - /// The person. - public void Put(int id, [FromBody]Person value) - { - } - - // DELETE: api/Person/5 - [Route] - public void Delete(int id) - { - } - - [HttpGet] - [Route("Calculate/{a}/{b}")] - [Description("Calculates the sum of a, b and c.")] - public int Calculate(int a, int b, [Required]int c) - { - return a + b + c; - } - - [HttpGet] - public DateTime AddHour(DateTime time) - { - return time.Add(TimeSpan.FromHours(1)); - } - - [HttpGet] - public Task TestAsync() - { - return Task.FromResult(0); - } - - [HttpGet, ActionName("LoadComplexObject2")] - public Car LoadComplexObject() - { - return new Car(); - } - - [HttpGet] - [OpenApiIgnore] - public async Task Swagger() - { - var generator = new WebApiOpenApiDocumentGenerator(new WebApiOpenApiDocumentGeneratorSettings - { - DefaultUrlTemplate = Configuration.Routes.First(r => !string.IsNullOrEmpty(r.RouteTemplate)).RouteTemplate - }); - var document = await generator.GenerateForControllerAsync(GetType()); - return new HttpResponseMessage { Content = new StringContent(document.ToJson(), Encoding.UTF8) }; - } - } -} \ No newline at end of file diff --git a/src/NSwag.Demo.Web/Controllers/RequestParameterTestController.cs b/src/NSwag.Demo.Web/Controllers/RequestParameterTestController.cs deleted file mode 100644 index aaf111cc7d..0000000000 --- a/src/NSwag.Demo.Web/Controllers/RequestParameterTestController.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Web.Http; - -namespace NSwag.Demo.Web.Controllers -{ - public class RequestParameterTestController : ApiController - { - public class GeoPoint - { - public double Latitude { get; set; } - - public double Longitude { get; set; } - } - - public void FromBodyTest([FromBody] GeoPoint location) - { - - } - - public void FromUriTest([FromUri] GeoPoint location) - { - - } - } -} \ No newline at end of file diff --git a/src/NSwag.Demo.Web/Controllers/RoutePrefixWithPathsController.cs b/src/NSwag.Demo.Web/Controllers/RoutePrefixWithPathsController.cs deleted file mode 100644 index c9b74fae45..0000000000 --- a/src/NSwag.Demo.Web/Controllers/RoutePrefixWithPathsController.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Web.Http; - -namespace NSwag.Demo.Web.Controllers -{ - [RoutePrefix("api/RoutePrefixWithPaths/{companyIdentifier:guid}")] - public class RoutePrefixWithPathsController : ApiController - { - [HttpGet] - [Route("documents")] - //[CompanyFilterAuthorization(permission: ApplicationPermissions.Company.SDL.Read)] - public IHttpActionResult GetDocuments(string query) - { - return Ok(1); - } - } -} \ No newline at end of file diff --git a/src/NSwag.Demo.Web/Controllers/TestController.cs b/src/NSwag.Demo.Web/Controllers/TestController.cs deleted file mode 100644 index e47fa845c1..0000000000 --- a/src/NSwag.Demo.Web/Controllers/TestController.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Collections.Generic; -using System.Net; -using System.Net.Http; -using System.Web.Http; -using NSwag.Demo.Web.Models; - -namespace NSwag.Demo.Web.Controllers -{ - public class TestController : ApiController - { - //public object Test() - //{ - // return null; - //} - - //[ResponseType(typeof(List))] - //[Route("Report/{ids}/{from}")] - //public IHttpActionResult Get(List ids, DateTime from, DateTime? to = null) - //{ - // return Ok(ids); - //} - - public class Foo - { - public string Bar { get; set; } - } - - [Annotations.ResponseType("200", typeof(List))] - public HttpResponseMessage GetPersons() - { - return Request.CreateResponse(HttpStatusCode.OK, new[] { new Foo { Bar = "Test" } }); - } - } -} \ No newline at end of file diff --git a/src/NSwag.Demo.Web/Controllers/VerbsController.cs b/src/NSwag.Demo.Web/Controllers/VerbsController.cs deleted file mode 100644 index 675bd58523..0000000000 --- a/src/NSwag.Demo.Web/Controllers/VerbsController.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Web.Http; - -namespace NSwag.Demo.Web.Controllers -{ - public class VerbsController : ApiController - { - [HttpGet] - public void Get() - { - - } - - [HttpPut] - public void Put() - { - - } - - [HttpPost] - public void Post() - { - - } - - [HttpDelete] - public void Delete() - { - - } - - [AcceptVerbs("options")] - public void Options() - { - - } - - [AcceptVerbs("head")] - public void Head() - { - - } - - [AcceptVerbs("patch")] - public void Patch() - { - - } - } -} \ No newline at end of file diff --git a/src/NSwag.Demo.Web/Global.asax b/src/NSwag.Demo.Web/Global.asax deleted file mode 100644 index ed65c1c3e1..0000000000 --- a/src/NSwag.Demo.Web/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="NSwag.Demo.Web.WebApiApplication" Language="C#" %> diff --git a/src/NSwag.Demo.Web/Global.asax.cs b/src/NSwag.Demo.Web/Global.asax.cs deleted file mode 100644 index b3b4c55c13..0000000000 --- a/src/NSwag.Demo.Web/Global.asax.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Web.Http; -using System.Web.Routing; -using NSwag.AspNet.Owin; - -namespace NSwag.Demo.Web -{ - public class WebApiApplication : System.Web.HttpApplication - { - protected void Application_Start() - { - RouteTable.Routes.MapOwinPath("swagger", app => - { - app.UseSwaggerUi3(typeof(WebApiApplication).Assembly, s => - { - s.GeneratorSettings.DefaultUrlTemplate = "api/{controller}/{action}/{id}"; - s.MiddlewareBasePath = "/swagger"; - }); - }); - - - GlobalConfiguration.Configure(WebApiConfig.Register); - } - } -} diff --git a/src/NSwag.Demo.Web/Models/Car.cs b/src/NSwag.Demo.Web/Models/Car.cs deleted file mode 100644 index b22a16ff53..0000000000 --- a/src/NSwag.Demo.Web/Models/Car.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.ComponentModel; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace NSwag.Demo.Web.Models -{ - public class Car - { - public string Name { get; set; } - - //[ReadOnly(true)] - public Person Driver { get; set; } - - [JsonConverter(typeof(StringEnumConverter))] - public ObjectType Type { get; set; } - } - - /// Foo - /// bar - public enum ObjectType - { - Foo, - - Bar - } -} \ No newline at end of file diff --git a/src/NSwag.Demo.Web/Models/Person.cs b/src/NSwag.Demo.Web/Models/Person.cs deleted file mode 100644 index ca3f2101bf..0000000000 --- a/src/NSwag.Demo.Web/Models/Person.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.ComponentModel; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace NSwag.Demo.Web.Models -{ - /// The DTO class - /// for a person. - public class Person - { - /// Gets or sets the first name. - [JsonProperty("firstName")] - [DefaultValue("Rico")] - public string FirstName { get; set; } - - public string LastName { get; set; } - - public DateTime Birthday { get; set; } - - /// Gets or sets - /// the height in cm. - public decimal Height { get; set; } - - public Car[] Cars { get; set; } - - [JsonConverter(typeof(StringEnumConverter))] - public ObjectType Type { get; set; } - } -} \ No newline at end of file diff --git a/src/NSwag.Demo.Web/NSwag.Demo.Web.csproj b/src/NSwag.Demo.Web/NSwag.Demo.Web.csproj deleted file mode 100644 index 78e375a665..0000000000 --- a/src/NSwag.Demo.Web/NSwag.Demo.Web.csproj +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - Debug - AnyCPU - - - 2.0 - {37AE85DE-B127-4861-B925-1A67A35F314A} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - NSwag.Demo.Web - NSwag.Demo.Web - v4.6.1 - win - true - - - - - 2.2 - - - - - - - $(NoWarn),618,1591 - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - bin\NSwag.Demo.Web.XML - - - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - - - - - - - - - - - - - - Global.asax - - - - - - - - Web.config - - - Web.config - - - - - - - - {ca084154-e758-4a44-938d-7806af2dd886} - NSwag.Annotations - - - {69a692eb-c277-46ab-ba55-b33e7e6e129c} - NSwag.AspNet.Owin - - - {2e6174aa-fc75-4821-9e86-51b30568bec0} - NSwag.Core - - - {8a547cb0-930f-466d-92eb-e780ff14c0a6} - NSwag.Generation.WebApi - - - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574} - NSwag.Generation - - - - - - - - - - - - - - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - true - bin\ - DEBUG;TRACE - bin\NSwag.Demo.Web.XML - full - x64 - prompt - MinimumRecommendedRules.ruleset - - - bin\ - TRACE - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - - - - AMD - ES5 - True - False - False - - - False - True - True - - - - - ES5 - True - False - AMD - False - - - False - True - True - - - - - ES5 - True - False - AMD - False - - - False - True - True - - - - - - - - - - - False - True - 22093 - / - http://localhost:22093 - False - False - - - False - - - - - \ No newline at end of file diff --git a/src/NSwag.Demo.Web/Properties/AssemblyInfo.cs b/src/NSwag.Demo.Web/Properties/AssemblyInfo.cs deleted file mode 100644 index 90f529aa2f..0000000000 --- a/src/NSwag.Demo.Web/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NSwag.Demo.Web")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NSwag.Demo.Web")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("1f2ff177-0bd3-4fd8-bd57-d8deea0d2626")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/NSwag.Demo.Web/Web.Debug.config b/src/NSwag.Demo.Web/Web.Debug.config deleted file mode 100644 index 2e302f9f95..0000000000 --- a/src/NSwag.Demo.Web/Web.Debug.config +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Demo.Web/Web.Release.config b/src/NSwag.Demo.Web/Web.Release.config deleted file mode 100644 index c35844462b..0000000000 --- a/src/NSwag.Demo.Web/Web.Release.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Demo.Web/Web.config b/src/NSwag.Demo.Web/Web.config deleted file mode 100644 index 8a4adce57a..0000000000 --- a/src/NSwag.Demo.Web/Web.config +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Demo.Web/index.html b/src/NSwag.Demo.Web/index.html deleted file mode 100644 index 65108d99e8..0000000000 --- a/src/NSwag.Demo.Web/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - TypeScript HTML App - - - - - -

NSwag Sample App

-
- - 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 912ab749ef..64cc4e48b8 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,24 +1,14 @@  - net5.0;net6.0;net7.0;netcoreapp2.1;netcoreapp3.1 + net6.0;net7.0;netcoreapp3.1 true $(NoWarn),618,1591 - enable + enable - - - - - - - - - - - + diff --git a/src/NSwag.Generation.AspNetCore.Tests/ApiVersionProcessorWithAspNetCoreTests.cs b/src/NSwag.Generation.AspNetCore.Tests/ApiVersionProcessorWithAspNetCoreTests.cs index 0d3cf93bac..5ac487cac0 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/ApiVersionProcessorWithAspNetCoreTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/ApiVersionProcessorWithAspNetCoreTests.cs @@ -1,5 +1,7 @@ using System.Linq; using System.Threading.Tasks; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.AspNetCore.Tests.Web.Controllers; using Xunit; @@ -11,7 +13,7 @@ public class ApiVersionProcessorWithAspNetCoreTests : AspNetCoreTestsBase public async Task When_api_version_parameter_should_be_ignored_then_it_is_ignored() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; settings.ApiGroupNames = new[] { "1" }; // Act @@ -27,7 +29,7 @@ public async Task When_api_version_parameter_should_be_ignored_then_it_is_ignore public async Task When_generating_v1_then_only_v1_operations_are_included() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; settings.ApiGroupNames = new[] { "1" }; // Act @@ -48,7 +50,7 @@ public async Task When_generating_v1_then_only_v1_operations_are_included() public async Task When_generating_v2_then_only_v2_operations_are_included() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; settings.ApiGroupNames = new[] { "2" }; // Act @@ -69,7 +71,7 @@ public async Task When_generating_v2_then_only_v2_operations_are_included() public async Task When_generating_v3_then_only_v3_operations_are_included() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; settings.ApiGroupNames = new[] { "3" }; // Act @@ -89,7 +91,7 @@ public async Task When_generating_v3_then_only_v3_operations_are_included() public async Task When_generating_versioned_controllers_then_version_path_parameter_is_not_present() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings{}; + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; settings.ApiGroupNames = new[] { "3" }; // Act diff --git a/src/NSwag.Generation.AspNetCore.Tests/AspNetCoreToSwaggerGenerationTests.cs b/src/NSwag.Generation.AspNetCore.Tests/AspNetCoreToSwaggerGenerationTests.cs index 04eb15c9b8..2144b83480 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/AspNetCoreToSwaggerGenerationTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/AspNetCoreToSwaggerGenerationTests.cs @@ -25,6 +25,8 @@ using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.Options; using Moq; +using NJsonSchema; +using NJsonSchema.Generation; using NSwag.Annotations; using NSwag.Generation.Processors; using NSwag.Generation.Processors.Contexts; @@ -38,7 +40,7 @@ public class AspNetCoreToSwaggerGenerationTests public async Task SwaggerDocumentIsGeneratedForCustomCreatedApiDescriptions() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }); var apiDescriptions = new[] { new ApiDescription @@ -183,7 +185,11 @@ public async Task SwaggerDocumentIsGeneratedForCustomCreatedApiDescriptions() public async Task When_generating_swagger_all_apidescriptions_are_discovered() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var apiDescriptions = GetApiDescriptionGroups(typeof(TestController)); // Act @@ -213,7 +219,11 @@ public async Task When_generating_swagger_all_apidescriptions_are_discovered() public async Task When_generating_swagger_all_apidescriptions_are_discovered_for_2_1_applications() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var apiDescriptions = Get2_1_ApiDescriptionGroups(typeof(TestController)); // Act @@ -247,7 +257,7 @@ public async Task When_generating_swagger_all_apidescriptions_are_discovered_for public async Task ControllersWithSwaggerIgnoreAttribute_AreIgnored() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }); var apiDescriptions = GetApiDescriptionGroups(typeof(ControllerWithSwaggerIgnoreAttribute)); // Act @@ -261,7 +271,7 @@ public async Task ControllersWithSwaggerIgnoreAttribute_AreIgnored() public async Task ActionsWithSwaggerIgnoreAttribute_AreIgnored() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }); var apiDescriptions = GetApiDescriptionGroups(typeof(ActionWithSwaggerIgnoreAttribute)); // Act @@ -277,7 +287,7 @@ public async Task ActionsWithSwaggerIgnoreAttribute_AreIgnored() public async Task ParametersWithSwaggerIgnoreAttribute_AreIgnored() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }); var apiDescriptions = GetApiDescriptionGroups(typeof(ParameterWithSwaggerIgnoreAttribute)); // Act @@ -297,7 +307,7 @@ public async Task ParametersWithSwaggerIgnoreAttribute_AreIgnored() public async Task SwaggerOperationMethods_AreParsed() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }); var apiDescriptions = GetApiDescriptionGroups(typeof(HttpMethodsController)); // Act @@ -332,7 +342,7 @@ public async Task SwaggerOperationMethods_AreParsed() public async Task SwaggerOperationAttribute_AreUsedToCalculateOperationId_IfPresent() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }); var apiDescriptions = GetApiDescriptionGroups(typeof(ActionWithSwaggerOperationAttribute)); // Act @@ -347,7 +357,7 @@ public async Task SwaggerOperationAttribute_AreUsedToCalculateOperationId_IfPres public async Task SwaggerOperationProcessorAttributesOnControllerTypes_AreDiscoveredAndExecuted() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }); var apiDescriptions = GetApiDescriptionGroups(typeof(ControllerWithSwaggerOperationProcessor)); // Act @@ -361,7 +371,7 @@ public async Task SwaggerOperationProcessorAttributesOnControllerTypes_AreDiscov public async Task SwaggerOperationProcessorAttributesOnActions_AreDiscoveredAndExecuted() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }); var apiDescriptions = GetApiDescriptionGroups(typeof(ActionWithSwaggerOperationProcessor)); // Act @@ -375,7 +385,7 @@ public async Task SwaggerOperationProcessorAttributesOnActions_AreDiscoveredAndE public async Task SwaggerResponseAttributesOnControllersAreDiscovered() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }); var apiDescriptions = GetApiDescriptionGroups(typeof(ControllerWithSwaggerResponseTypeAttribute)); // Act @@ -393,7 +403,7 @@ public async Task SwaggerResponseAttributesOnControllersAreDiscovered() public async Task SwaggerResponseAttributesOnActionsAreDiscovered() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }); var apiDescriptions = GetApiDescriptionGroups(typeof(ActionWithSwaggerResponseAttribute)); // Act @@ -411,7 +421,7 @@ public async Task SwaggerResponseAttributesOnActionsAreDiscovered() public async Task FromHeaderParametersAreDiscovered() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }); var apiDescriptions = GetApiDescriptionGroups(typeof(ControllerWithParameters)); // Act @@ -428,7 +438,7 @@ public async Task FromHeaderParametersAreDiscovered() public async Task FromBodyParametersAreDiscovered() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }); var apiDescriptions = GetApiDescriptionGroups(typeof(ControllerWithParameters)); // Act @@ -446,7 +456,12 @@ public async Task FromBodyParametersAreDiscovered() public async Task FromFormParametersAreDiscovered() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { RequireParametersWithoutDefault = true }); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings + { + RequireParametersWithoutDefault = true, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }); + var apiDescriptions = GetApiDescriptionGroups(typeof(ControllerWithParameters)); // Act @@ -464,7 +479,12 @@ public async Task FromFormParametersAreDiscovered() public async Task QueryParametersAreDiscovered() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { RequireParametersWithoutDefault = true }); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings + { + RequireParametersWithoutDefault = true, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } + }); + var apiDescriptions = GetApiDescriptionGroups(typeof(ControllerWithParameters)); // Act @@ -488,8 +508,8 @@ public async Task QueryParametersAreDiscovered() [Fact] public async Task FormFileParametersAreDiscovered() { - // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + //// Arrange + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } }); var apiDescriptions = GetApiDescriptionGroups(typeof(ControllerWithParameters)); // Act @@ -506,7 +526,7 @@ public async Task FormFileParametersAreDiscovered() public async Task ComplexQueryParametersAreProcessed() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }); var apiDescriptions = GetApiDescriptionGroups(typeof(ControllerWithParameters)); // Act @@ -537,7 +557,7 @@ public async Task ComplexQueryParametersAreProcessed() public async Task BoundPropertiesAreProcessed() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }); var apiDescriptions = GetApiDescriptionGroups(typeof(ControllerWithBoundProperties)); // Act @@ -568,7 +588,7 @@ public async Task BoundPropertiesAreProcessed() public async Task When_no_IncludedVersions_are_defined_then_all_routes_are_available_and_replaced() { // Arrange - var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings()); + var generator = new AspNetCoreOpenApiDocumentGenerator(new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }); var apiDescriptions = GetApiDescriptionGroups(typeof(ControllerWithReCodeAttribute)); // Act @@ -620,7 +640,7 @@ private class ActionWithSwaggerIgnoreAttribute private class ParameterWithSwaggerIgnoreAttribute { [HttpPost("{id}/{name?}")] - public Task GetModel([FromRoute] int id, [FromRoute] [SwaggerIgnore] string name) => null; + public Task GetModel([FromRoute] int id, [FromRoute][SwaggerIgnore] string name) => null; } [Route("[controller]/[action]")] diff --git a/src/NSwag.Generation.AspNetCore.Tests/ExtensionDataTests.cs b/src/NSwag.Generation.AspNetCore.Tests/ExtensionDataTests.cs index 719790901f..4e36332d21 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/ExtensionDataTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/ExtensionDataTests.cs @@ -1,5 +1,7 @@ using System.Linq; using System.Threading.Tasks; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.AspNetCore.Tests.Web.Controllers; using Xunit; @@ -11,7 +13,7 @@ public class ExtensionDataTests : AspNetCoreTestsBase public async Task When_controller_has_extension_data_attributes_then_they_are_processed() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; // Act var document = await GenerateDocumentAsync(settings, typeof(SwaggerExtensionDataController)); @@ -27,7 +29,7 @@ public async Task When_controller_has_extension_data_attributes_then_they_are_pr public async Task When_operation_has_extension_data_attributes_then_they_are_processed() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; // Act var document = await GenerateDocumentAsync(settings, typeof(SwaggerExtensionDataController)); diff --git a/src/NSwag.Generation.AspNetCore.Tests/Inheritance/InheritanceControllerTests.cs b/src/NSwag.Generation.AspNetCore.Tests/Inheritance/InheritanceControllerTests.cs index 8a7ec95b42..2658367569 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Inheritance/InheritanceControllerTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Inheritance/InheritanceControllerTests.cs @@ -1,5 +1,7 @@ using System.Linq; using System.Threading.Tasks; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.AspNetCore.Tests.Web.Controllers.Inheritance; using Xunit; @@ -11,7 +13,7 @@ public class InheritanceControllerTests : AspNetCoreTestsBase public async Task When_primitive_body_parameter_has_no_default_value_then_it_is_required() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; // Act var document = await GenerateDocumentAsync(settings, typeof(ActualController)); diff --git a/src/NSwag.Generation.AspNetCore.Tests/LanguageParameterTests.cs b/src/NSwag.Generation.AspNetCore.Tests/LanguageParameterTests.cs index 62a6ce6385..d543071b9a 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/LanguageParameterTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/LanguageParameterTests.cs @@ -1,6 +1,7 @@ using System.Linq; using System.Threading.Tasks; using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.AspNetCore.Tests.Web.Controllers; using Xunit; @@ -13,7 +14,10 @@ public async Task When_implicit_language_parameter_is_used_then_it_is_in_spec() { // Arrange var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); - settings.SchemaType = SchemaType.OpenApi3; + settings.SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + }; // Act var document = await GenerateDocumentAsync(settings, typeof(LanguagesController)); @@ -27,7 +31,7 @@ public async Task When_implicit_language_parameter_is_used_then_it_is_in_spec() var parameter = operation.Operation.ActualParameters.Single(p => p.Name == "language"); Assert.Equal(JsonObjectType.String, parameter.ActualTypeSchema.Type); - Assert.False(parameter.IsNullable(settings.SchemaType)); + Assert.False(parameter.IsNullable(settings.SchemaSettings.SchemaType)); } } } 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 6f9e6b1267..01165d087e 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/NSwag.Generation.AspNetCore.Tests.csproj +++ b/src/NSwag.Generation.AspNetCore.Tests/NSwag.Generation.AspNetCore.Tests.csproj @@ -1,8 +1,9 @@  - netcoreapp2.1;netcoreapp3.1;net5.0;net6.0;net7.0 + netcoreapp3.1;net6.0;net7.0 $(NoWarn),618,1591 + @@ -11,27 +12,12 @@ - - - - - - - - - - - - - - - @@ -41,5 +27,4 @@
-
diff --git a/src/NSwag.Generation.AspNetCore.Tests/Operations/PathTests.cs b/src/NSwag.Generation.AspNetCore.Tests/Operations/PathTests.cs index 1b472d6628..706115926e 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Operations/PathTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Operations/PathTests.cs @@ -1,4 +1,6 @@ -using NSwag.Generation.AspNetCore.Tests.Web.Controllers.Parameters; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; +using NSwag.Generation.AspNetCore.Tests.Web.Controllers.Parameters; using System.Linq; using System.Threading.Tasks; using Xunit; @@ -11,7 +13,7 @@ public class PathTests : AspNetCoreTestsBase public async Task When_route_is_empty_then_path_is_slash() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; // Act var document = await GenerateDocumentAsync(settings, typeof(EmptyPathController)); @@ -27,7 +29,7 @@ public async Task When_route_is_empty_then_path_is_slash() public async Task When_route_is_not_empty_then_path_starts_with_slash() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; // Act var document = await GenerateDocumentAsync(settings, typeof(BodyParametersController)); diff --git a/src/NSwag.Generation.AspNetCore.Tests/Parameters/BodyParametersTests.cs b/src/NSwag.Generation.AspNetCore.Tests/Parameters/BodyParametersTests.cs index 2dd5c7bcc0..f42eb70114 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Parameters/BodyParametersTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Parameters/BodyParametersTests.cs @@ -1,5 +1,7 @@ using System.Linq; using System.Threading.Tasks; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.AspNetCore.Tests.Web.Controllers.Parameters; using Xunit; @@ -11,7 +13,7 @@ public class BodyParametersTests : AspNetCoreTestsBase public async Task When_primitive_body_parameter_has_no_default_value_then_it_is_required() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; // Act var document = await GenerateDocumentAsync(settings, typeof(BodyParametersController)); @@ -30,7 +32,13 @@ public async Task When_primitive_body_parameter_has_no_default_value_then_it_is_ public async Task When_primitive_body_parameter_has_default_value_then_it_is_optional() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } + }; // Act var document = await GenerateDocumentAsync(settings, typeof(BodyParametersController)); @@ -40,7 +48,7 @@ public async Task When_primitive_body_parameter_has_default_value_then_it_is_opt Assert.False(operation.ActualParameters.First().IsRequired); } - + [Fact( #if NET7_0_OR_GREATER Skip = "Wrong in .Net 7" @@ -49,7 +57,7 @@ public async Task When_primitive_body_parameter_has_default_value_then_it_is_opt public async Task When_primitive_body_parameter_has_default_value_then_it_is_required_before_net7() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; // Act var document = await GenerateDocumentAsync(settings, typeof(BodyParametersController)); @@ -64,7 +72,7 @@ public async Task When_primitive_body_parameter_has_default_value_then_it_is_req public async Task When_complex_body_parameter_has_no_default_value_then_it_is_required() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; // Act var document = await GenerateDocumentAsync(settings, typeof(BodyParametersController)); @@ -83,7 +91,7 @@ public async Task When_complex_body_parameter_has_no_default_value_then_it_is_re public async Task When_complex_body_parameter_has_default_value_then_it_is_optional() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; // Act var document = await GenerateDocumentAsync(settings, typeof(BodyParametersController)); @@ -93,7 +101,7 @@ public async Task When_complex_body_parameter_has_default_value_then_it_is_optio Assert.False(operation.ActualParameters.First().IsRequired); } - + [Fact( #if NET7_0_OR_GREATER Skip = "Wrong in .Net 7" @@ -102,7 +110,7 @@ public async Task When_complex_body_parameter_has_default_value_then_it_is_optio public async Task When_complex_body_parameter_has_default_value_then_it_is_required_before_net7() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; // Act var document = await GenerateDocumentAsync(settings, typeof(BodyParametersController)); diff --git a/src/NSwag.Generation.AspNetCore.Tests/Parameters/DefaultParametersTests.cs b/src/NSwag.Generation.AspNetCore.Tests/Parameters/DefaultParametersTests.cs index e2718abc31..f2a78abe30 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Parameters/DefaultParametersTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Parameters/DefaultParametersTests.cs @@ -2,8 +2,8 @@ using System.Threading.Tasks; using Newtonsoft.Json; using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Serialization; using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.AspNetCore.Tests.Web.Controllers.Parameters; using Xunit; using static NSwag.Generation.AspNetCore.Tests.Web.Controllers.Parameters.DefaultParametersController; @@ -18,8 +18,11 @@ public async Task When_parameter_has_default_and_schema_type_is_OpenApi3_then_sc // Arrange var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { - SchemaType = SchemaType.OpenApi3, - RequireParametersWithoutDefault = true + RequireParametersWithoutDefault = true, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } }; // Act @@ -38,8 +41,11 @@ public async Task When_parameter_has_default_and_schema_type_is_OpenApi3_then_sc // Arrange var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { - SchemaType = SchemaType.OpenApi3, - RequireParametersWithoutDefault = true + RequireParametersWithoutDefault = true, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } }; // Act @@ -59,11 +65,14 @@ public async Task When_parameter_has_default_and_schema_type_is_OpenApi3_then_sc // Arrange var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { - SchemaType = SchemaType.OpenApi3, RequireParametersWithoutDefault = true, - SerializerSettings = new JsonSerializerSettings + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { - Converters = { new StringEnumConverter() } + SchemaType = SchemaType.OpenApi3, + SerializerSettings = new JsonSerializerSettings + { + Converters = { new StringEnumConverter() } + } } }; @@ -83,8 +92,11 @@ public async Task When_parameter_has_default_and_schema_type_is_Swagger2_then_pa // Arrange var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { - SchemaType = SchemaType.Swagger2, - RequireParametersWithoutDefault = true + RequireParametersWithoutDefault = true, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.Swagger2 + } }; // Act diff --git a/src/NSwag.Generation.AspNetCore.Tests/Parameters/FormDataTests.cs b/src/NSwag.Generation.AspNetCore.Tests/Parameters/FormDataTests.cs index 493255b353..ee27012b5f 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Parameters/FormDataTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Parameters/FormDataTests.cs @@ -1,6 +1,7 @@ using System.Linq; using System.Threading.Tasks; using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.AspNetCore.Tests.Web.Controllers.Parameters; using Xunit; @@ -12,7 +13,13 @@ public class FormDataTests : AspNetCoreTestsBase public async Task WhenOperationHasFormDataFile_ThenItIsInRequestBody() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaType = SchemaType.OpenApi3 }; + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } + }; // Act var document = await GenerateDocumentAsync(settings, typeof(FileUploadController)); @@ -58,7 +65,13 @@ public async Task WhenOperationHasFormDataFile_ThenItIsInRequestBody() public async Task WhenOperationHasFormDataComplex_ThenItIsInRequestBody() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaType = SchemaType.OpenApi3 }; + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } + }; // Act var document = await GenerateDocumentAsync(settings, typeof(FileUploadController)); diff --git a/src/NSwag.Generation.AspNetCore.Tests/Parameters/HeaderParametersTests.cs b/src/NSwag.Generation.AspNetCore.Tests/Parameters/HeaderParametersTests.cs index 11bb0880a8..2299b3d671 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Parameters/HeaderParametersTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Parameters/HeaderParametersTests.cs @@ -1,5 +1,7 @@ using System.Linq; using System.Threading.Tasks; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.AspNetCore.Tests.Web.Controllers.Parameters; using Xunit; @@ -11,7 +13,14 @@ public class HeaderParametersTests : AspNetCoreTestsBase public async Task When_complex_query_parameters_are_nullable_and_set_to_null_they_are_optional_in_spec() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { RequireParametersWithoutDefault = true }; + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings + { + RequireParametersWithoutDefault = true, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } + }; // Act var document = await GenerateDocumentAsync(settings, typeof(HeaderParametersController)); diff --git a/src/NSwag.Generation.AspNetCore.Tests/Parameters/NullablePathParameterTests.cs b/src/NSwag.Generation.AspNetCore.Tests/Parameters/NullablePathParameterTests.cs index 60a2443573..5051439681 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Parameters/NullablePathParameterTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Parameters/NullablePathParameterTests.cs @@ -1,6 +1,7 @@ using System.Linq; using System.Threading.Tasks; using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.AspNetCore.Tests.Web.Controllers.Parameters; using Xunit; @@ -15,7 +16,10 @@ public async Task When_NRT_is_enabled_and_string_parameter_is_not_nullable_then_ var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { RequireParametersWithoutDefault = true, - SchemaType = SchemaType.OpenApi3 + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } }; // Act diff --git a/src/NSwag.Generation.AspNetCore.Tests/Parameters/PathParameterWithModelBinderTests.cs b/src/NSwag.Generation.AspNetCore.Tests/Parameters/PathParameterWithModelBinderTests.cs index 41cc121095..0549f02b92 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Parameters/PathParameterWithModelBinderTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Parameters/PathParameterWithModelBinderTests.cs @@ -1,5 +1,7 @@ using System.Linq; using System.Threading.Tasks; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.AspNetCore.Tests.Web.Controllers.Parameters; using Xunit; @@ -11,7 +13,11 @@ public class PathParameterWithModelBinderTests : AspNetCoreTestsBase public async Task When_model_binder_parameter_is_used_on_path_parameter_then_parameter_kind_is_path() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { RequireParametersWithoutDefault = true }; + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings + { + RequireParametersWithoutDefault = true, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } + }; // Act var document = await GenerateDocumentAsync(settings, typeof(PathParameterWithModelBinderController)); diff --git a/src/NSwag.Generation.AspNetCore.Tests/Parameters/QueryParametersTests.cs b/src/NSwag.Generation.AspNetCore.Tests/Parameters/QueryParametersTests.cs index d79a996ee4..cf83460910 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Parameters/QueryParametersTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Parameters/QueryParametersTests.cs @@ -1,6 +1,8 @@ using System.Linq; using System.Threading.Tasks; using Newtonsoft.Json.Linq; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.AspNetCore.Tests.Web.Controllers.Parameters; using Xunit; @@ -12,7 +14,11 @@ public class QueryParametersTests : AspNetCoreTestsBase public async Task When_complex_query_parameters_are_nullable_and_set_to_null_they_are_optional_in_spec() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { RequireParametersWithoutDefault = true }; + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings + { + RequireParametersWithoutDefault = true, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.Swagger2 } + }; // Act var document = await GenerateDocumentAsync(settings, typeof(ComplexQueryParametersController)); @@ -36,7 +42,11 @@ public async Task When_complex_query_parameters_are_nullable_and_set_to_null_the public async Task When_simple_query_parameters_are_nullable_and_set_to_null_they_are_optional_in_spec() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { RequireParametersWithoutDefault = true }; + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings + { + RequireParametersWithoutDefault = true, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } + }; // Act var document = await GenerateDocumentAsync(settings, typeof(SimpleQueryParametersController)); @@ -54,7 +64,11 @@ public async Task When_simple_query_parameters_are_nullable_and_set_to_null_they public async Task When_simple_query_parameter_has_BindRequiredAttribute_then_it_is_required() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { RequireParametersWithoutDefault = false }; + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings + { + RequireParametersWithoutDefault = false, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } + }; // Act var document = await GenerateDocumentAsync(settings, typeof(SimpleQueryParametersController)); @@ -72,7 +86,11 @@ public async Task When_simple_query_parameter_has_BindRequiredAttribute_then_it_ public async Task When_parameter_is_overwritten_then_original_name_is_set() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { RequireParametersWithoutDefault = false }; + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings + { + RequireParametersWithoutDefault = false, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } + }; // Act var document = await GenerateDocumentAsync(settings, typeof(RenamedQueryParameterController)); @@ -88,7 +106,14 @@ public async Task When_parameter_is_overwritten_then_original_name_is_set() public async Task When_parameter_has_bind_never_then_it_is_ignored() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { RequireParametersWithoutDefault = false }; + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings + { + RequireParametersWithoutDefault = false, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } + }; // Act var document = await GenerateDocumentAsync(settings, typeof(BindNeverQueryParameterController)); diff --git a/src/NSwag.Generation.AspNetCore.Tests/Processors/OperationResponseProcessorTest.cs b/src/NSwag.Generation.AspNetCore.Tests/Processors/OperationResponseProcessorTest.cs index d7543d81dc..994f0ef7f8 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Processors/OperationResponseProcessorTest.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Processors/OperationResponseProcessorTest.cs @@ -7,10 +7,10 @@ //----------------------------------------------------------------------- using Microsoft.AspNetCore.Mvc.ApiExplorer; -using NJsonSchema.Generation; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; using System.Collections.Generic; using System.Reflection; -using System.Threading.Tasks; using Xunit; namespace NSwag.Generation.AspNetCore.Processors.Tests @@ -121,22 +121,26 @@ public void ProcessAsync_Adds200StatusCodeForVoidResponse() private AspNetCoreOperationProcessorContext GetContext(ApiDescription apiDescription) { var operationDescription = new OpenApiOperationDescription { Operation = new OpenApiOperation() }; - var swaggerSettings = new AspNetCoreOpenApiDocumentGeneratorSettings(); var document = new OpenApiDocument(); - var schemaGeneratorSettings = new OpenApiDocumentGeneratorSettings(); - var schemaGenerator = new OpenApiSchemaGenerator(schemaGeneratorSettings); - var schemaResolver = new OpenApiSchemaResolver(document, schemaGeneratorSettings); - swaggerSettings.SchemaGenerator = schemaGenerator; + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } + }; + + var schemaResolver = new OpenApiSchemaResolver(document, settings.SchemaSettings); + var generator = new OpenApiDocumentGenerator(settings, schemaResolver); var context = new AspNetCoreOperationProcessorContext( document, operationDescription, GetType(), GetType().GetMethod(nameof(SomeAction), BindingFlags.NonPublic | BindingFlags.Instance), - new OpenApiDocumentGenerator(swaggerSettings, schemaResolver), - schemaGenerator, + generator, schemaResolver, - swaggerSettings, + settings, new List()) { ApiDescription = apiDescription, diff --git a/src/NSwag.Generation.AspNetCore.Tests/Requests/ConsumesTests.cs b/src/NSwag.Generation.AspNetCore.Tests/Requests/ConsumesTests.cs index 35189c8547..50f1ac3cc5 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Requests/ConsumesTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Requests/ConsumesTests.cs @@ -1,4 +1,6 @@ -using NSwag.Generation.AspNetCore.Tests.Web.Controllers.Requests; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; +using NSwag.Generation.AspNetCore.Tests.Web.Controllers.Requests; using System.Linq; using System.Threading.Tasks; using Xunit; @@ -13,8 +15,7 @@ public class ConsumesTests : AspNetCoreTestsBase public async Task When_consumes_is_defined_on_all_operations_then_it_is_added_to_the_document() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); - + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; // Act var document = await GenerateDocumentAsync(settings, typeof(ConsumesController)); var json = document.ToJson(); @@ -30,7 +31,7 @@ public async Task When_consumes_is_defined_on_all_operations_then_it_is_added_to public async Task When_consumes_is_defined_on_single_operations_then_it_is_added_to_the_operation() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; // Act var document = await GenerateDocumentAsync(settings, typeof(ConsumesController)); @@ -48,7 +49,7 @@ public async Task When_consumes_is_defined_on_single_operations_then_it_is_added public async Task When_operation_consumes_is_different_in_several_controllers_then_they_are_added_to_the_operation() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; // Act var document = await GenerateDocumentAsync(settings, typeof(ConsumesController), typeof(MultipartConsumesController)); @@ -57,7 +58,7 @@ public async Task When_operation_consumes_is_different_in_several_controllers_th // Assert const string expectedTestContentType = "foo/bar"; const string expectedMultipartContentType = "multipart/form-data"; - + var operation = document.Operations .First(o => o.Operation.OperationId == "Consumes_ConsumesOnOperation") .Operation; @@ -65,7 +66,7 @@ public async Task When_operation_consumes_is_different_in_several_controllers_th var multipartOperation = document.Operations .First(o => o.Operation.OperationId == "MultipartConsumes_ConsumesOnOperation") .Operation; - + Assert.DoesNotContain(expectedTestContentType, document.Consumes); Assert.DoesNotContain(expectedMultipartContentType, document.Consumes); diff --git a/src/NSwag.Generation.AspNetCore.Tests/Requests/PostBodyTests.cs b/src/NSwag.Generation.AspNetCore.Tests/Requests/PostBodyTests.cs index c30a7c0e64..08e308e949 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Requests/PostBodyTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Requests/PostBodyTests.cs @@ -1,4 +1,5 @@ using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.AspNetCore.Tests.Web.Controllers.Requests; using System.Linq; using System.Threading.Tasks; @@ -12,7 +13,13 @@ public class PostBodyTests : AspNetCoreTestsBase public async Task When_OpenApiBodyParameter_is_applied_with_JSON_then_request_body_is_any_type() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaType = SchemaType.OpenApi3 }; + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } + }; // Act var document = await GenerateDocumentAsync(settings, typeof(PostBodyController)); @@ -30,7 +37,13 @@ public async Task When_OpenApiBodyParameter_is_applied_with_JSON_then_request_bo public async Task When_OpenApiBodyParameter_is_applied_with_text_then_request_body_is_file() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaType = SchemaType.OpenApi3 }; + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } + }; // Act var document = await GenerateDocumentAsync(settings, typeof(PostBodyController)); diff --git a/src/NSwag.Generation.AspNetCore.Tests/Responses/NullableResponseTests.cs b/src/NSwag.Generation.AspNetCore.Tests/Responses/NullableResponseTests.cs index def679489f..6aa6273bc0 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Responses/NullableResponseTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Responses/NullableResponseTests.cs @@ -2,6 +2,7 @@ using System.Threading.Tasks; using NJsonSchema; using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.AspNetCore.Tests.Web.Controllers; using NSwag.Generation.AspNetCore.Tests.Web.Controllers.Responses; using Xunit; @@ -16,8 +17,11 @@ public async Task When_handling_is_NotNull_then_response_is_not_nullable() // Arrange var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { - SchemaType = SchemaType.OpenApi3, - DefaultResponseReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull + DefaultResponseReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } }; // Act @@ -35,8 +39,11 @@ public async Task When_handling_is_Null_then_response_is_nullable() // Arrange var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { - SchemaType = SchemaType.OpenApi3, - DefaultResponseReferenceTypeNullHandling = ReferenceTypeNullHandling.Null + DefaultResponseReferenceTypeNullHandling = ReferenceTypeNullHandling.Null, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } }; // Act @@ -54,8 +61,11 @@ public async Task When_nullable_xml_docs_is_set_to_true_then_response_is_nullabl // Arrange var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { - SchemaType = SchemaType.OpenApi3, - DefaultResponseReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull + DefaultResponseReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } }; // Act @@ -73,8 +83,11 @@ public async Task When_nullable_xml_docs_is_set_to_false_then_response_is_not_nu // Arrange var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { - SchemaType = SchemaType.OpenApi3, - DefaultResponseReferenceTypeNullHandling = ReferenceTypeNullHandling.Null + DefaultResponseReferenceTypeNullHandling = ReferenceTypeNullHandling.Null, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } }; // Act @@ -92,8 +105,11 @@ public async Task When_nullable_xml_docs_is_not_set_then_default_setting_NotNull // Arrange var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { - SchemaType = SchemaType.OpenApi3, - DefaultResponseReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull + DefaultResponseReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } }; // Act @@ -111,8 +127,11 @@ public async Task When_nullable_xml_docs_is_not_set_then_default_setting_Null_is // Arrange var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { - SchemaType = SchemaType.OpenApi3, - DefaultResponseReferenceTypeNullHandling = ReferenceTypeNullHandling.Null + DefaultResponseReferenceTypeNullHandling = ReferenceTypeNullHandling.Null, + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } }; // Act diff --git a/src/NSwag.Generation.AspNetCore.Tests/Responses/ProducesTests.cs b/src/NSwag.Generation.AspNetCore.Tests/Responses/ProducesTests.cs index 2e937d9e21..45a72ab53f 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Responses/ProducesTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Responses/ProducesTests.cs @@ -1,5 +1,8 @@ using System.Linq; using System.Threading.Tasks; +using NJsonSchema; +using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.AspNetCore.Tests.Web.Controllers.Responses; using Xunit; @@ -11,7 +14,7 @@ public class ProducesTests : AspNetCoreTestsBase public async Task When_produces_is_defined_on_all_operations_then_it_is_added_to_the_document() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; // Act var document = await GenerateDocumentAsync(settings, typeof(TextProducesController)); @@ -29,7 +32,7 @@ public async Task When_produces_is_defined_on_all_operations_then_it_is_added_to public async Task When_operation_produces_is_different_in_several_controllers_then_they_are_added_to_the_operation() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; // Act var document = await GenerateDocumentAsync(settings, typeof(TextProducesController), typeof(JsonProducesController)); diff --git a/src/NSwag.Generation.AspNetCore.Tests/Responses/ResponseAttributesTests.cs b/src/NSwag.Generation.AspNetCore.Tests/Responses/ResponseAttributesTests.cs index a8a18f9443..315e6f374a 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Responses/ResponseAttributesTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Responses/ResponseAttributesTests.cs @@ -1,5 +1,7 @@ using System.Linq; using System.Threading.Tasks; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.AspNetCore.Tests.Web.Controllers; using Xunit; @@ -11,7 +13,13 @@ public class ResponseAttributesTests : AspNetCoreTestsBase public async Task When_operation_has_SwaggerResponseAttribute_with_description_it_is_in_the_spec() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } + }; // Act var document = await GenerateDocumentAsync(settings, typeof(ResponsesController)); diff --git a/src/NSwag.Generation.AspNetCore.Tests/Responses/WrappedResponseTests.cs b/src/NSwag.Generation.AspNetCore.Tests/Responses/WrappedResponseTests.cs index f2196ee18d..57c61ec5bc 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Responses/WrappedResponseTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Responses/WrappedResponseTests.cs @@ -7,6 +7,8 @@ using NJsonSchema; using NSwag.Generation.AspNetCore.Tests.Web.Controllers.Responses; +using NJsonSchema.NewtonsoftJson.Generation; +using NJsonSchema.Generation; namespace NSwag.Generation.AspNetCore.Tests.Responses { @@ -16,7 +18,13 @@ public class WrappedResponseTests : AspNetCoreTestsBase public async Task When_response_is_wrapped_in_certain_generic_result_types_then_discard_the_wrapper_type() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + } + }; // Act var document = await GenerateDocumentAsync(settings, typeof(WrappedResponseController)); @@ -30,7 +38,7 @@ OpenApiResponse GetOperationResponse(string actionName) => document.Operations JsonObjectType GetOperationResponseSchemaType(string actionName) => GetOperationResponse(actionName).Schema.Type; - var intType = JsonSchema.FromType().Type; + var intType = NewtonsoftJsonSchemaGenerator.FromType().Type; Assert.Null(GetOperationResponse(nameof(WrappedResponseController.Task)).Schema); Assert.Equal(intType, GetOperationResponseSchemaType(nameof( WrappedResponseController.Int))); diff --git a/src/NSwag.Generation.AspNetCore.Tests/Responses/XmlDocsTests.cs b/src/NSwag.Generation.AspNetCore.Tests/Responses/XmlDocsTests.cs index 26374f8c45..c756ea112c 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/Responses/XmlDocsTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/Responses/XmlDocsTests.cs @@ -1,4 +1,6 @@ using System.Threading.Tasks; +using NJsonSchema; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Generation.AspNetCore.Tests.Web.Controllers; using Xunit; @@ -10,7 +12,7 @@ public class XmlDocsTests : AspNetCoreTestsBase public async Task When_operation_has_SwaggerResponseAttribute_with_description_it_is_in_the_spec() { // Arrange - var settings = new AspNetCoreOpenApiDocumentGeneratorSettings(); + var settings = new AspNetCoreOpenApiDocumentGeneratorSettings { SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings { SchemaType = SchemaType.OpenApi3 } }; // Act var document = await GenerateDocumentAsync(settings, typeof(XmlDocsController)); diff --git a/src/NSwag.Generation.AspNetCore.Tests/SystemTextJsonTests.cs b/src/NSwag.Generation.AspNetCore.Tests/SystemTextJsonTests.cs index 2f4dd0f5c7..3805b6a4e0 100644 --- a/src/NSwag.Generation.AspNetCore.Tests/SystemTextJsonTests.cs +++ b/src/NSwag.Generation.AspNetCore.Tests/SystemTextJsonTests.cs @@ -5,6 +5,7 @@ using Newtonsoft.Json.Converters; using NSwag.AspNetCore; using Xunit; +using NJsonSchema.Generation; namespace NSwag.Generation.AspNetCore.Tests { @@ -27,9 +28,11 @@ public async Task WhenSystemTextOptionsIsUsed_ThenOptionsAreConverted() var registration = serviceProvider.GetRequiredService(); var generator = new AspNetCoreOpenApiDocumentGenerator(registration.Settings); await generator.GenerateAsync(serviceProvider); + + var settings = generator.Settings; // Assert - Assert.Contains(registration.Settings.SerializerSettings.Converters, c => c is StringEnumConverter); + Assert.Contains(((SystemTextJsonSchemaGeneratorSettings)settings.SchemaSettings).SerializerOptions.Converters, c => c is JsonStringEnumConverter); } } } diff --git a/src/NSwag.Generation.AspNetCore/AspNetCoreOpenApiDocumentGenerator.cs b/src/NSwag.Generation.AspNetCore/AspNetCoreOpenApiDocumentGenerator.cs index 87338bb12a..d910af76e4 100644 --- a/src/NSwag.Generation.AspNetCore/AspNetCoreOpenApiDocumentGenerator.cs +++ b/src/NSwag.Generation.AspNetCore/AspNetCoreOpenApiDocumentGenerator.cs @@ -11,6 +11,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; +using System.Text.Json; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Abstractions; @@ -49,15 +50,6 @@ public AspNetCoreOpenApiDocumentGenerator(AspNetCoreOpenApiDocumentGeneratorSett public Task GenerateAsync(object serviceProvider) { var typedServiceProvider = (IServiceProvider)serviceProvider; - - var mvcOptions = typedServiceProvider.GetRequiredService>(); - var settings = - mvcOptions.Value.OutputFormatters.Any(f => f.GetType().Name == "SystemTextJsonOutputFormatter") ? - GetSystemTextJsonSettings(typedServiceProvider) : - GetJsonSerializerSettings(typedServiceProvider) ?? GetSystemTextJsonSettings(typedServiceProvider); - - Settings.ApplySettings(settings, mvcOptions.Value); - var apiDescriptionGroupCollectionProvider = typedServiceProvider.GetRequiredService(); return GenerateAsync(apiDescriptionGroupCollectionProvider.ApiDescriptionGroups); } @@ -123,14 +115,15 @@ public async Task GenerateAsync(ApiDescriptionGroupCollection a .ToArray(); var document = await CreateDocumentAsync().ConfigureAwait(false); - var schemaResolver = new OpenApiSchemaResolver(document, Settings); + var schemaResolver = new OpenApiSchemaResolver(document, Settings.SchemaSettings); var apiGroups = apiDescriptions .Select(apiDescription => new Tuple(apiDescription, apiDescription.ActionDescriptor)) .GroupBy(item => (item.Item2 as ControllerActionDescriptor)?.ControllerTypeInfo.AsType()) .ToArray(); - var usedControllerTypes = GenerateApiGroups(document, apiGroups, schemaResolver); + var generator = new OpenApiDocumentGenerator(Settings, schemaResolver); + var usedControllerTypes = GenerateApiGroups(generator, document, apiGroups, schemaResolver); document.GenerateOperationIds(); @@ -141,7 +134,7 @@ public async Task GenerateAsync(ApiDescriptionGroupCollection a foreach (var processor in Settings.DocumentProcessors) { - processor.Process(new DocumentProcessorContext(document, controllerTypes, usedControllerTypes, schemaResolver, Settings.SchemaGenerator, Settings)); + processor.Process(new DocumentProcessorContext(document, controllerTypes, usedControllerTypes, schemaResolver, generator.SchemaGenerator, Settings)); } Settings.PostProcess?.Invoke(document); @@ -150,7 +143,7 @@ public async Task GenerateAsync(ApiDescriptionGroupCollection a /// Gets the default serializer settings representing System.Text.Json. /// The settings. - public static JsonSerializerSettings GetSystemTextJsonSettings(IServiceProvider serviceProvider) + public static JsonSerializerOptions GetSystemTextJsonSettings(IServiceProvider serviceProvider) { // If the ASP.NET Core website does not use Newtonsoft.JSON we need to provide a // contract resolver which reflects best the System.Text.Json behavior. @@ -166,9 +159,9 @@ public static JsonSerializerSettings GetSystemTextJsonSettings(IServiceProvider var options = serviceProvider.GetService(optionsType); var value = optionsType.GetProperty("Value")?.GetValue(options); var jsonOptions = value?.GetType().GetProperty("JsonSerializerOptions")?.GetValue(value); - if (jsonOptions != null && jsonOptions.GetType().FullName == "System.Text.Json.JsonSerializerOptions") + if (jsonOptions is JsonSerializerOptions) { - return SystemTextJsonUtilities.ConvertJsonOptionsToNewtonsoftSettings(jsonOptions); + return (JsonSerializerOptions)jsonOptions; } } catch @@ -176,20 +169,16 @@ public static JsonSerializerSettings GetSystemTextJsonSettings(IServiceProvider } } - return new JsonSerializerSettings - { - ContractResolver = new CamelCasePropertyNamesContractResolver() - }; + return null; } private List GenerateApiGroups( + OpenApiDocumentGenerator generator, OpenApiDocument document, IGrouping>[] apiGroups, OpenApiSchemaResolver schemaResolver) { var usedControllerTypes = new List(); - var swaggerGenerator = new OpenApiDocumentGenerator(Settings, schemaResolver); - var allOperations = new List>(); foreach (var apiGroup in apiGroups) { @@ -258,7 +247,7 @@ private List GenerateApiGroups( operations.Add(new Tuple(operationDescription, apiDescription, method)); } - var addedOperations = AddOperationDescriptionsToDocument(document, controllerType, operations, swaggerGenerator, schemaResolver); + var addedOperations = AddOperationDescriptionsToDocument(document, controllerType, operations, generator, schemaResolver); if (addedOperations.Any() && apiGroup.Key != null) { usedControllerTypes.Add(apiGroup.Key); @@ -384,7 +373,7 @@ await OpenApiDocument.FromJsonAsync(Settings.DocumentTemplate).ConfigureAwait(fa new OpenApiDocument(); document.Generator = $"NSwag v{OpenApiDocument.ToolchainVersion} (NJsonSchema v{JsonSchema.ToolchainVersion})"; - document.SchemaType = Settings.SchemaType; + document.SchemaType = Settings.SchemaSettings.SchemaType; if (document.Info == null) { @@ -412,10 +401,10 @@ await OpenApiDocument.FromJsonAsync(Settings.DocumentTemplate).ConfigureAwait(fa return document; } - private bool RunOperationProcessors(OpenApiDocument document, ApiDescription apiDescription, Type controllerType, MethodInfo methodInfo, OpenApiOperationDescription operationDescription, List allOperations, OpenApiDocumentGenerator swaggerGenerator, OpenApiSchemaResolver schemaResolver) + private bool RunOperationProcessors(OpenApiDocument document, ApiDescription apiDescription, Type controllerType, MethodInfo methodInfo, OpenApiOperationDescription operationDescription, List allOperations, OpenApiDocumentGenerator generator, OpenApiSchemaResolver schemaResolver) { // 1. Run from settings - var operationProcessorContext = new AspNetCoreOperationProcessorContext(document, operationDescription, controllerType, methodInfo, swaggerGenerator, Settings.SchemaGenerator, schemaResolver, Settings, allOperations) + var operationProcessorContext = new AspNetCoreOperationProcessorContext(document, operationDescription, controllerType, methodInfo, generator, schemaResolver, Settings, allOperations) { ApiDescription = apiDescription, }; @@ -515,12 +504,12 @@ private string GetOperationId(OpenApiDocument document, ApiDescription apiDescri // From HTTP method and route operationId = - httpMethod[0].ToString().ToUpperInvariant() + httpMethod.Substring(1) + - string.Join("", apiDescription.RelativePath - .Split('/', '\\', '}', ']', '-', '_') - .Where(t => !t.StartsWith("{")) - .Where(t => !t.StartsWith("[")) - .Select(t => t.Length > 1 ? t[0].ToString().ToUpperInvariant() + t.Substring(1) : t.ToUpperInvariant())); + httpMethod[0].ToString().ToUpperInvariant() + httpMethod.Substring(1) + + string.Join("", apiDescription.RelativePath + .Split('/', '\\', '}', ']', '-', '_') + .Where(t => !t.StartsWith("{")) + .Where(t => !t.StartsWith("[")) + .Select(t => t.Length > 1 ? t[0].ToString().ToUpperInvariant() + t.Substring(1) : t.ToUpperInvariant())); } var number = 1; diff --git a/src/NSwag.Generation.AspNetCore/AspNetCoreOpenApiDocumentGeneratorSettings.cs b/src/NSwag.Generation.AspNetCore/AspNetCoreOpenApiDocumentGeneratorSettings.cs index 9fc6ffc3d8..2822af25af 100644 --- a/src/NSwag.Generation.AspNetCore/AspNetCoreOpenApiDocumentGeneratorSettings.cs +++ b/src/NSwag.Generation.AspNetCore/AspNetCoreOpenApiDocumentGeneratorSettings.cs @@ -40,7 +40,7 @@ public AspNetCoreOpenApiDocumentGeneratorSettings() /// /// Gets or sets a value indicating whether a route name associated with an action is used to generate its operationId. /// - /// If SwaggerOperationAttribute is present, it will be preferred over the route name irrespective of this property. + /// If OpenApiOperationAttribute is present, it will be preferred over the route name irrespective of this property. public bool UseRouteNameAsOperationId { get; set; } } } \ No newline at end of file diff --git a/src/NSwag.Generation.AspNetCore/AspNetCoreOperationProcessorContext.cs b/src/NSwag.Generation.AspNetCore/AspNetCoreOperationProcessorContext.cs index 3fd302ff7c..0049fd6540 100644 --- a/src/NSwag.Generation.AspNetCore/AspNetCoreOperationProcessorContext.cs +++ b/src/NSwag.Generation.AspNetCore/AspNetCoreOperationProcessorContext.cs @@ -25,22 +25,20 @@ public class AspNetCoreOperationProcessorContext : OperationProcessorContext /// The operation description. /// Type of the controller. /// The method information. - /// The swagger generator. + /// The OpenAPI generator. /// The schema resolver. /// The sett /// All operation descriptions. - /// The schema generator. public AspNetCoreOperationProcessorContext( OpenApiDocument document, OpenApiOperationDescription operationDescription, Type controllerType, MethodInfo methodInfo, - OpenApiDocumentGenerator swaggerGenerator, - JsonSchemaGenerator schemaGenerator, + OpenApiDocumentGenerator documentGenerator, JsonSchemaResolver schemaResolver, OpenApiDocumentGeneratorSettings settings, IList allOperationDescriptions) - : base(document, operationDescription, controllerType, methodInfo, swaggerGenerator, schemaGenerator, schemaResolver, settings, allOperationDescriptions) + : base(document, operationDescription, controllerType, methodInfo, documentGenerator, schemaResolver, settings, allOperationDescriptions) { } diff --git a/src/NSwag.Generation.AspNetCore/NSwag.Generation.AspNetCore.csproj b/src/NSwag.Generation.AspNetCore/NSwag.Generation.AspNetCore.csproj index 9b0b7c4e90..d1bd22a5ac 100644 --- a/src/NSwag.Generation.AspNetCore/NSwag.Generation.AspNetCore.csproj +++ b/src/NSwag.Generation.AspNetCore/NSwag.Generation.AspNetCore.csproj @@ -1,46 +1,41 @@  - netstandard1.6;net461;netstandard2.0;netcoreapp3.1;net5.0;net6.0;net7.0 + net462;netstandard2.0;netcoreapp3.1;net6.0;net7.0 Swagger Documentation AspNetCore $(DefineConstants);ASPNETCORE bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml - + - - + - - - - - - - - - - + - + + + + + +
\ No newline at end of file diff --git a/src/NSwag.Generation.AspNetCore/Processors/AspNetCoreOperationTagsProcessor.cs b/src/NSwag.Generation.AspNetCore/Processors/AspNetCoreOperationTagsProcessor.cs index d0ab96792a..9fbf3c0b89 100644 --- a/src/NSwag.Generation.AspNetCore/Processors/AspNetCoreOperationTagsProcessor.cs +++ b/src/NSwag.Generation.AspNetCore/Processors/AspNetCoreOperationTagsProcessor.cs @@ -12,6 +12,7 @@ using NSwag.Generation.Processors; using NSwag.Generation.Processors.Contexts; using System.Linq; +using NJsonSchema.Generation; namespace NSwag.Generation.AspNetCore.Processors { @@ -48,7 +49,7 @@ protected override void AddControllerNameTag(OperationProcessorContext context) var aspNetCoreContext = (AspNetCoreOperationProcessorContext)context; if (aspNetCoreContext.ApiDescription.ActionDescriptor is ControllerActionDescriptor controllerActionDescriptor) { - var summary = controllerActionDescriptor.ControllerTypeInfo.GetXmlDocsSummary(context.Settings.GetXmlDocsOptions()); + var summary = controllerActionDescriptor.ControllerTypeInfo.GetXmlDocsSummary(context.Settings.SchemaSettings.GetXmlDocsOptions()); aspNetCoreContext.OperationDescription.Operation.Tags.Add(controllerActionDescriptor.ControllerName); UpdateDocumentTagDescription(context, controllerActionDescriptor.ControllerName, summary); } diff --git a/src/NSwag.Generation.AspNetCore/Processors/OperationParameterProcessor.cs b/src/NSwag.Generation.AspNetCore/Processors/OperationParameterProcessor.cs index 10c0e1427a..472512dc05 100644 --- a/src/NSwag.Generation.AspNetCore/Processors/OperationParameterProcessor.cs +++ b/src/NSwag.Generation.AspNetCore/Processors/OperationParameterProcessor.cs @@ -67,7 +67,7 @@ public bool Process(OperationProcessorContext operationProcessorContext) // value that's different than the parameter name. Additionally, ApiExplorer will recurse in to complex model bound types // and expose properties as top level parameters. Consequently, determining the property or parameter of an Api is best // effort attempt. - var extendedApiParameter = new ExtendedApiParameterDescription(_settings) + var extendedApiParameter = new ExtendedApiParameterDescription(_settings.SchemaSettings) { ApiParameter = apiParameter, Attributes = Enumerable.Empty(), @@ -164,7 +164,7 @@ public bool Process(OperationProcessorContext operationProcessorContext) } else if (apiParameter.Source == BindingSource.Form) { - if (_settings.SchemaType == SchemaType.Swagger2) + if (_settings.SchemaSettings.SchemaType == SchemaType.Swagger2) { operationParameter = CreatePrimitiveParameter(context, extendedApiParameter); operationParameter.Kind = OpenApiParameterKind.FormData; @@ -192,7 +192,7 @@ public bool Process(OperationProcessorContext operationProcessorContext) operationParameter.Position = position; position++; - if (_settings.SchemaType == SchemaType.OpenApi3) + if (_settings.SchemaSettings.SchemaType == SchemaType.OpenApi3) { operationParameter.IsNullableRaw = null; } @@ -239,8 +239,8 @@ private void ApplyOpenApiBodyParameterAttribute(OpenApiOperationDescription oper { Schema = mimeType == "application/json" ? JsonSchema.CreateAnySchema() : new JsonSchema { - Type = _settings.SchemaType == SchemaType.Swagger2 ? JsonObjectType.File : JsonObjectType.String, - Format = _settings.SchemaType == SchemaType.Swagger2 ? null : JsonFormatStrings.Binary, + Type = _settings.SchemaSettings.SchemaType == SchemaType.Swagger2 ? JsonObjectType.File : JsonObjectType.String, + Format = _settings.SchemaSettings.SchemaType == SchemaType.Swagger2 ? null : JsonFormatStrings.Binary, } }; } @@ -280,7 +280,7 @@ private void RemoveUnusedPathParameters(OpenApiOperationDescription operationDes private bool TryAddFileParameter( OperationProcessorContext context, ExtendedApiParameterDescription extendedApiParameter) { - var typeInfo = _settings.ReflectionService.GetDescription(extendedApiParameter.ParameterType.ToContextualType(extendedApiParameter.Attributes), _settings); + var typeInfo = _settings.SchemaSettings.ReflectionService.GetDescription(extendedApiParameter.ParameterType.ToContextualType(extendedApiParameter.Attributes), _settings.SchemaSettings); var isFileArray = IsFileArray(extendedApiParameter.ApiParameter.Type, typeInfo); @@ -303,7 +303,7 @@ private bool TryAddFileParameter( private void AddFileParameter(OperationProcessorContext context, ExtendedApiParameterDescription extendedApiParameter, bool isFileArray) { - if (_settings.SchemaType == SchemaType.Swagger2) + if (_settings.SchemaSettings.SchemaType == SchemaType.Swagger2) { var operationParameter = CreatePrimitiveParameter(context, extendedApiParameter); operationParameter.Type = JsonObjectType.File; @@ -364,7 +364,7 @@ private bool IsFileArray(Type type, JsonTypeDescription typeInfo) if (typeInfo.Type == JsonObjectType.Array && type.GenericTypeArguments.Any()) { - var description = _settings.ReflectionService.GetDescription(type.GenericTypeArguments[0].ToContextualType(), _settings); + var description = _settings.SchemaSettings.ReflectionService.GetDescription(type.GenericTypeArguments[0].ToContextualType(), _settings.SchemaSettings); if (description.Type == JsonObjectType.File || description.Format == JsonFormatStrings.Binary) { return true; @@ -381,7 +381,7 @@ private OpenApiParameter AddBodyParameter(OperationProcessorContext context, Ext var contextualParameterType = extendedApiParameter.ParameterType .ToContextualType(extendedApiParameter.Attributes); - var typeDescription = _settings.ReflectionService.GetDescription(contextualParameterType, _settings); + var typeDescription = _settings.SchemaSettings.ReflectionService.GetDescription(contextualParameterType, _settings.SchemaSettings); var isNullable = _settings.AllowNullableBodyParameters && typeDescription.IsNullable; var operation = context.OperationDescription.Operation; @@ -464,14 +464,14 @@ private OpenApiParameter CreatePrimitiveParameter( var defaultValue = hasDefaultValue ? context.SchemaGenerator .ConvertDefaultValue(contextualParameterType, extendedApiParameter.ParameterInfo.DefaultValue) : null; - if (_settings.SchemaType == SchemaType.Swagger2) + if (_settings.SchemaSettings.SchemaType == SchemaType.Swagger2) { operationParameter.Default = defaultValue; operationParameter.Example = exampleValue; } else if (operationParameter.Schema.HasReference) { - if (_settings.AllowReferencesWithProperties) + if (_settings.SchemaSettings.AllowReferencesWithProperties) { operationParameter.Schema = new JsonSchema { diff --git a/src/NSwag.Generation.AspNetCore/Processors/OperationResponseProcessor.cs b/src/NSwag.Generation.AspNetCore/Processors/OperationResponseProcessor.cs index abaeccc696..1252c54564 100644 --- a/src/NSwag.Generation.AspNetCore/Processors/OperationResponseProcessor.cs +++ b/src/NSwag.Generation.AspNetCore/Processors/OperationResponseProcessor.cs @@ -84,7 +84,7 @@ public bool Process(OperationProcessorContext operationProcessorContext) var nullableXmlAttribute = GetResponseXmlDocsElement(context.MethodInfo, httpStatusCode)?.Attribute("nullable"); var isResponseNullable = nullableXmlAttribute != null ? nullableXmlAttribute.Value.ToLowerInvariant() == "true" : - _settings.ReflectionService.GetDescription(contextualReturnType, _settings.DefaultResponseReferenceTypeNullHandling, _settings).IsNullable; + _settings.SchemaSettings.ReflectionService.GetDescription(contextualReturnType, _settings.DefaultResponseReferenceTypeNullHandling, _settings.SchemaSettings).IsNullable; response.IsNullableRaw = isResponseNullable; response.Schema = context.SchemaGenerator.GenerateWithReferenceAndNullability( @@ -102,8 +102,8 @@ public bool Process(OperationProcessorContext operationProcessorContext) IsNullableRaw = true, Schema = new JsonSchema { - Type = _settings.SchemaType == SchemaType.Swagger2 ? JsonObjectType.File : JsonObjectType.String, - Format = _settings.SchemaType == SchemaType.Swagger2 ? null : JsonFormatStrings.Binary, + Type = _settings.SchemaSettings.SchemaType == SchemaType.Swagger2 ? JsonObjectType.File : JsonObjectType.String, + Format = _settings.SchemaSettings.SchemaType == SchemaType.Swagger2 ? null : JsonFormatStrings.Binary, } }; } diff --git a/src/NSwag.Generation.Tests/NSwag.Generation.Tests.csproj b/src/NSwag.Generation.Tests/NSwag.Generation.Tests.csproj index 7b21162bb1..074dc14e19 100644 --- a/src/NSwag.Generation.Tests/NSwag.Generation.Tests.csproj +++ b/src/NSwag.Generation.Tests/NSwag.Generation.Tests.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + net7.0 false true $(NoWarn);1591 @@ -11,6 +11,7 @@ +
diff --git a/src/NSwag.Generation.Tests/OpenApiDocumentGeneratorTests.cs b/src/NSwag.Generation.Tests/OpenApiDocumentGeneratorTests.cs index d9e219ae7a..628d864f6c 100644 --- a/src/NSwag.Generation.Tests/OpenApiDocumentGeneratorTests.cs +++ b/src/NSwag.Generation.Tests/OpenApiDocumentGeneratorTests.cs @@ -2,6 +2,7 @@ using Namotion.Reflection; using NJsonSchema; using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; using Xunit; namespace NSwag.Generation.Tests @@ -20,11 +21,13 @@ private OpenApiParameter GetParameter(SchemaType schemaType) { var generatorSettings = new OpenApiDocumentGeneratorSettings { - SchemaType = schemaType, - ReflectionService = new DefaultReflectionService() + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings + { + SchemaType = schemaType, + } }; - var schemaResolver = new JsonSchemaResolver(new OpenApiDocument(), generatorSettings); + var schemaResolver = new JsonSchemaResolver(new OpenApiDocument(), generatorSettings.SchemaSettings); var generator = new OpenApiDocumentGenerator(generatorSettings, schemaResolver); var methodInfo = typeof(TestController) .ToContextualType() diff --git a/src/NSwag.Generation.Tests/Processors/OperationSummaryAndDescriptionProcessorTests.cs b/src/NSwag.Generation.Tests/Processors/OperationSummaryAndDescriptionProcessorTests.cs index 2a26fbb9f9..7db1f34acd 100644 --- a/src/NSwag.Generation.Tests/Processors/OperationSummaryAndDescriptionProcessorTests.cs +++ b/src/NSwag.Generation.Tests/Processors/OperationSummaryAndDescriptionProcessorTests.cs @@ -1,6 +1,8 @@ using System; using System.ComponentModel; using System.Reflection; +using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Annotations; using NSwag.Generation.Processors; using NSwag.Generation.Processors.Contexts; @@ -100,8 +102,12 @@ private OperationProcessorContext GetContext(Type controllerType, MethodInfo met { var document = new OpenApiDocument(); var operationDescription = new OpenApiOperationDescription { Operation = new OpenApiOperation() }; - var settings = new OpenApiDocumentGeneratorSettings(); - return new OperationProcessorContext(document, operationDescription, controllerType, methodInfo, null, null, null, settings, null); + var settings = new OpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings() + }; + + return new OperationProcessorContext(document, operationDescription, controllerType, methodInfo, null, null, settings, null); } } } diff --git a/src/NSwag.Generation.Tests/Processors/OperationTagsProcessorTests.cs b/src/NSwag.Generation.Tests/Processors/OperationTagsProcessorTests.cs index 64e03b2aa7..c16ecfbf3b 100644 --- a/src/NSwag.Generation.Tests/Processors/OperationTagsProcessorTests.cs +++ b/src/NSwag.Generation.Tests/Processors/OperationTagsProcessorTests.cs @@ -1,5 +1,7 @@ using System; using System.Reflection; +using NJsonSchema.Generation; +using NJsonSchema.NewtonsoftJson.Generation; using NSwag.Annotations; using NSwag.Generation.Processors; using NSwag.Generation.Processors.Contexts; @@ -130,8 +132,12 @@ private OperationProcessorContext GetContext(Type controllerType, MethodInfo met { var document = new OpenApiDocument(); var operationDescription = new OpenApiOperationDescription { Operation = new OpenApiOperation() }; - var settings = new OpenApiDocumentGeneratorSettings { UseControllerSummaryAsTagDescription = true }; - return new OperationProcessorContext(document, operationDescription, controllerType, methodInfo, null, null, null, settings, null); + var settings = new OpenApiDocumentGeneratorSettings + { + SchemaSettings = new NewtonsoftJsonSchemaGeneratorSettings(), + UseControllerSummaryAsTagDescription = true + }; + return new OperationProcessorContext(document, operationDescription, controllerType, methodInfo, null, null, settings, null); } } } diff --git a/src/NSwag.Generation.WebApi/NSwag.Generation.WebApi.csproj b/src/NSwag.Generation.WebApi/NSwag.Generation.WebApi.csproj index ecba6cd684..1e4ada5c78 100644 --- a/src/NSwag.Generation.WebApi/NSwag.Generation.WebApi.csproj +++ b/src/NSwag.Generation.WebApi/NSwag.Generation.WebApi.csproj @@ -1,20 +1,24 @@  - - netstandard1.0;net45;netstandard2.0 + netstandard2.0;net462 bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml - + - + + - - + + + + + + + - + - - +
\ No newline at end of file diff --git a/src/NSwag.Generation.WebApi/Processors/OperationParameterProcessor.cs b/src/NSwag.Generation.WebApi/Processors/OperationParameterProcessor.cs index 7791f851fc..03a0c5e642 100644 --- a/src/NSwag.Generation.WebApi/Processors/OperationParameterProcessor.cs +++ b/src/NSwag.Generation.WebApi/Processors/OperationParameterProcessor.cs @@ -72,7 +72,7 @@ public bool Process(OperationProcessorContext context) operationParameter.Kind = OpenApiParameterKind.Path; operationParameter.IsRequired = true; // Path is always required => property not needed - if (_settings.SchemaType == SchemaType.Swagger2) + if (_settings.SchemaSettings.SchemaType == SchemaType.Swagger2) { operationParameter.IsNullableRaw = false; } @@ -81,7 +81,7 @@ public bool Process(OperationProcessorContext context) } else { - var parameterInfo = _settings.ReflectionService.GetDescription(contextualParameter, _settings); + var parameterInfo = _settings.SchemaSettings.ReflectionService.GetDescription(contextualParameter, _settings.SchemaSettings); operationParameter = TryAddFileParameter(context, parameterInfo, contextualParameter); if (operationParameter == null) @@ -185,7 +185,7 @@ public bool Process(OperationProcessorContext context) operationParameter.Position = position; position++; - if (_settings.SchemaType == SchemaType.OpenApi3) + if (_settings.SchemaSettings.SchemaType == SchemaType.OpenApi3) { operationParameter.IsNullableRaw = null; } @@ -216,7 +216,7 @@ public bool Process(OperationProcessorContext context) ApplyOpenApiBodyParameterAttribute(context.OperationDescription, context.MethodInfo); RemoveUnusedPathParameters(context.OperationDescription, httpPath); UpdateConsumedTypes(context.OperationDescription); - UpdateNullableRawOperationParameters(context.OperationDescription, _settings.SchemaType); + UpdateNullableRawOperationParameters(context.OperationDescription, _settings.SchemaSettings.SchemaType); EnsureSingleBodyParameter(context.OperationDescription); @@ -245,8 +245,8 @@ private void ApplyOpenApiBodyParameterAttribute(OpenApiOperationDescription oper { Schema = mimeType == "application/json" ? JsonSchema.CreateAnySchema() : new JsonSchema { - Type = _settings.SchemaType == SchemaType.Swagger2 ? JsonObjectType.File : JsonObjectType.String, - Format = _settings.SchemaType == SchemaType.Swagger2 ? null : JsonFormatStrings.Binary, + Type = _settings.SchemaSettings.SchemaType == SchemaType.Swagger2 ? JsonObjectType.File : JsonObjectType.String, + Format = _settings.SchemaSettings.SchemaType == SchemaType.Swagger2 ? null : JsonFormatStrings.Binary, } }; } @@ -320,7 +320,7 @@ private OpenApiParameter TryAddFileParameter( private OpenApiParameter AddFileParameter(OperationProcessorContext context, ContextualParameterInfo contextualParameter, bool isFileArray) { // TODO: Check if there is a way to control the property name - var parameterDocumentation = contextualParameter.GetDescription(_settings); + var parameterDocumentation = contextualParameter.GetDescription(_settings.SchemaSettings); var operationParameter = context.DocumentGenerator.CreatePrimitiveParameter( contextualParameter.Name, parameterDocumentation, contextualParameter); @@ -339,7 +339,7 @@ private bool IsFileArray(Type type, JsonTypeDescription typeInfo) if (typeInfo.Type == JsonObjectType.Array && type.GenericTypeArguments.Any()) { - var description = _settings.ReflectionService.GetDescription(type.GenericTypeArguments[0].ToContextualType(), _settings); + var description = _settings.SchemaSettings.ReflectionService.GetDescription(type.GenericTypeArguments[0].ToContextualType(), _settings.SchemaSettings); if (description.Type == JsonObjectType.File || description.Format == JsonFormatStrings.Binary) { @@ -354,7 +354,7 @@ private OpenApiParameter AddBodyParameter(OperationProcessorContext context, str { OpenApiParameter operationParameter; - var typeDescription = _settings.ReflectionService.GetDescription(contextualParameter, _settings); + var typeDescription = _settings.SchemaSettings.ReflectionService.GetDescription(contextualParameter, _settings.SchemaSettings); var isRequired = _settings.AllowNullableBodyParameters == false || contextualParameter.ContextAttributes.FirstAssignableToTypeNameOrDefault("RequiredAttribute", TypeNameStyle.Name) != null; var isNullable = _settings.AllowNullableBodyParameters && (typeDescription.IsNullable && !isRequired); @@ -373,7 +373,7 @@ private OpenApiParameter AddBodyParameter(OperationProcessorContext context, str }, IsNullableRaw = isNullable, IsRequired = isRequired, - Description = contextualParameter.GetDescription(_settings) + Description = contextualParameter.GetDescription(_settings.SchemaSettings) }; operation.Parameters.Add(operationParameter); } @@ -392,7 +392,7 @@ private OpenApiParameter AddBodyParameter(OperationProcessorContext context, str }, IsNullableRaw = isNullable, IsRequired = isRequired, - Description = contextualParameter.GetDescription(_settings) + Description = contextualParameter.GetDescription(_settings.SchemaSettings) }; operation.Parameters.Add(operationParameter); } @@ -404,7 +404,7 @@ private OpenApiParameter AddBodyParameter(OperationProcessorContext context, str Kind = OpenApiParameterKind.Body, IsRequired = isRequired, IsNullableRaw = isNullable, - Description = contextualParameter.GetDescription(_settings), + Description = contextualParameter.GetDescription(_settings.SchemaSettings), Schema = context.SchemaGenerator.GenerateWithReferenceAndNullability( contextualParameter, isNullable, schemaResolver: context.SchemaResolver) }; @@ -421,7 +421,7 @@ private OpenApiParameter AddPrimitiveParametersFromUri( if (typeDescription.Type.HasFlag(JsonObjectType.Array)) { - var parameterDocumentation = contextualParameter.GetDescription(_settings); + var parameterDocumentation = contextualParameter.GetDescription(_settings.SchemaSettings); var operationParameter = context.DocumentGenerator.CreatePrimitiveParameter( name, parameterDocumentation, contextualParameter); @@ -439,7 +439,7 @@ private OpenApiParameter AddPrimitiveParametersFromUri( { var fromQueryAttribute = contextualProperty.ContextAttributes.SingleOrDefault(a => a.GetType().Name == "FromQueryAttribute"); var propertyName = fromQueryAttribute.TryGetPropertyValue("Name") ?? - context.SchemaGenerator.GetPropertyName(null, contextualProperty); + _settings.SchemaSettings.ReflectionService.GetPropertyName(contextualProperty, _settings.SchemaSettings); dynamic fromRouteAttribute = contextualProperty.ContextAttributes.SingleOrDefault(a => a.GetType().FullName == "Microsoft.AspNetCore.Mvc.FromRouteAttribute"); if (fromRouteAttribute != null && !string.IsNullOrEmpty(fromRouteAttribute?.Name)) @@ -453,12 +453,12 @@ private OpenApiParameter AddPrimitiveParametersFromUri( propertyName = fromHeaderAttribute?.Name; } - var propertySummary = contextualProperty.PropertyInfo.GetXmlDocsSummary(_settings.GetXmlDocsOptions()); + var propertySummary = contextualProperty.PropertyInfo.GetXmlDocsSummary(_settings.SchemaSettings.GetXmlDocsOptions()); var operationParameter = context.DocumentGenerator.CreatePrimitiveParameter(propertyName, propertySummary, contextualProperty.AccessorType); // TODO: Check if required can be controlled with mechanisms other than RequiredAttribute - var parameterInfo = _settings.ReflectionService.GetDescription(contextualProperty.AccessorType, _settings); + var parameterInfo = _settings.SchemaSettings.ReflectionService.GetDescription(contextualProperty.AccessorType, _settings.SchemaSettings); var isFileArray = IsFileArray(contextualProperty.AccessorType.Type, parameterInfo); if (parameterInfo.Type == JsonObjectType.File || isFileArray) @@ -502,7 +502,7 @@ private OpenApiParameter AddPrimitiveParameter( var defaultValue = context.SchemaGenerator.ConvertDefaultValue( contextualParameter, contextualParameter.ParameterInfo.DefaultValue); - if (_settings.SchemaType == SchemaType.Swagger2) + if (_settings.SchemaSettings.SchemaType == SchemaType.Swagger2) { operationParameter.Default = defaultValue; } diff --git a/src/NSwag.Generation.WebApi/WebApiOpenApiDocumentGenerator.cs b/src/NSwag.Generation.WebApi/WebApiOpenApiDocumentGenerator.cs index 7c248ef66b..8094e31fdf 100644 --- a/src/NSwag.Generation.WebApi/WebApiOpenApiDocumentGenerator.cs +++ b/src/NSwag.Generation.WebApi/WebApiOpenApiDocumentGenerator.cs @@ -79,12 +79,12 @@ public Task GenerateForControllerAsync(Type controllerType) public async Task GenerateForControllersAsync(IEnumerable controllerTypes) { var document = await CreateDocumentAsync().ConfigureAwait(false); - var schemaResolver = new OpenApiSchemaResolver(document, Settings); + var schemaResolver = new OpenApiSchemaResolver(document, Settings.SchemaSettings); + var generator = new OpenApiDocumentGenerator(Settings, schemaResolver); var usedControllerTypes = new List(); foreach (var controllerType in controllerTypes) { - var generator = new OpenApiDocumentGenerator(Settings, schemaResolver); var isIncluded = GenerateForController(document, controllerType, generator, schemaResolver); if (isIncluded) { @@ -97,7 +97,7 @@ public async Task GenerateForControllersAsync(IEnumerable foreach (var processor in Settings.DocumentProcessors) { processor.Process(new DocumentProcessorContext(document, controllerTypes, - usedControllerTypes, schemaResolver, Settings.SchemaGenerator, Settings)); + usedControllerTypes, schemaResolver, generator.SchemaGenerator, Settings)); } return document; @@ -110,7 +110,7 @@ await OpenApiDocument.FromJsonAsync(Settings.DocumentTemplate).ConfigureAwait(fa new OpenApiDocument(); document.Generator = "NSwag v" + OpenApiDocument.ToolchainVersion + " (NJsonSchema v" + JsonSchema.ToolchainVersion + ")"; - document.SchemaType = Settings.SchemaType; + document.SchemaType = Settings.SchemaSettings.SchemaType; document.Consumes = new List { "application/json" }; document.Produces = new List { "application/json" }; @@ -232,10 +232,11 @@ private bool AddOperationDescriptionsToDocument(OpenApiDocument document, Type c return addedOperations > 0; } - private bool RunOperationProcessors(OpenApiDocument document, Type controllerType, MethodInfo methodInfo, OpenApiOperationDescription operationDescription, List allOperations, OpenApiDocumentGenerator swaggerGenerator, OpenApiSchemaResolver schemaResolver) + private bool RunOperationProcessors(OpenApiDocument document, Type controllerType, MethodInfo methodInfo, OpenApiOperationDescription operationDescription, + List allOperations, OpenApiDocumentGenerator generator, OpenApiSchemaResolver schemaResolver) { var context = new OperationProcessorContext(document, operationDescription, controllerType, - methodInfo, swaggerGenerator, Settings.SchemaGenerator, schemaResolver, Settings, allOperations); + methodInfo, generator, schemaResolver, Settings, allOperations); // 1. Run from settings foreach (var operationProcessor in Settings.OperationProcessors) diff --git a/src/NSwag.Generation.WebApi/WebApiOpenApiDocumentGeneratorSettings.cs b/src/NSwag.Generation.WebApi/WebApiOpenApiDocumentGeneratorSettings.cs index 725c68bc27..a451b26600 100644 --- a/src/NSwag.Generation.WebApi/WebApiOpenApiDocumentGeneratorSettings.cs +++ b/src/NSwag.Generation.WebApi/WebApiOpenApiDocumentGeneratorSettings.cs @@ -6,6 +6,7 @@ // Rico Suter, mail@rsuter.com //----------------------------------------------------------------------- +using NJsonSchema.Generation; using NSwag.Generation.Processors; using NSwag.Generation.WebApi.Processors; diff --git a/src/NSwag.Generation/NSwag.Generation.csproj b/src/NSwag.Generation/NSwag.Generation.csproj index a98d5a4389..1a9b9cbda6 100644 --- a/src/NSwag.Generation/NSwag.Generation.csproj +++ b/src/NSwag.Generation/NSwag.Generation.csproj @@ -1,22 +1,21 @@  - netstandard1.0;net45;netstandard2.0 + netstandard2.0;net462 bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml $(NoWarn),618 - + - - + + - - + + - + - \ No newline at end of file diff --git a/src/NSwag.Generation/OpenApiDocumentGenerator.cs b/src/NSwag.Generation/OpenApiDocumentGenerator.cs index 8353b100ea..ae7f7f9fcb 100644 --- a/src/NSwag.Generation/OpenApiDocumentGenerator.cs +++ b/src/NSwag.Generation/OpenApiDocumentGenerator.cs @@ -25,10 +25,16 @@ public class OpenApiDocumentGenerator /// The schema resolver. public OpenApiDocumentGenerator(OpenApiDocumentGeneratorSettings settings, JsonSchemaResolver schemaResolver) { + SchemaGenerator = new OpenApiSchemaGenerator(settings); _schemaResolver = schemaResolver; _settings = settings; } + /// + /// Gets or sets the schema generator. + /// + public OpenApiSchemaGenerator SchemaGenerator { get; private set; } + /// Creates a path parameter for a given type. /// Name of the parameter. /// Type of the parameter. @@ -40,7 +46,7 @@ public OpenApiParameter CreateUntypedPathParameter(string parameterName, string parameter.Kind = OpenApiParameterKind.Path; parameter.IsRequired = true; - if (_settings.SchemaType == SchemaType.Swagger2) + if (_settings.SchemaSettings.SchemaType == SchemaType.Swagger2) { parameter.IsNullableRaw = false; } @@ -72,7 +78,7 @@ public OpenApiParameter CreateUntypedPathParameter(string parameterName, string /// The parameter. public OpenApiParameter CreatePrimitiveParameter(string name, ContextualParameterInfo contextualParameter) { - var documentation = contextualParameter.GetDescription(_settings); + var documentation = contextualParameter.GetDescription(_settings.SchemaSettings); return CreatePrimitiveParameter(name, documentation, contextualParameter); } @@ -84,10 +90,14 @@ public OpenApiParameter CreatePrimitiveParameter(string name, ContextualParamete /// The parameter. public OpenApiParameter CreatePrimitiveParameter(string name, string description, ContextualType contextualParameter, bool enforceNotNull = false) { - var typeDescription = _settings.ReflectionService.GetDescription(contextualParameter, _settings); + var typeDescription = _settings.SchemaSettings.ReflectionService.GetDescription( + contextualParameter, + _settings.SchemaSettings.DefaultReferenceTypeNullHandling, + _settings.SchemaSettings); + typeDescription.IsNullable = enforceNotNull == false && typeDescription.IsNullable; - var operationParameter = _settings.SchemaType == SchemaType.Swagger2 + var operationParameter = _settings.SchemaSettings.SchemaType == SchemaType.Swagger2 ? CreatePrimitiveSwaggerParameter(contextualParameter, typeDescription) : CreatePrimitiveOpenApiParameter(contextualParameter, typeDescription); @@ -106,21 +116,21 @@ public OpenApiParameter CreatePrimitiveParameter(string name, string description private OpenApiParameter CreatePrimitiveOpenApiParameter(ContextualType contextualParameter, JsonTypeDescription typeDescription) { OpenApiParameter operationParameter; - if (typeDescription.RequiresSchemaReference(_settings.TypeMappers)) + if (typeDescription.RequiresSchemaReference(_settings.SchemaSettings.TypeMappers)) { operationParameter = new OpenApiParameter(); operationParameter.Schema = new JsonSchema(); - _settings.SchemaGenerator.ApplyDataAnnotations(operationParameter.Schema, typeDescription); + SchemaGenerator.ApplyDataAnnotations(operationParameter.Schema, typeDescription); - var referencedSchema = _settings.SchemaGenerator.Generate(contextualParameter, _schemaResolver); + var referencedSchema = SchemaGenerator.Generate(contextualParameter, _schemaResolver); var hasSchemaAnnotations = JsonConvert.SerializeObject(operationParameter.Schema) != "{}"; if (hasSchemaAnnotations || typeDescription.IsNullable) { operationParameter.Schema.IsNullableRaw = true; - if (_settings.AllowReferencesWithProperties) + if (_settings.SchemaSettings.AllowReferencesWithProperties) { operationParameter.Schema.Reference = referencedSchema.ActualSchema; } @@ -137,10 +147,10 @@ private OpenApiParameter CreatePrimitiveOpenApiParameter(ContextualType contextu else { operationParameter = new OpenApiParameter(); - operationParameter.Schema = _settings.SchemaGenerator.GenerateWithReferenceAndNullability( + operationParameter.Schema = SchemaGenerator.GenerateWithReferenceAndNullability( contextualParameter, typeDescription.IsNullable, _schemaResolver); - _settings.SchemaGenerator.ApplyDataAnnotations(operationParameter.Schema, typeDescription); + SchemaGenerator.ApplyDataAnnotations(operationParameter.Schema, typeDescription); } if (typeDescription.Type.HasFlag(JsonObjectType.Array)) @@ -155,9 +165,9 @@ private OpenApiParameter CreatePrimitiveOpenApiParameter(ContextualType contextu private OpenApiParameter CreatePrimitiveSwaggerParameter(ContextualType contextualParameter, JsonTypeDescription typeDescription) { OpenApiParameter operationParameter; - if (typeDescription.RequiresSchemaReference(_settings.TypeMappers)) + if (typeDescription.RequiresSchemaReference(_settings.SchemaSettings.TypeMappers)) { - var referencedSchema = _settings.SchemaGenerator.Generate(contextualParameter, _schemaResolver); + var referencedSchema = SchemaGenerator.Generate(contextualParameter, _schemaResolver); operationParameter = new OpenApiParameter { @@ -176,12 +186,12 @@ private OpenApiParameter CreatePrimitiveSwaggerParameter(ContextualType contextu } } - _settings.SchemaGenerator.ApplyDataAnnotations(operationParameter, typeDescription); + SchemaGenerator.ApplyDataAnnotations(operationParameter, typeDescription); } else { - operationParameter = _settings.SchemaGenerator.Generate(contextualParameter, _schemaResolver); - _settings.SchemaGenerator.ApplyDataAnnotations(operationParameter, typeDescription); + operationParameter = SchemaGenerator.Generate(contextualParameter, _schemaResolver); + SchemaGenerator.ApplyDataAnnotations(operationParameter, typeDescription); } if (typeDescription.Type.HasFlag(JsonObjectType.Array)) diff --git a/src/NSwag.Generation/OpenApiDocumentGeneratorSettings.cs b/src/NSwag.Generation/OpenApiDocumentGeneratorSettings.cs index 6f4d1e9b11..70c9b70790 100644 --- a/src/NSwag.Generation/OpenApiDocumentGeneratorSettings.cs +++ b/src/NSwag.Generation/OpenApiDocumentGeneratorSettings.cs @@ -18,18 +18,19 @@ namespace NSwag.Generation { /// Settings for the Swagger generator. - public class OpenApiDocumentGeneratorSettings : JsonSchemaGeneratorSettings + public class OpenApiDocumentGeneratorSettings { /// Initializes a new instance of the class. public OpenApiDocumentGeneratorSettings() { - SchemaGenerator = new OpenApiSchemaGenerator(this); DefaultResponseReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull; - SchemaType = SchemaType.Swagger2; } - /// Gets or sets the JSON Schema generator. - public OpenApiSchemaGenerator SchemaGenerator { get; set; } + /// + public JsonSchemaGeneratorSettings SchemaSettings { get; set; } = new SystemTextJsonSchemaGeneratorSettings + { + SchemaType = SchemaType.OpenApi3 + }; /// Gets or sets the Swagger specification title. public string Title { get; set; } = "My Title"; @@ -46,7 +47,7 @@ public OpenApiDocumentGeneratorSettings() /// Gets or sets the default response reference type null handling when no nullability information is available (if NotNullAttribute and CanBeNullAttribute are missing, default: NotNull). public ReferenceTypeNullHandling DefaultResponseReferenceTypeNullHandling { get; set; } - /// Gets or sets a value indicating whether to generate x-originalName properties when parameter name is differnt in .NET and HTTP (default: true). + /// Gets or sets a value indicating whether to generate x-originalName properties when parameter name is different in .NET and HTTP (default: true). public bool GenerateOriginalParameterNames { get; set; } = true; /// Gets the operation processors. @@ -85,22 +86,13 @@ public void AddOperationFilter(Func filter) } /// Applies the given settings to this settings object. - /// The serializer settings. + /// The schema generator settings. /// The MVC options. - public void ApplySettings(JsonSerializerSettings serializerSettings, object mvcOptions) + public void ApplySettings(JsonSchemaGeneratorSettings schemaSettings, object mvcOptions) { - if (serializerSettings != null) + if (schemaSettings != null) { - var areSerializerSettingsSpecified = - DefaultPropertyNameHandling != PropertyNameHandling.Default || - DefaultEnumHandling != EnumHandling.Integer || - ContractResolver != null || - SerializerSettings != null; - - if (!areSerializerSettingsSpecified) - { - SerializerSettings = serializerSettings; - } + SchemaSettings = schemaSettings; } if (mvcOptions != null && mvcOptions.HasProperty("AllowEmptyInputInBodyModelBinding")) diff --git a/src/NSwag.Generation/OpenApiSchemaGenerator.cs b/src/NSwag.Generation/OpenApiSchemaGenerator.cs index a5f20b9415..5a0efbd9f1 100644 --- a/src/NSwag.Generation/OpenApiSchemaGenerator.cs +++ b/src/NSwag.Generation/OpenApiSchemaGenerator.cs @@ -21,7 +21,7 @@ public class OpenApiSchemaGenerator : JsonSchemaGenerator /// Initializes a new instance of the class. /// The settings. - public OpenApiSchemaGenerator(OpenApiDocumentGeneratorSettings settings) : base(settings) + public OpenApiSchemaGenerator(OpenApiDocumentGeneratorSettings settings) : base(settings.SchemaSettings) { } diff --git a/src/NSwag.Generation/Processors/Contexts/OperationProcessorContext.cs b/src/NSwag.Generation/Processors/Contexts/OperationProcessorContext.cs index fc9d964a61..5254d51eae 100644 --- a/src/NSwag.Generation/Processors/Contexts/OperationProcessorContext.cs +++ b/src/NSwag.Generation/Processors/Contexts/OperationProcessorContext.cs @@ -21,18 +21,16 @@ public class OperationProcessorContext /// The operation description. /// Type of the controller. /// The method information. - /// The swagger generator. + /// The OpenAPI generator. /// The schema resolver. /// The settings. /// All operation descriptions. - /// The schema generator. public OperationProcessorContext( OpenApiDocument document, OpenApiOperationDescription operationDescription, Type controllerType, MethodInfo methodInfo, - OpenApiDocumentGenerator openApiDocumentGenerator, - JsonSchemaGenerator schemaGenerator, + OpenApiDocumentGenerator documentGenerator, JsonSchemaResolver schemaResolver, OpenApiDocumentGeneratorSettings settings, IList allOperationDescriptions) @@ -43,8 +41,8 @@ public OperationProcessorContext( ControllerType = controllerType; MethodInfo = methodInfo; - DocumentGenerator = openApiDocumentGenerator; - SchemaGenerator = schemaGenerator; + DocumentGenerator = documentGenerator; + SchemaGenerator = documentGenerator?.SchemaGenerator; SchemaResolver = schemaResolver; Settings = settings; diff --git a/src/NSwag.Generation/Processors/OperationResponseProcessorBase.cs b/src/NSwag.Generation/Processors/OperationResponseProcessorBase.cs index eedab013f9..9e6ee3a29e 100644 --- a/src/NSwag.Generation/Processors/OperationResponseProcessorBase.cs +++ b/src/NSwag.Generation/Processors/OperationResponseProcessorBase.cs @@ -14,6 +14,7 @@ using System.Xml.Linq; using Namotion.Reflection; using NJsonSchema; +using NJsonSchema.Generation; using NJsonSchema.Infrastructure; using NSwag.Generation.Processors.Contexts; @@ -45,7 +46,7 @@ public void ProcessResponseTypeAttributes(OperationProcessorContext operationPro var successResponseDescription = returnParameter .ToContextualParameter() - .GetDescription(_settings) ?? string.Empty; + .GetDescription(_settings.SchemaSettings) ?? string.Empty; var responseDescriptions = GetOperationResponseDescriptions(responseTypeAttributes, successResponseDescription); ProcessOperationDescriptions(responseDescriptions, returnParameter, operationProcessorContext, successResponseDescription); @@ -63,7 +64,7 @@ protected void UpdateResponseDescription(OperationProcessorContext operationProc var returnParameter = operationProcessorContext.MethodInfo.ReturnParameter.ToContextualParameter(); - var returnParameterXmlDocs = returnParameter.GetDescription(_settings) ?? string.Empty; + var returnParameterXmlDocs = returnParameter.GetDescription(_settings.SchemaSettings) ?? string.Empty; var operationXmlDocsNodes = GetResponseXmlDocsNodes(operationProcessorContext.MethodInfo); if (!string.IsNullOrEmpty(returnParameterXmlDocs) || operationXmlDocsNodes?.Any() == true) @@ -106,7 +107,7 @@ protected XElement GetResponseXmlDocsElement(MethodInfo methodInfo, string respo private IEnumerable GetResponseXmlDocsNodes(MethodInfo methodInfo) { - var operationXmlDocs = methodInfo?.GetXmlDocsElement(_settings.GetXmlDocsOptions()); + var operationXmlDocs = methodInfo?.GetXmlDocsElement(_settings.SchemaSettings.GetXmlDocsOptions()); return operationXmlDocs?.Nodes()?.OfType(); } @@ -179,8 +180,8 @@ private void ProcessOperationDescriptions(IEnumerable r.Description)); - var typeDescription = _settings.ReflectionService.GetDescription( - contextualReturnType, _settings.DefaultResponseReferenceTypeNullHandling, _settings); + var typeDescription = _settings.SchemaSettings.ReflectionService.GetDescription( + contextualReturnType, _settings.DefaultResponseReferenceTypeNullHandling, _settings.SchemaSettings); var response = new OpenApiResponse { @@ -196,7 +197,7 @@ private void ProcessOperationDescriptions(IEnumerable r.IsNullable) && - _settings.ReflectionService.GetDescription(contextualReturnType, _settings.DefaultResponseReferenceTypeNullHandling, _settings).IsNullable; + _settings.SchemaSettings.ReflectionService.GetDescription(contextualReturnType, _settings.DefaultResponseReferenceTypeNullHandling, _settings.SchemaSettings).IsNullable; response.IsNullableRaw = isResponseNullable; response.Schema = context.SchemaGenerator.GenerateWithReferenceAndNullability( @@ -242,7 +243,7 @@ private ICollection GenerateExpectedSchemas( { var contextualResponseType = response.ResponseType.ToContextualType(); - var isNullable = _settings.ReflectionService.GetDescription(contextualResponseType, _settings).IsNullable; + var isNullable = _settings.SchemaSettings.ReflectionService.GetDescription(contextualResponseType, _settings.SchemaSettings).IsNullable; var schema = context.SchemaGenerator.GenerateWithReferenceAndNullability( contextualResponseType, isNullable, context.SchemaResolver); @@ -283,7 +284,7 @@ private void LoadDefaultSuccessResponse(ParameterInfo returnParameter, string su var returnParameterAttributes = returnParameter?.GetCustomAttributes(false)?.OfType() ?? Enumerable.Empty(); var contextualReturnParameter = returnType.ToContextualType(returnParameterAttributes); - var typeDescription = _settings.ReflectionService.GetDescription(contextualReturnParameter, _settings); + var typeDescription = _settings.SchemaSettings.ReflectionService.GetDescription(contextualReturnParameter, _settings.SchemaSettings); var responseSchema = context.SchemaGenerator.GenerateWithReferenceAndNullability( contextualReturnParameter, typeDescription.IsNullable, context.SchemaResolver); diff --git a/src/NSwag.Generation/Processors/OperationSummaryAndDescriptionProcessor.cs b/src/NSwag.Generation/Processors/OperationSummaryAndDescriptionProcessor.cs index 997c6c30da..7b69b38ca5 100644 --- a/src/NSwag.Generation/Processors/OperationSummaryAndDescriptionProcessor.cs +++ b/src/NSwag.Generation/Processors/OperationSummaryAndDescriptionProcessor.cs @@ -11,6 +11,7 @@ using System.Linq; using System.Reflection; using Namotion.Reflection; +using NJsonSchema.Generation; using NSwag.Generation.Processors.Contexts; namespace NSwag.Generation.Processors @@ -48,7 +49,7 @@ private void ProcessSummary(OperationProcessorContext context, Attribute[] attri if (string.IsNullOrEmpty(summary)) { - summary = context.MethodInfo?.GetXmlDocsSummary(context.Settings.GetXmlDocsOptions()); + summary = context.MethodInfo?.GetXmlDocsSummary(context.Settings.SchemaSettings.GetXmlDocsOptions()); } if (!string.IsNullOrEmpty(summary)) @@ -66,7 +67,7 @@ private void ProcessDescription(OperationProcessorContext context, Attribute[] a if (string.IsNullOrEmpty(description)) { - description = context.MethodInfo?.GetXmlDocsRemarks(context.Settings.GetXmlDocsOptions()); + description = context.MethodInfo?.GetXmlDocsRemarks(context.Settings.SchemaSettings.GetXmlDocsOptions()); } if (!string.IsNullOrEmpty(description)) diff --git a/src/NSwag.Generation/Processors/OperationTagsProcessor.cs b/src/NSwag.Generation/Processors/OperationTagsProcessor.cs index 0a5b8eb4e5..b652f8a3ad 100644 --- a/src/NSwag.Generation/Processors/OperationTagsProcessor.cs +++ b/src/NSwag.Generation/Processors/OperationTagsProcessor.cs @@ -10,6 +10,7 @@ using System.Linq; using System.Reflection; using Namotion.Reflection; +using NJsonSchema.Generation; using NSwag.Generation.Collections; using NSwag.Generation.Processors.Contexts; @@ -58,7 +59,7 @@ protected virtual void AddControllerNameTag(OperationProcessorContext context) controllerName = controllerName.Substring(0, controllerName.Length - 10); } - var summary = context.ControllerType.GetXmlDocsSummary(context.Settings.GetXmlDocsOptions()); + var summary = context.ControllerType.GetXmlDocsSummary(context.Settings.SchemaSettings.GetXmlDocsOptions()); context.OperationDescription.Operation.Tags.Add(controllerName); UpdateDocumentTagDescription(context, controllerName, summary); } diff --git a/src/NSwag.Generation/XmlDocsSettingsExtensions.cs b/src/NSwag.Generation/XmlDocsSettingsExtensions.cs deleted file mode 100644 index e018e6d8ee..0000000000 --- a/src/NSwag.Generation/XmlDocsSettingsExtensions.cs +++ /dev/null @@ -1,35 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Rico Suter. All rights reserved. -// -// https://github.com/RicoSuter/NJsonSchema/blob/master/LICENSE.md -// Rico Suter, mail@rsuter.com -//----------------------------------------------------------------------- - -using Namotion.Reflection; -using NJsonSchema.Generation; - -namespace NSwag.Generation -{ - /// - /// XML Documentation settings extensions. - /// - public static class XmlDocsSettingsExtensions - { - // TODO: Remove this class and use NJS exentions instead. - - /// - /// Converts a settings to options. - /// - /// The settings. - /// The options. - public static XmlDocsOptions GetXmlDocsOptions(this IXmlDocsSettings settings) - { - return new XmlDocsOptions - { - ResolveExternalXmlDocs = settings.ResolveExternalXmlDocumentation, - FormattingMode = settings.XmlDocumentationFormatting - }; - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.ClientPCL.Tests/GeoControllerTests.cs b/src/NSwag.Integration.ClientPCL.Tests/GeoControllerTests.cs deleted file mode 100644 index e0ef4814cb..0000000000 --- a/src/NSwag.Integration.ClientPCL.Tests/GeoControllerTests.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System; -using System.Globalization; -using System.IO; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using NSwag.Integration.ClientPCL.Contracts; -using System.Linq; - -namespace NSwag.Integration.ClientPCL.Tests -{ - [TestClass] - public class GeoControllerTests - { - [TestMethod] - [TestCategory("integration")] - public async Task SaveItems() - { - // Arrange - var geoClient = new GeoClient(new HttpClient()) { BaseUrl = "http://localhost:13452" }; - - // Act - try - { - await geoClient.SaveItemsAsync(null); - - // Assert - Assert.Fail(); - } - catch (GeoClientException exception) - { - Assert.IsTrue(exception.InnerException is ArgumentException); - Assert.IsTrue(exception.InnerException.StackTrace.Contains("NSwag.Integration.WebAPI.Controllers.GeoController.SaveItems")); - } - } - - //[TestMethod] - [TestCategory("integration")] - public async Task UploadFile() - { - // Arrange - var geoClient = new GeoClient(new HttpClient()) { BaseUrl = "http://localhost:13452" }; - - // Act - var result = await geoClient.UploadFileAsync(new FileParameter(new MemoryStream(new byte[] { 1, 2 }))); - - // Assert - Assert.IsTrue(result.Result); - } - - [TestMethod] - [TestCategory("integration")] - public async Task QueryStringParameters() - { - // Arrange - var geoClient = new GeoClient(new HttpClient()) { BaseUrl = "http://localhost:13452" }; - - // Act - var result = await geoClient.ReverseAsync(new string[] { "foo", "bar" }); - - // Assert - Assert.AreEqual(2, result.Result.Count); - Assert.AreEqual("foo", result.Result.ToList()[1]); - Assert.AreEqual("bar", result.Result.ToList()[0]); - } - - [TestMethod] - [TestCategory("integration")] - public async Task FileDownload() - { - // Arrange - var geoClient = new GeoClient(new HttpClient()) { BaseUrl = "http://localhost:13452" }; - - // Act - using (var response = await geoClient.GetUploadedFileAsync(1, true)) - { - // Assert - Assert.AreEqual(1, response.Stream.ReadByte()); - Assert.AreEqual(2, response.Stream.ReadByte()); - Assert.AreEqual(3, response.Stream.ReadByte()); - } - } - - [TestMethod] - [TestCategory("integration")] - public async Task PostDouble() - { - // Arrange - - // The nl-NL culture is one of the cultures that uses a comma as the decimal separator. - Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("nl-NL"); - var geoClient = new GeoClient(new HttpClient()) { BaseUrl = "http://localhost:13452" }; - const double value = 0.5d; - - // Act - try - { - // This tests whether the value is encoded in the client using the invariant culture. If not, API method will receive the value as null (since it is optional). - var result = await geoClient.PostDoubleAsync(value); - - // Assert - Assert.AreEqual(value, result.Result); - } - catch (GeoClientException exception) - { - Assert.IsTrue(exception.InnerException is ArgumentException); - Assert.IsTrue(exception.InnerException.StackTrace.Contains("NSwag.Integration.WebAPI.Controllers.GeoController.SaveItems")); - } - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.ClientPCL.Tests/InheritanceTests.cs b/src/NSwag.Integration.ClientPCL.Tests/InheritanceTests.cs deleted file mode 100644 index cfe33677c6..0000000000 --- a/src/NSwag.Integration.ClientPCL.Tests/InheritanceTests.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Net.Http; -using System.Threading.Tasks; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using NSwag.Integration.ClientPCL.Contracts; - -namespace NSwag.Integration.ClientPCL.Tests -{ - [TestClass] - public class InheritanceTests - { - [TestMethod] - [TestCategory("integration")] - public async Task When_Get_is_called_then_Teacher_is_returned() - { - // Arrange - var personsClient = new PersonsClient(new HttpClient()) { BaseUrl = "http://localhost:13452" }; - - // Act - var result = await personsClient.GetAsync(new Guid()); - - // Assert - Assert.IsTrue(result.Result.GetType() == typeof(Teacher)); - } - - [TestMethod] - [TestCategory("integration")] - public async Task When_Teacher_is_sent_to_Transform_it_is_transformed_and_correctly_sent_back() - { - // Arrange - var personsClient = new PersonsClient(new HttpClient()) { BaseUrl = "http://localhost:13452" }; - - // Act - var result = await personsClient.TransformAsync(new Teacher - { - FirstName = "foo", - LastName = "bar", - Course = "SE" - }); - - // Assert - Assert.IsTrue(result.Result.GetType() == typeof(Teacher)); - var teacher = (Teacher)result.Result; - Assert.AreEqual("FOO", teacher.FirstName); - Assert.AreEqual("SE", teacher.Course); - } - } -} diff --git a/src/NSwag.Integration.ClientPCL.Tests/NSwag.Integration.ClientPCL.Tests.csproj b/src/NSwag.Integration.ClientPCL.Tests/NSwag.Integration.ClientPCL.Tests.csproj deleted file mode 100644 index 18b5f4058c..0000000000 --- a/src/NSwag.Integration.ClientPCL.Tests/NSwag.Integration.ClientPCL.Tests.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net462 - NSwag.Integration.ClientPCL.Tests - NSwag.Integration.ClientPCL.Tests - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Integration.ClientPCL.Tests/PersonsControllerTests.cs b/src/NSwag.Integration.ClientPCL.Tests/PersonsControllerTests.cs deleted file mode 100644 index cf6c4d41fe..0000000000 --- a/src/NSwag.Integration.ClientPCL.Tests/PersonsControllerTests.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.IO; -using System.Net.Http; -using System.Threading.Tasks; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using NSwag.Integration.ClientPCL.Contracts; -using System.Linq; - -namespace NSwag.Integration.ClientPCL.Tests -{ - [TestClass] - public class PersonsControllerTests - { - [TestMethod] - [TestCategory("integration")] - public async Task GetAll_SerializationTest() - { - // Arrange - var personsClient = new PersonsClient(new HttpClient()) { BaseUrl = "http://localhost:13452" }; ; - - // Act - var persons = await personsClient.GetAllAsync(); - - // Assert - Assert.AreEqual(2, persons.Result.Count); - Assert.IsTrue(persons.Result.ToList()[0].GetType() == typeof(Person)); - Assert.IsTrue(persons.Result.ToList()[1].GetType() == typeof(Teacher)); - } - - [TestMethod] - [TestCategory("integration")] - public async Task AddXml_PostXml() - { - // Arrange - var personsClient = new PersonsClient(new HttpClient()) { BaseUrl = "http://localhost:13452" }; ; - - // Act - var result = await personsClient.AddXmlAsync("Suter"); - - // Assert - } - - [TestMethod] - [TestCategory("integration")] - public async Task GetAll_InheritanceTest() - { - // Arrange - var personsClient = new PersonsClient(new HttpClient()) { BaseUrl = "http://localhost:13452" }; - - // Act - var persons = await personsClient.GetAllAsync(); - - // Assert - Assert.AreEqual("SE", ((Teacher)persons.Result.ToList()[1]).Course); // inheritance test - } - - [TestMethod] - [TestCategory("integration")] - public async Task Throw() - { - // Arrange - var id = Guid.NewGuid(); - var personsClient = new PersonsClient(new HttpClient()) { BaseUrl = "http://localhost:13452" }; - - // Act - try - { - var persons = await personsClient.ThrowAsync(id); - } - catch (PersonsClientException exception) - { - // Assert - Assert.AreEqual(id, exception.Result.Id); - } - } - - [TestMethod] - [TestCategory("integration")] - public async Task Get_should_return_teacher() - { - // Arrange - var personsClient = new PersonsClient(new HttpClient()) { BaseUrl = "http://localhost:13452" }; ; - - // Act - var result = await personsClient.GetAsync(new Guid()); - - // Assert - Assert.IsTrue(result.Result is Teacher); - } - - //[TestMethod] - //[TestCategory("integration")] - public async Task Binary_body() - { - // Arrange - var personsClient = new PersonsClient(new HttpClient()) { BaseUrl = "http://localhost:13452" }; ; - - // Act - var stream = new MemoryStream(new byte[] { 1, 2, 3 }); - var result = await personsClient.UploadAsync(new FileParameter(stream)); - - // Assert - Assert.AreEqual(3, result.Result.Length); - Assert.AreEqual(1, result.Result[0]); - Assert.AreEqual(2, result.Result[1]); - Assert.AreEqual(3, result.Result[2]); - } - } -} diff --git a/src/NSwag.Integration.ClientPCL/ClientBase.cs b/src/NSwag.Integration.ClientPCL/ClientBase.cs deleted file mode 100644 index 63abe95d99..0000000000 --- a/src/NSwag.Integration.ClientPCL/ClientBase.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using Newtonsoft.Json; - -namespace NSwag.Integration.ClientPCL -{ - public class ClientBase - { - protected Task CreateHttpClientAsync(CancellationToken cancellationToken) - { - return Task.FromResult(new HttpClient()); - } - - protected Task CreateHttpRequestMessageAsync(CancellationToken cancellationToken) - { - return Task.FromResult(new HttpRequestMessage()); - } - - protected void UpdateJsonSerializerSettings(JsonSerializerSettings settings) - { - - } - } -} diff --git a/src/NSwag.Integration.ClientPCL/NSwag.Integration.ClientPCL.csproj b/src/NSwag.Integration.ClientPCL/NSwag.Integration.ClientPCL.csproj deleted file mode 100644 index 518362cb56..0000000000 --- a/src/NSwag.Integration.ClientPCL/NSwag.Integration.ClientPCL.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - netstandard1.4 - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Integration.ClientPCL/PetStoreClient.cs b/src/NSwag.Integration.ClientPCL/PetStoreClient.cs deleted file mode 100644 index a3ff81404a..0000000000 --- a/src/NSwag.Integration.ClientPCL/PetStoreClient.cs +++ /dev/null @@ -1,2935 +0,0 @@ -//---------------------- -// -// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- - -#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." -#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." -#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' -#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... -#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." -#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" -#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" - -namespace PetStore -{ - using System = global::System; - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial interface IPetStoreClient - { - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task UploadFileAsync(long petId, string additionalMetadata, FileParameter file); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task UploadFileAsync(long petId, string additionalMetadata, FileParameter file, System.Threading.CancellationToken cancellationToken); - - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - /// A server side error occurred. - System.Threading.Tasks.Task UpdatePetAsync(Pet body); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - /// A server side error occurred. - System.Threading.Tasks.Task UpdatePetAsync(Pet body, System.Threading.CancellationToken cancellationToken); - - /// - /// Finds Pets by status - /// - /// Status values that need to be considered for filter - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task> FindPetsByStatusAsync(System.Collections.Generic.IEnumerable status); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Finds Pets by status - /// - /// Status values that need to be considered for filter - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task> FindPetsByStatusAsync(System.Collections.Generic.IEnumerable status, System.Threading.CancellationToken cancellationToken); - - /// - /// Finds Pets by tags - /// - /// Tags to filter by - /// successful operation - /// A server side error occurred. - [System.Obsolete] - System.Threading.Tasks.Task> FindPetsByTagsAsync(System.Collections.Generic.IEnumerable tags); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Finds Pets by tags - /// - /// Tags to filter by - /// successful operation - /// A server side error occurred. - [System.Obsolete] - System.Threading.Tasks.Task> FindPetsByTagsAsync(System.Collections.Generic.IEnumerable tags, System.Threading.CancellationToken cancellationToken); - - /// - /// Find pet by ID - /// - /// ID of pet to return - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task GetPetByIdAsync(long petId); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Find pet by ID - /// - /// ID of pet to return - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task GetPetByIdAsync(long petId, System.Threading.CancellationToken cancellationToken); - - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// A server side error occurred. - System.Threading.Tasks.Task UpdatePetWithFormAsync(long petId, string name, string status); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// A server side error occurred. - System.Threading.Tasks.Task UpdatePetWithFormAsync(long petId, string name, string status, System.Threading.CancellationToken cancellationToken); - - /// - /// Deletes a pet - /// - /// Pet id to delete - /// A server side error occurred. - System.Threading.Tasks.Task DeletePetAsync(string api_key, long petId); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes a pet - /// - /// Pet id to delete - /// A server side error occurred. - System.Threading.Tasks.Task DeletePetAsync(string api_key, long petId, System.Threading.CancellationToken cancellationToken); - - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task PlaceOrderAsync(Order body); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task PlaceOrderAsync(Order body, System.Threading.CancellationToken cancellationToken); - - /// - /// Find purchase order by ID - /// - /// ID of pet that needs to be fetched - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task GetOrderByIdAsync(long orderId); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Find purchase order by ID - /// - /// ID of pet that needs to be fetched - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken cancellationToken); - - /// - /// Delete purchase order by ID - /// - /// ID of the order that needs to be deleted - /// A server side error occurred. - System.Threading.Tasks.Task DeleteOrderAsync(long orderId); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete purchase order by ID - /// - /// ID of the order that needs to be deleted - /// A server side error occurred. - System.Threading.Tasks.Task DeleteOrderAsync(long orderId, System.Threading.CancellationToken cancellationToken); - - /// - /// Returns pet inventories by status - /// - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task> GetInventoryAsync(); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Returns pet inventories by status - /// - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task> GetInventoryAsync(System.Threading.CancellationToken cancellationToken); - - /// - /// Creates list of users with given input array - /// - /// List of user object - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task CreateUsersWithArrayInputAsync(System.Collections.Generic.IEnumerable body); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates list of users with given input array - /// - /// List of user object - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task CreateUsersWithArrayInputAsync(System.Collections.Generic.IEnumerable body, System.Threading.CancellationToken cancellationToken); - - /// - /// Creates list of users with given input array - /// - /// List of user object - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task CreateUsersWithListInputAsync(System.Collections.Generic.IEnumerable body); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates list of users with given input array - /// - /// List of user object - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task CreateUsersWithListInputAsync(System.Collections.Generic.IEnumerable body, System.Threading.CancellationToken cancellationToken); - - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task GetUserByNameAsync(string username); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task GetUserByNameAsync(string username, System.Threading.CancellationToken cancellationToken); - - /// - /// Updated user - /// - /// name that need to be updated - /// Updated user object - /// A server side error occurred. - System.Threading.Tasks.Task UpdateUserAsync(string username, User body); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updated user - /// - /// name that need to be updated - /// Updated user object - /// A server side error occurred. - System.Threading.Tasks.Task UpdateUserAsync(string username, User body, System.Threading.CancellationToken cancellationToken); - - /// - /// Delete user - /// - /// The name that needs to be deleted - /// A server side error occurred. - System.Threading.Tasks.Task DeleteUserAsync(string username); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete user - /// - /// The name that needs to be deleted - /// A server side error occurred. - System.Threading.Tasks.Task DeleteUserAsync(string username, System.Threading.CancellationToken cancellationToken); - - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task LoginUserAsync(string username, string password); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task LoginUserAsync(string username, string password, System.Threading.CancellationToken cancellationToken); - - /// - /// Logs out current logged in user session - /// - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task LogoutUserAsync(); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Logs out current logged in user session - /// - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task LogoutUserAsync(System.Threading.CancellationToken cancellationToken); - - /// - /// Create user - /// - /// Created user object - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task CreateUserAsync(User body); - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Create user - /// - /// Created user object - /// successful operation - /// A server side error occurred. - System.Threading.Tasks.Task CreateUserAsync(User body, System.Threading.CancellationToken cancellationToken); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class PetStoreClient : IPetStoreClient - { - private string _baseUrl = "https://petstore.swagger.io/v2"; - private System.Lazy _settings; - - public PetStoreClient() - { - _settings = new System.Lazy(CreateSerializerSettings); - } - - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() - { - var settings = new Newtonsoft.Json.JsonSerializerSettings(); - UpdateJsonSerializerSettings(settings); - return settings; - } - - public string BaseUrl - { - get { return _baseUrl; } - set { _baseUrl = value; } - } - - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); - - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// successful operation - /// A server side error occurred. - public virtual System.Threading.Tasks.Task UploadFileAsync(long petId, string additionalMetadata, FileParameter file) - { - return UploadFileAsync(petId, additionalMetadata, file, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// successful operation - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UploadFileAsync(long petId, string additionalMetadata, FileParameter file, System.Threading.CancellationToken cancellationToken) - { - if (petId == null) - throw new System.ArgumentNullException("petId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/pet/{petId}/uploadImage"); - urlBuilder_.Replace("{petId}", System.Uri.EscapeDataString(ConvertToString(petId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var boundary_ = System.Guid.NewGuid().ToString(); - var content_ = new System.Net.Http.MultipartFormDataContent(boundary_); - content_.Headers.Remove("Content-Type"); - content_.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary_); - - if (additionalMetadata != null) - { - content_.Add(new System.Net.Http.StringContent(ConvertToString(additionalMetadata, System.Globalization.CultureInfo.InvariantCulture)), "additionalMetadata"); - } - - if (file != null) - { - var content_file_ = new System.Net.Http.StreamContent(file.Data); - if (!string.IsNullOrEmpty(file.ContentType)) - content_file_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(file.ContentType); - content_.Add(content_file_, "file", file.FileName ?? "file"); - } - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Add a new pet to the store - /// - /// Pet object that needs to be added to the store - /// A server side error occurred. - protected virtual System.Threading.Tasks.Task AddPetCoreAsync(Pet body) - { - return AddPetCoreAsync(body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Add a new pet to the store - /// - /// Pet object that needs to be added to the store - /// A server side error occurred. - protected virtual async System.Threading.Tasks.Task AddPetCoreAsync(Pet body, System.Threading.CancellationToken cancellationToken) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/pet"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 405) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Invalid input", status_, responseText_, headers_, null); - } - else - - if (status_ == 200 || status_ == 204) - { - - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - /// A server side error occurred. - public virtual System.Threading.Tasks.Task UpdatePetAsync(Pet body) - { - return UpdatePetAsync(body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdatePetAsync(Pet body, System.Threading.CancellationToken cancellationToken) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/pet"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 400) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Invalid ID supplied", status_, responseText_, headers_, null); - } - else - if (status_ == 404) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Pet not found", status_, responseText_, headers_, null); - } - else - if (status_ == 405) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Validation exception", status_, responseText_, headers_, null); - } - else - - if (status_ == 200 || status_ == 204) - { - - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Finds Pets by status - /// - /// Status values that need to be considered for filter - /// successful operation - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> FindPetsByStatusAsync(System.Collections.Generic.IEnumerable status) - { - return FindPetsByStatusAsync(status, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Finds Pets by status - /// - /// Status values that need to be considered for filter - /// successful operation - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> FindPetsByStatusAsync(System.Collections.Generic.IEnumerable status, System.Threading.CancellationToken cancellationToken) - { - if (status == null) - throw new System.ArgumentNullException("status"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/pet/findByStatus?"); - foreach (var item_ in status) { urlBuilder_.Append(System.Uri.EscapeDataString("status") + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 400) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Invalid status value", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Finds Pets by tags - /// - /// Tags to filter by - /// successful operation - /// A server side error occurred. - [System.Obsolete] - public virtual System.Threading.Tasks.Task> FindPetsByTagsAsync(System.Collections.Generic.IEnumerable tags) - { - return FindPetsByTagsAsync(tags, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Finds Pets by tags - /// - /// Tags to filter by - /// successful operation - /// A server side error occurred. - [System.Obsolete] - public virtual async System.Threading.Tasks.Task> FindPetsByTagsAsync(System.Collections.Generic.IEnumerable tags, System.Threading.CancellationToken cancellationToken) - { - if (tags == null) - throw new System.ArgumentNullException("tags"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/pet/findByTags?"); - foreach (var item_ in tags) { urlBuilder_.Append(System.Uri.EscapeDataString("tags") + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 400) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Invalid tag value", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Find pet by ID - /// - /// ID of pet to return - /// successful operation - /// A server side error occurred. - public virtual System.Threading.Tasks.Task GetPetByIdAsync(long petId) - { - return GetPetByIdAsync(petId, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Find pet by ID - /// - /// ID of pet to return - /// successful operation - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetPetByIdAsync(long petId, System.Threading.CancellationToken cancellationToken) - { - if (petId == null) - throw new System.ArgumentNullException("petId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/pet/{petId}"); - urlBuilder_.Replace("{petId}", System.Uri.EscapeDataString(ConvertToString(petId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 400) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Invalid ID supplied", status_, responseText_, headers_, null); - } - else - if (status_ == 404) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Pet not found", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// A server side error occurred. - public virtual System.Threading.Tasks.Task UpdatePetWithFormAsync(long petId, string name, string status) - { - return UpdatePetWithFormAsync(petId, name, status, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdatePetWithFormAsync(long petId, string name, string status, System.Threading.CancellationToken cancellationToken) - { - if (petId == null) - throw new System.ArgumentNullException("petId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/pet/{petId}"); - urlBuilder_.Replace("{petId}", System.Uri.EscapeDataString(ConvertToString(petId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var keyValues_ = new System.Collections.Generic.List>(); - if (name != null) - keyValues_.Add(new System.Collections.Generic.KeyValuePair("name", ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))); - if (status != null) - keyValues_.Add(new System.Collections.Generic.KeyValuePair("status", ConvertToString(status, System.Globalization.CultureInfo.InvariantCulture))); - request_.Content = new System.Net.Http.FormUrlEncodedContent(keyValues_); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 405) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Invalid input", status_, responseText_, headers_, null); - } - else - - if (status_ == 200 || status_ == 204) - { - - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Deletes a pet - /// - /// Pet id to delete - /// A server side error occurred. - public virtual System.Threading.Tasks.Task DeletePetAsync(string api_key, long petId) - { - return DeletePetAsync(api_key, petId, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Deletes a pet - /// - /// Pet id to delete - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeletePetAsync(string api_key, long petId, System.Threading.CancellationToken cancellationToken) - { - if (petId == null) - throw new System.ArgumentNullException("petId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/pet/{petId}"); - urlBuilder_.Replace("{petId}", System.Uri.EscapeDataString(ConvertToString(petId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - - if (api_key != null) - request_.Headers.TryAddWithoutValidation("api_key", ConvertToString(api_key, System.Globalization.CultureInfo.InvariantCulture)); - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 400) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Invalid ID supplied", status_, responseText_, headers_, null); - } - else - if (status_ == 404) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Pet not found", status_, responseText_, headers_, null); - } - else - - if (status_ == 200 || status_ == 204) - { - - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// successful operation - /// A server side error occurred. - public virtual System.Threading.Tasks.Task PlaceOrderAsync(Order body) - { - return PlaceOrderAsync(body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// successful operation - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task PlaceOrderAsync(Order body, System.Threading.CancellationToken cancellationToken) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/store/order"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 400) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Invalid Order", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Find purchase order by ID - /// - /// ID of pet that needs to be fetched - /// successful operation - /// A server side error occurred. - public virtual System.Threading.Tasks.Task GetOrderByIdAsync(long orderId) - { - return GetOrderByIdAsync(orderId, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Find purchase order by ID - /// - /// ID of pet that needs to be fetched - /// successful operation - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetOrderByIdAsync(long orderId, System.Threading.CancellationToken cancellationToken) - { - if (orderId == null) - throw new System.ArgumentNullException("orderId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/store/order/{orderId}"); - urlBuilder_.Replace("{orderId}", System.Uri.EscapeDataString(ConvertToString(orderId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 400) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Invalid ID supplied", status_, responseText_, headers_, null); - } - else - if (status_ == 404) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Order not found", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Delete purchase order by ID - /// - /// ID of the order that needs to be deleted - /// A server side error occurred. - public virtual System.Threading.Tasks.Task DeleteOrderAsync(long orderId) - { - return DeleteOrderAsync(orderId, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete purchase order by ID - /// - /// ID of the order that needs to be deleted - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteOrderAsync(long orderId, System.Threading.CancellationToken cancellationToken) - { - if (orderId == null) - throw new System.ArgumentNullException("orderId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/store/order/{orderId}"); - urlBuilder_.Replace("{orderId}", System.Uri.EscapeDataString(ConvertToString(orderId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 400) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Invalid ID supplied", status_, responseText_, headers_, null); - } - else - if (status_ == 404) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Order not found", status_, responseText_, headers_, null); - } - else - - if (status_ == 200 || status_ == 204) - { - - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Returns pet inventories by status - /// - /// successful operation - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> GetInventoryAsync() - { - return GetInventoryAsync(System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Returns pet inventories by status - /// - /// successful operation - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetInventoryAsync(System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/store/inventory"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - /// successful operation - /// A server side error occurred. - public virtual System.Threading.Tasks.Task CreateUsersWithArrayInputAsync(System.Collections.Generic.IEnumerable body) - { - return CreateUsersWithArrayInputAsync(body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates list of users with given input array - /// - /// List of user object - /// successful operation - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync(System.Collections.Generic.IEnumerable body, System.Threading.CancellationToken cancellationToken) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/user/createWithArray"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - /// successful operation - /// A server side error occurred. - public virtual System.Threading.Tasks.Task CreateUsersWithListInputAsync(System.Collections.Generic.IEnumerable body) - { - return CreateUsersWithListInputAsync(body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Creates list of users with given input array - /// - /// List of user object - /// successful operation - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CreateUsersWithListInputAsync(System.Collections.Generic.IEnumerable body, System.Threading.CancellationToken cancellationToken) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/user/createWithList"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// successful operation - /// A server side error occurred. - public virtual System.Threading.Tasks.Task GetUserByNameAsync(string username) - { - return GetUserByNameAsync(username, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// successful operation - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetUserByNameAsync(string username, System.Threading.CancellationToken cancellationToken) - { - if (username == null) - throw new System.ArgumentNullException("username"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/user/{username}"); - urlBuilder_.Replace("{username}", System.Uri.EscapeDataString(ConvertToString(username, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 400) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Invalid username supplied", status_, responseText_, headers_, null); - } - else - if (status_ == 404) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("User not found", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Updated user - /// - /// name that need to be updated - /// Updated user object - /// A server side error occurred. - public virtual System.Threading.Tasks.Task UpdateUserAsync(string username, User body) - { - return UpdateUserAsync(username, body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Updated user - /// - /// name that need to be updated - /// Updated user object - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UpdateUserAsync(string username, User body, System.Threading.CancellationToken cancellationToken) - { - if (username == null) - throw new System.ArgumentNullException("username"); - - if (body == null) - throw new System.ArgumentNullException("body"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/user/{username}"); - urlBuilder_.Replace("{username}", System.Uri.EscapeDataString(ConvertToString(username, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 400) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Invalid user supplied", status_, responseText_, headers_, null); - } - else - if (status_ == 404) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("User not found", status_, responseText_, headers_, null); - } - else - - if (status_ == 200 || status_ == 204) - { - - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Delete user - /// - /// The name that needs to be deleted - /// A server side error occurred. - public virtual System.Threading.Tasks.Task DeleteUserAsync(string username) - { - return DeleteUserAsync(username, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Delete user - /// - /// The name that needs to be deleted - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteUserAsync(string username, System.Threading.CancellationToken cancellationToken) - { - if (username == null) - throw new System.ArgumentNullException("username"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/user/{username}"); - urlBuilder_.Replace("{username}", System.Uri.EscapeDataString(ConvertToString(username, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 400) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Invalid username supplied", status_, responseText_, headers_, null); - } - else - if (status_ == 404) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("User not found", status_, responseText_, headers_, null); - } - else - - if (status_ == 200 || status_ == 204) - { - - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// successful operation - /// A server side error occurred. - public virtual System.Threading.Tasks.Task LoginUserAsync(string username, string password) - { - return LoginUserAsync(username, password, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// successful operation - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task LoginUserAsync(string username, string password, System.Threading.CancellationToken cancellationToken) - { - if (username == null) - throw new System.ArgumentNullException("username"); - - if (password == null) - throw new System.ArgumentNullException("password"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/user/login?"); - urlBuilder_.Append(System.Uri.EscapeDataString("username") + "=").Append(System.Uri.EscapeDataString(ConvertToString(username, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append(System.Uri.EscapeDataString("password") + "=").Append(System.Uri.EscapeDataString(ConvertToString(password, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 400) - { - string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Invalid username/password supplied", status_, responseText_, headers_, null); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Logs out current logged in user session - /// - /// successful operation - /// A server side error occurred. - public virtual System.Threading.Tasks.Task LogoutUserAsync() - { - return LogoutUserAsync(System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Logs out current logged in user session - /// - /// successful operation - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task LogoutUserAsync(System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/user/logout"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Create user - /// - /// Created user object - /// successful operation - /// A server side error occurred. - public virtual System.Threading.Tasks.Task CreateUserAsync(User body) - { - return CreateUserAsync(body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Create user - /// - /// Created user object - /// successful operation - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task CreateUserAsync(User body, System.Threading.CancellationToken cancellationToken) - { - if (body == null) - throw new System.ArgumentNullException("body"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/user"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new SwaggerException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - using (var streamReader = new System.IO.StreamReader(responseStream)) - using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) - { - var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings); - var typedBody = serializer.Deserialize(jsonTextReader); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new SwaggerException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value.GetType().IsArray) - { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class ApiResponse : System.ComponentModel.INotifyPropertyChanged - { - private int? _code; - private string _type; - private string _message; - - [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? Code - { - get { return _code; } - - set - { - if (_code != value) - { - _code = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Type - { - get { return _type; } - - set - { - if (_type != value) - { - _type = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Message - { - get { return _message; } - - set - { - if (_message != value) - { - _message = value; - RaisePropertyChanged(); - } - } - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Category : System.ComponentModel.INotifyPropertyChanged - { - private long? _id; - private string _name; - - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public long? Id - { - get { return _id; } - - set - { - if (_id != value) - { - _id = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name - { - get { return _name; } - - set - { - if (_name != value) - { - _name = value; - RaisePropertyChanged(); - } - } - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Pet : System.ComponentModel.INotifyPropertyChanged - { - private long? _id; - private Category _category; - private string _name; - private System.Collections.ObjectModel.ObservableCollection _photoUrls = new System.Collections.ObjectModel.ObservableCollection(); - private System.Collections.ObjectModel.ObservableCollection _tags; - private PetStatus? _status; - - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public long? Id - { - get { return _id; } - - set - { - if (_id != value) - { - _id = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("category", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Category Category - { - get { return _category; } - - set - { - if (_category != value) - { - _category = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Name - { - get { return _name; } - - set - { - if (_name != value) - { - _name = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("photoUrls", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public System.Collections.ObjectModel.ObservableCollection PhotoUrls - { - get { return _photoUrls; } - - set - { - if (_photoUrls != value) - { - _photoUrls = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("tags", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.ObjectModel.ObservableCollection Tags - { - get { return _tags; } - - set - { - if (_tags != value) - { - _tags = value; - RaisePropertyChanged(); - } - } - } - - /// - /// pet status in the store - /// - [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public PetStatus? Status - { - get { return _status; } - - set - { - if (_status != value) - { - _status = value; - RaisePropertyChanged(); - } - } - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Tag : System.ComponentModel.INotifyPropertyChanged - { - private long? _id; - private string _name; - - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public long? Id - { - get { return _id; } - - set - { - if (_id != value) - { - _id = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name - { - get { return _name; } - - set - { - if (_name != value) - { - _name = value; - RaisePropertyChanged(); - } - } - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Order : System.ComponentModel.INotifyPropertyChanged - { - private long? _id; - private long? _petId; - private int? _quantity; - private System.DateTime? _shipDate; - private OrderStatus? _status; - private bool? _complete; - - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public long? Id - { - get { return _id; } - - set - { - if (_id != value) - { - _id = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("petId", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public long? PetId - { - get { return _petId; } - - set - { - if (_petId != value) - { - _petId = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("quantity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? Quantity - { - get { return _quantity; } - - set - { - if (_quantity != value) - { - _quantity = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("shipDate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.DateTime? ShipDate - { - get { return _shipDate; } - - set - { - if (_shipDate != value) - { - _shipDate = value; - RaisePropertyChanged(); - } - } - } - - /// - /// Order Status - /// - [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public OrderStatus? Status - { - get { return _status; } - - set - { - if (_status != value) - { - _status = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("complete", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool? Complete - { - get { return _complete; } - - set - { - if (_complete != value) - { - _complete = value; - RaisePropertyChanged(); - } - } - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class User : System.ComponentModel.INotifyPropertyChanged - { - private long? _id; - private string _username; - private string _firstName; - private string _lastName; - private string _email; - private string _password; - private string _phone; - private int? _userStatus; - - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public long? Id - { - get { return _id; } - - set - { - if (_id != value) - { - _id = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("username", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Username - { - get { return _username; } - - set - { - if (_username != value) - { - _username = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("firstName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string FirstName - { - get { return _firstName; } - - set - { - if (_firstName != value) - { - _firstName = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("lastName", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string LastName - { - get { return _lastName; } - - set - { - if (_lastName != value) - { - _lastName = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("email", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Email - { - get { return _email; } - - set - { - if (_email != value) - { - _email = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("password", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Password - { - get { return _password; } - - set - { - if (_password != value) - { - _password = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("phone", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Phone - { - get { return _phone; } - - set - { - if (_phone != value) - { - _phone = value; - RaisePropertyChanged(); - } - } - } - - /// - /// User Status - /// - [Newtonsoft.Json.JsonProperty("userStatus", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? UserStatus - { - get { return _userStatus; } - - set - { - if (_userStatus != value) - { - _userStatus = value; - RaisePropertyChanged(); - } - } - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public enum Anonymous - { - - [System.Runtime.Serialization.EnumMember(Value = @"available")] - Available = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"pending")] - Pending = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"sold")] - Sold = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public enum PetStatus - { - - [System.Runtime.Serialization.EnumMember(Value = @"available")] - Available = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"pending")] - Pending = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"sold")] - Sold = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public enum OrderStatus - { - - [System.Runtime.Serialization.EnumMember(Value = @"placed")] - Placed = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"approved")] - Approved = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"delivered")] - Delivered = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class FileParameter - { - public FileParameter(System.IO.Stream data) - : this (data, null, null) - { - } - - public FileParameter(System.IO.Stream data, string fileName) - : this (data, fileName, null) - { - } - - public FileParameter(System.IO.Stream data, string fileName, string contentType) - { - Data = data; - FileName = fileName; - ContentType = contentType; - } - - public System.IO.Stream Data { get; private set; } - - public string FileName { get; private set; } - - public string ContentType { get; private set; } - } - - - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class SwaggerException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public SwaggerException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class SwaggerException : SwaggerException - { - public TResult Result { get; private set; } - - public SwaggerException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - -} - -#pragma warning restore 1591 -#pragma warning restore 1573 -#pragma warning restore 472 -#pragma warning restore 114 -#pragma warning restore 108 -#pragma warning restore 3016 \ No newline at end of file diff --git a/src/NSwag.Integration.ClientPCL/ServiceClients.cs b/src/NSwag.Integration.ClientPCL/ServiceClients.cs deleted file mode 100644 index 2e17ba2cfd..0000000000 --- a/src/NSwag.Integration.ClientPCL/ServiceClients.cs +++ /dev/null @@ -1,2131 +0,0 @@ -//---------------------- -// -// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- - -using NSwag.Integration.ClientPCL.Contracts; - -#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." -#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." -#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' -#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... -#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." -#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" -#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" - -namespace NSwag.Integration.ClientPCL -{ - using System = global::System; - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class GeoClient : ClientBase - { - private string _baseUrl = "http://localhost:13452"; - private System.Net.Http.HttpClient _httpClient; - private System.Lazy _settings; - - public GeoClient(System.Net.Http.HttpClient httpClient) - { - _httpClient = httpClient; - _settings = new System.Lazy(CreateSerializerSettings); - } - - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() - { - var settings = new Newtonsoft.Json.JsonSerializerSettings { PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.All, Converters = new Newtonsoft.Json.JsonConverter[] { new Newtonsoft.Json.Converters.StringEnumConverter(), new JsonExceptionConverter() } }; - UpdateJsonSerializerSettings(settings); - return settings; - } - - public string BaseUrl - { - get { return _baseUrl; } - set { _baseUrl = value; } - } - - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task FromBodyTestAsync(GeoPoint location) - { - return FromBodyTestAsync(location, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task FromBodyTestAsync(GeoPoint location, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Geo/FromBodyTest"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(location, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return new SwaggerResponse(status_, headers_); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GeoClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task FromUriTestAsync(double? latitude, double? longitude) - { - return FromUriTestAsync(latitude, longitude, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task FromUriTestAsync(double? latitude, double? longitude, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Geo/FromUriTest?"); - if (latitude != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("Latitude") + "=").Append(System.Uri.EscapeDataString(ConvertToString(latitude, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - if (longitude != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("Longitude") + "=").Append(System.Uri.EscapeDataString(ConvertToString(longitude, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return new SwaggerResponse(status_, headers_); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GeoClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task AddPolygonAsync(System.Collections.Generic.IEnumerable points) - { - return AddPolygonAsync(points, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AddPolygonAsync(System.Collections.Generic.IEnumerable points, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Geo/AddPolygon"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(points, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return new SwaggerResponse(status_, headers_); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GeoClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task FilterAsync(System.Collections.Generic.IEnumerable currentStates) - { - return FilterAsync(currentStates, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task FilterAsync(System.Collections.Generic.IEnumerable currentStates, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Geo/Filter?"); - if (currentStates != null) - { - foreach (var item_ in currentStates) { urlBuilder_.Append(System.Uri.EscapeDataString("currentStates") + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } - } - urlBuilder_.Length--; - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return new SwaggerResponse(status_, headers_); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GeoClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task>> ReverseAsync(System.Collections.Generic.IEnumerable values) - { - return ReverseAsync(values, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task>> ReverseAsync(System.Collections.Generic.IEnumerable values, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Geo/Reverse?"); - if (values != null) - { - foreach (var item_ in values) { urlBuilder_.Append(System.Uri.EscapeDataString("values") + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } - } - urlBuilder_.Length--; - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - return new SwaggerResponse>(status_, headers_, objectResponse_.Object); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GeoClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task RefreshAsync() - { - return RefreshAsync(System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task RefreshAsync(System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Geo/Refresh"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return new SwaggerResponse(status_, headers_); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GeoClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> UploadFileAsync(FileParameter file) - { - return UploadFileAsync(file, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> UploadFileAsync(FileParameter file, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Geo/UploadFile"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - var boundary_ = System.Guid.NewGuid().ToString(); - var content_ = new System.Net.Http.MultipartFormDataContent(boundary_); - content_.Headers.Remove("Content-Type"); - content_.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary_); - - if (file != null) - { - var content_file_ = new System.Net.Http.StreamContent(file.Data); - if (!string.IsNullOrEmpty(file.ContentType)) - content_file_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(file.ContentType); - content_.Add(content_file_, "file", file.FileName ?? "file"); - } - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new GeoClientException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return new SwaggerResponse(status_, headers_, objectResponse_.Object); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GeoClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task UploadFilesAsync(System.Collections.Generic.IEnumerable files) - { - return UploadFilesAsync(files, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UploadFilesAsync(System.Collections.Generic.IEnumerable files, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Geo/UploadFiles"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - var boundary_ = System.Guid.NewGuid().ToString(); - var content_ = new System.Net.Http.MultipartFormDataContent(boundary_); - content_.Headers.Remove("Content-Type"); - content_.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary_); - - if (files != null) - { - foreach (var item_ in files) - { - var content_files_ = new System.Net.Http.StreamContent(item_.Data); - if (!string.IsNullOrEmpty(item_.ContentType)) - content_files_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(item_.ContentType); - content_.Add(content_files_, "files", item_.FileName ?? "files"); - } - } - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return new SwaggerResponse(status_, headers_); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GeoClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - /// A custom error occured. - public virtual System.Threading.Tasks.Task SaveItemsAsync(GenericRequestOfAddressAndPerson request) - { - return SaveItemsAsync(request, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - /// A custom error occured. - public virtual async System.Threading.Tasks.Task SaveItemsAsync(GenericRequestOfAddressAndPerson request, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Geo/SaveItems"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return new SwaggerResponse(status_, headers_); - } - else - if (status_ == 450) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new GeoClientException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - var responseObject_ = objectResponse_.Object != null ? objectResponse_.Object : new System.Exception(); - responseObject_.Data.Add("HttpStatus", status_.ToString()); - responseObject_.Data.Add("HttpHeaders", headers_); - responseObject_.Data.Add("HttpResponse", objectResponse_.Text); - throw new GeoClientException("A custom error occured.", status_, objectResponse_.Text, headers_, responseObject_); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GeoClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task GetUploadedFileAsync(int id, bool? @override) - { - return GetUploadedFileAsync(id, @override, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetUploadedFileAsync(int id, bool? @override, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Geo/GetUploadedFile/{id}?"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - if (@override != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("override") + "=").Append(System.Uri.EscapeDataString(ConvertToString(@override, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GeoClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> PostDoubleAsync(double? value) - { - return PostDoubleAsync(value, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> PostDoubleAsync(double? value, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Geo/PostDouble?"); - if (value != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("value") + "=").Append(System.Uri.EscapeDataString(ConvertToString(value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - return new SwaggerResponse(status_, headers_, objectResponse_.Object); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new GeoClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new GeoClientException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - using (var streamReader = new System.IO.StreamReader(responseStream)) - using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) - { - var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings); - var typedBody = serializer.Deserialize(jsonTextReader); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new GeoClientException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value.GetType().IsArray) - { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class PersonsClient : ClientBase - { - private string _baseUrl = "http://localhost:13452"; - private System.Net.Http.HttpClient _httpClient; - private System.Lazy _settings; - - public PersonsClient(System.Net.Http.HttpClient httpClient) - { - _httpClient = httpClient; - _settings = new System.Lazy(CreateSerializerSettings); - } - - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() - { - var settings = new Newtonsoft.Json.JsonSerializerSettings { PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.All, Converters = new Newtonsoft.Json.JsonConverter[] { new Newtonsoft.Json.Converters.StringEnumConverter(), new JsonExceptionConverter() } }; - UpdateJsonSerializerSettings(settings); - return settings; - } - - public string BaseUrl - { - get { return _baseUrl; } - set { _baseUrl = value; } - } - - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task>> GetAllAsync() - { - return GetAllAsync(System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task>> GetAllAsync(System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Persons"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - return new SwaggerResponse>(status_, headers_, objectResponse_.Object); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task AddAsync(Person person) - { - return AddAsync(person, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AddAsync(Person person, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Persons"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(person, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return new SwaggerResponse(status_, headers_); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task>> FindAsync(Gender gender) - { - return FindAsync(gender, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task>> FindAsync(Gender gender, System.Threading.CancellationToken cancellationToken) - { - if (gender == null) - throw new System.ArgumentNullException("gender"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Persons/find/{gender}"); - urlBuilder_.Replace("{gender}", System.Uri.EscapeDataString(ConvertToString(gender, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - return new SwaggerResponse>(status_, headers_, objectResponse_.Object); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task>> FindOptionalAsync(Gender? gender) - { - return FindOptionalAsync(gender, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task>> FindOptionalAsync(Gender? gender, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Persons/find2?"); - urlBuilder_.Append(System.Uri.EscapeDataString("gender") + "=").Append(System.Uri.EscapeDataString(gender != null ? ConvertToString(gender, System.Globalization.CultureInfo.InvariantCulture) : "")).Append("&"); - urlBuilder_.Length--; - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - return new SwaggerResponse>(status_, headers_, objectResponse_.Object); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> GetAsync(System.Guid id) - { - return GetAsync(id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetAsync(System.Guid id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Persons/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 500) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PersonsClientException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - var responseObject_ = objectResponse_.Object != null ? objectResponse_.Object : new PersonNotFoundException(); - responseObject_.Data.Add("HttpStatus", status_.ToString()); - responseObject_.Data.Add("HttpHeaders", headers_); - responseObject_.Data.Add("HttpResponse", objectResponse_.Text); - throw new PersonsClientException("A server side error occurred.", status_, objectResponse_.Text, headers_, responseObject_); - } - else - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - return new SwaggerResponse(status_, headers_, objectResponse_.Object); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task DeleteAsync(System.Guid id) - { - return DeleteAsync(id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteAsync(System.Guid id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Persons/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return new SwaggerResponse(status_, headers_); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> TransformAsync(Person person) - { - return TransformAsync(person, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> TransformAsync(Person person, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Persons/transform"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(person, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - return new SwaggerResponse(status_, headers_, objectResponse_.Object); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> ThrowAsync(System.Guid id) - { - return ThrowAsync(id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> ThrowAsync(System.Guid id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Persons/Throw?"); - urlBuilder_.Append(System.Uri.EscapeDataString("id") + "=").Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PersonsClientException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return new SwaggerResponse(status_, headers_, objectResponse_.Object); - } - else - if (status_ == 500) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PersonsClientException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - var responseObject_ = objectResponse_.Object != null ? objectResponse_.Object : new PersonNotFoundException(); - responseObject_.Data.Add("HttpStatus", status_.ToString()); - responseObject_.Data.Add("HttpHeaders", headers_); - responseObject_.Data.Add("HttpResponse", objectResponse_.Text); - throw new PersonsClientException("A server side error occurred.", status_, objectResponse_.Text, headers_, responseObject_); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets the name of a person. - /// - /// The person ID. - /// The person's name. - /// A server side error occurred. - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> GetNameAsync(System.Guid id) - { - return GetNameAsync(id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the name of a person. - /// - /// The person ID. - /// The person's name. - /// A server side error occurred. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetNameAsync(System.Guid id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Persons/{id}/Name"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PersonsClientException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return new SwaggerResponse(status_, headers_, objectResponse_.Object); - } - else - if (status_ == 500) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new PersonsClientException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - var responseObject_ = objectResponse_.Object != null ? objectResponse_.Object : new PersonNotFoundException(); - responseObject_.Data.Add("HttpStatus", status_.ToString()); - responseObject_.Data.Add("HttpHeaders", headers_); - responseObject_.Data.Add("HttpResponse", objectResponse_.Text); - throw new PersonsClientException("A server side error occurred.", status_, objectResponse_.Text, headers_, responseObject_); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> AddXmlAsync(string person) - { - return AddXmlAsync(person, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> AddXmlAsync(string person, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Persons/AddXml"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - var content_ = new System.Net.Http.StringContent(person); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/xml"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - return new SwaggerResponse(status_, headers_, objectResponse_.Object); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> UploadAsync(FileParameter data) - { - return UploadAsync(data, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> UploadAsync(FileParameter data, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Persons/upload"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false)) - { - var content_ = new System.Net.Http.StreamContent(data.Data); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(data.ContentType); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - return new SwaggerResponse(status_, headers_, objectResponse_.Object); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsClientException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new PersonsClientException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - using (var streamReader = new System.IO.StreamReader(responseStream)) - using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) - { - var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings); - var typedBody = serializer.Deserialize(jsonTextReader); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new PersonsClientException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value.GetType().IsArray) - { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.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(); - private readonly System.Collections.Generic.IDictionary _searchedNamespaces; - private readonly bool _hideStackTrace = false; - - public JsonExceptionConverter() - { - _searchedNamespaces = new System.Collections.Generic.Dictionary { { typeof(System.Exception).Namespace, System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(System.Exception)).Assembly } }; - } - - public override bool CanWrite => true; - - public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) - { - var exception = value as System.Exception; - if (exception != null) - { - var resolver = serializer.ContractResolver as Newtonsoft.Json.Serialization.DefaultContractResolver ?? _defaultContractResolver; - - var jObject = new Newtonsoft.Json.Linq.JObject(); - jObject.Add(resolver.GetResolvedPropertyName("discriminator"), exception.GetType().Name); - jObject.Add(resolver.GetResolvedPropertyName("Message"), exception.Message); - jObject.Add(resolver.GetResolvedPropertyName("StackTrace"), _hideStackTrace ? "HIDDEN" : exception.StackTrace); - jObject.Add(resolver.GetResolvedPropertyName("Source"), exception.Source); - jObject.Add(resolver.GetResolvedPropertyName("InnerException"), - exception.InnerException != null ? Newtonsoft.Json.Linq.JToken.FromObject(exception.InnerException, serializer) : null); - - foreach (var property in GetExceptionProperties(value.GetType())) - { - var propertyValue = property.Key.GetValue(exception); - if (propertyValue != null) - { - jObject.AddFirst(new Newtonsoft.Json.Linq.JProperty(resolver.GetResolvedPropertyName(property.Value), - Newtonsoft.Json.Linq.JToken.FromObject(propertyValue, serializer))); - } - } - - value = jObject; - } - - serializer.Serialize(writer, value); - } - - public override bool CanConvert(System.Type objectType) - { - return System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(System.Exception)).IsAssignableFrom(System.Reflection.IntrospectionExtensions.GetTypeInfo(objectType)); - } - - public override object ReadJson(Newtonsoft.Json.JsonReader reader, System.Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) - { - var jObject = serializer.Deserialize(reader); - if (jObject == null) - return null; - - var newSerializer = new Newtonsoft.Json.JsonSerializer(); - newSerializer.ContractResolver = (Newtonsoft.Json.Serialization.IContractResolver)System.Activator.CreateInstance(serializer.ContractResolver.GetType()); - - var field = GetField(typeof(Newtonsoft.Json.Serialization.DefaultContractResolver), "_sharedCache"); - if (field != null) - field.SetValue(newSerializer.ContractResolver, false); - - dynamic resolver = newSerializer.ContractResolver; - if (System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperty(newSerializer.ContractResolver.GetType(), "IgnoreSerializableAttribute") != null) - resolver.IgnoreSerializableAttribute = true; - if (System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperty(newSerializer.ContractResolver.GetType(), "IgnoreSerializableInterface") != null) - resolver.IgnoreSerializableInterface = true; - - Newtonsoft.Json.Linq.JToken token; - if (jObject.TryGetValue("discriminator", System.StringComparison.OrdinalIgnoreCase, out token)) - { - var discriminator = Newtonsoft.Json.Linq.Extensions.Value(token); - if (objectType.Name.Equals(discriminator) == false) - { - var exceptionType = System.Type.GetType("System." + discriminator, false); - if (exceptionType != null) - objectType = exceptionType; - else - { - foreach (var pair in _searchedNamespaces) - { - exceptionType = pair.Value.GetType(pair.Key + "." + discriminator); - if (exceptionType != null) - { - objectType = exceptionType; - break; - } - } - - } - } - } - - var value = jObject.ToObject(objectType, newSerializer); - foreach (var property in GetExceptionProperties(value.GetType())) - { - var jValue = jObject.GetValue(resolver.GetResolvedPropertyName(property.Value)); - var propertyValue = (object)jValue?.ToObject(property.Key.PropertyType); - if (property.Key.SetMethod != null) - property.Key.SetValue(value, propertyValue); - else - { - field = GetField(objectType, "m_" + property.Value.Substring(0, 1).ToLowerInvariant() + property.Value.Substring(1)); - if (field != null) - field.SetValue(value, propertyValue); - } - } - - SetExceptionFieldValue(jObject, "Message", value, "_message", resolver, newSerializer); - SetExceptionFieldValue(jObject, "StackTrace", value, "_stackTraceString", resolver, newSerializer); - SetExceptionFieldValue(jObject, "Source", value, "_source", resolver, newSerializer); - SetExceptionFieldValue(jObject, "InnerException", value, "_innerException", resolver, serializer); - - return value; - } - - private System.Reflection.FieldInfo GetField(System.Type type, string fieldName) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(type).GetDeclaredField(fieldName); - if (field == null && System.Reflection.IntrospectionExtensions.GetTypeInfo(type).BaseType != null) - return GetField(System.Reflection.IntrospectionExtensions.GetTypeInfo(type).BaseType, fieldName); - return field; - } - - private System.Collections.Generic.IDictionary GetExceptionProperties(System.Type exceptionType) - { - var result = new System.Collections.Generic.Dictionary(); - foreach (var property in System.Linq.Enumerable.Where(System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperties(exceptionType), - p => p.GetMethod?.IsPublic == true)) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(property); - var propertyName = attribute != null ? attribute.PropertyName : property.Name; - - if (!System.Linq.Enumerable.Contains(new[] { "Message", "StackTrace", "Source", "InnerException", "Data", "TargetSite", "HelpLink", "HResult" }, propertyName)) - result[property] = propertyName; - } - return result; - } - - private void SetExceptionFieldValue(Newtonsoft.Json.Linq.JObject jObject, string propertyName, object value, string fieldName, Newtonsoft.Json.Serialization.IContractResolver resolver, Newtonsoft.Json.JsonSerializer serializer) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(System.Exception)).GetDeclaredField(fieldName); - var jsonPropertyName = resolver is Newtonsoft.Json.Serialization.DefaultContractResolver ? ((Newtonsoft.Json.Serialization.DefaultContractResolver)resolver).GetResolvedPropertyName(propertyName) : propertyName; - var property = System.Linq.Enumerable.FirstOrDefault(jObject.Properties(), p => System.String.Equals(p.Name, jsonPropertyName, System.StringComparison.OrdinalIgnoreCase)); - if (property != null) - { - var fieldValue = property.Value.ToObject(field.FieldType, serializer); - field.SetValue(value, fieldValue); - } - } - } - -} - -#pragma warning restore 1591 -#pragma warning restore 1573 -#pragma warning restore 472 -#pragma warning restore 114 -#pragma warning restore 108 -#pragma warning restore 3016 \ No newline at end of file diff --git a/src/NSwag.Integration.ClientPCL/ServiceClientsContracts.cs b/src/NSwag.Integration.ClientPCL/ServiceClientsContracts.cs deleted file mode 100644 index 0732bc38ad..0000000000 --- a/src/NSwag.Integration.ClientPCL/ServiceClientsContracts.cs +++ /dev/null @@ -1,463 +0,0 @@ -//---------------------- -// -// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- - -#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." -#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." -#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' -#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... -#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." -#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" -#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" - -namespace NSwag.Integration.ClientPCL.Contracts -{ - using System = global::System; - - - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class GeoPoint - { - [Newtonsoft.Json.JsonProperty("Latitude", Required = Newtonsoft.Json.Required.Always)] - public double Latitude { get; set; } - - [Newtonsoft.Json.JsonProperty("Longitude", Required = Newtonsoft.Json.Required.Always)] - public double Longitude { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class GenericRequestOfAddressAndPerson - { - [Newtonsoft.Json.JsonProperty("Item1", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Address Item1 { get; set; } - - [Newtonsoft.Json.JsonProperty("Item2", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Person Item2 { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Address - { - [Newtonsoft.Json.JsonProperty("IsPrimary", Required = Newtonsoft.Json.Required.Always)] - public bool IsPrimary { get; set; } - - [Newtonsoft.Json.JsonProperty("City", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string City { get; set; } - - } - - [Newtonsoft.Json.JsonConverter(typeof(JsonInheritanceConverter), "discriminator")] - [JsonInheritanceAttribute("Teacher", typeof(Teacher))] - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Person - { - [Newtonsoft.Json.JsonProperty("Id", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public System.Guid Id { get; set; } - - /// - /// Gets or sets the first name. - /// - [Newtonsoft.Json.JsonProperty("FirstName", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - [System.ComponentModel.DataAnnotations.StringLength(int.MaxValue, MinimumLength = 2)] - public string FirstName { get; set; } - - /// - /// Gets or sets the last name. - /// - [Newtonsoft.Json.JsonProperty("LastName", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public string LastName { get; set; } - - [Newtonsoft.Json.JsonProperty("Gender", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public Gender Gender { get; set; } - - [Newtonsoft.Json.JsonProperty("DateOfBirth", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public System.DateTime DateOfBirth { get; set; } - - [Newtonsoft.Json.JsonProperty("Weight", Required = Newtonsoft.Json.Required.Always)] - public decimal Weight { get; set; } - - [Newtonsoft.Json.JsonProperty("Height", Required = Newtonsoft.Json.Required.Always)] - public double Height { get; set; } - - [Newtonsoft.Json.JsonProperty("Age", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Range(5, 99)] - public int Age { get; set; } - - [Newtonsoft.Json.JsonProperty("AverageSleepTime", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public System.TimeSpan AverageSleepTime { get; set; } - - [Newtonsoft.Json.JsonProperty("Address", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public Address Address { get; set; } = new Address(); - - [Newtonsoft.Json.JsonProperty("Children", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public System.Collections.ObjectModel.ObservableCollection Children { get; set; } = new System.Collections.ObjectModel.ObservableCollection(); - - [Newtonsoft.Json.JsonProperty("Skills", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.Dictionary Skills { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public enum Gender - { - - [System.Runtime.Serialization.EnumMember(Value = @"Male")] - Male = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Female")] - Female = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public enum SkillLevel - { - - Low = 0, - - Medium = 1, - - Height = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Teacher : Person - { - [Newtonsoft.Json.JsonProperty("Course", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Course { get; set; } - - [Newtonsoft.Json.JsonProperty("SkillLevel", Required = Newtonsoft.Json.Required.Always)] - public SkillLevel SkillLevel { get; set; } = NSwag.Integration.ClientPCL.Contracts.SkillLevel.Medium; - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - [Newtonsoft.Json.JsonObjectAttribute] - public partial class PersonNotFoundException : System.Exception - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public System.Guid Id { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, AllowMultiple = true)] - internal class JsonInheritanceAttribute : System.Attribute - { - public JsonInheritanceAttribute(string key, System.Type type) - { - Key = key; - Type = type; - } - - public string Key { get; } - - public System.Type Type { get; } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - internal class JsonInheritanceConverter : Newtonsoft.Json.JsonConverter - { - internal static readonly string DefaultDiscriminatorName = "discriminator"; - - private readonly string _discriminatorName; - - [System.ThreadStatic] - private static bool _isReading; - - [System.ThreadStatic] - private static bool _isWriting; - - public JsonInheritanceConverter() - { - _discriminatorName = DefaultDiscriminatorName; - } - - public JsonInheritanceConverter(string discriminatorName) - { - _discriminatorName = discriminatorName; - } - - public string DiscriminatorName { get { return _discriminatorName; } } - - public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) - { - try - { - _isWriting = true; - - var jObject = Newtonsoft.Json.Linq.JObject.FromObject(value, serializer); - jObject.AddFirst(new Newtonsoft.Json.Linq.JProperty(_discriminatorName, GetSubtypeDiscriminator(value.GetType()))); - writer.WriteToken(jObject.CreateReader()); - } - finally - { - _isWriting = false; - } - } - - public override bool CanWrite - { - get - { - if (_isWriting) - { - _isWriting = false; - return false; - } - return true; - } - } - - public override bool CanRead - { - get - { - if (_isReading) - { - _isReading = false; - return false; - } - return true; - } - } - - public override bool CanConvert(System.Type objectType) - { - return true; - } - - public override object ReadJson(Newtonsoft.Json.JsonReader reader, System.Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) - { - var jObject = serializer.Deserialize(reader); - if (jObject == null) - return null; - - var discriminatorValue = jObject.GetValue(_discriminatorName); - var discriminator = discriminatorValue != null ? Newtonsoft.Json.Linq.Extensions.Value(discriminatorValue) : null; - var subtype = GetObjectSubtype(objectType, discriminator); - - var objectContract = serializer.ContractResolver.ResolveContract(subtype) as Newtonsoft.Json.Serialization.JsonObjectContract; - if (objectContract == null || System.Linq.Enumerable.All(objectContract.Properties, p => p.PropertyName != _discriminatorName)) - { - jObject.Remove(_discriminatorName); - } - - try - { - _isReading = true; - return serializer.Deserialize(jObject.CreateReader(), subtype); - } - finally - { - _isReading = false; - } - } - - private System.Type GetObjectSubtype(System.Type objectType, string discriminator) - { - foreach (var attribute in System.Reflection.CustomAttributeExtensions.GetCustomAttributes(System.Reflection.IntrospectionExtensions.GetTypeInfo(objectType), true)) - { - if (attribute.Key == discriminator) - return attribute.Type; - } - - return objectType; - } - - private string GetSubtypeDiscriminator(System.Type objectType) - { - foreach (var attribute in System.Reflection.CustomAttributeExtensions.GetCustomAttributes(System.Reflection.IntrospectionExtensions.GetTypeInfo(objectType), true)) - { - if (attribute.Type == objectType) - return attribute.Key; - } - - return objectType.Name; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class FileParameter - { - public FileParameter(System.IO.Stream data) - : this (data, null, null) - { - } - - public FileParameter(System.IO.Stream data, string fileName) - : this (data, fileName, null) - { - } - - public FileParameter(System.IO.Stream data, string fileName, string contentType) - { - Data = data; - FileName = fileName; - ContentType = contentType; - } - - public System.IO.Stream Data { get; private set; } - - public string FileName { get; private set; } - - public string ContentType { get; private set; } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class FileResponse : System.IDisposable - { - private System.IDisposable _client; - private System.IDisposable _response; - - public int StatusCode { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public System.IO.Stream Stream { get; private set; } - - public bool IsPartial - { - get { return StatusCode == 206; } - } - - public FileResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary> headers, System.IO.Stream stream, System.IDisposable client, System.IDisposable response) - { - StatusCode = statusCode; - Headers = headers; - Stream = stream; - _client = client; - _response = response; - } - - public void Dispose() - { - Stream.Dispose(); - if (_response != null) - _response.Dispose(); - if (_client != null) - _client.Dispose(); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class SwaggerResponse - { - public int StatusCode { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public SwaggerResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary> headers) - { - StatusCode = statusCode; - Headers = headers; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class SwaggerResponse : SwaggerResponse - { - public TResult Result { get; private set; } - - public SwaggerResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result) - : base(statusCode, headers) - { - Result = result; - } - } - - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class GeoClientException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public GeoClientException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class GeoClientException : GeoClientException - { - public TResult Result { get; private set; } - - public GeoClientException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class PersonsClientException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public PersonsClientException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class PersonsClientException : PersonsClientException - { - public TResult Result { get; private set; } - - public PersonsClientException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - -} - -#pragma warning restore 1591 -#pragma warning restore 1573 -#pragma warning restore 472 -#pragma warning restore 114 -#pragma warning restore 108 -#pragma warning restore 3016 \ No newline at end of file diff --git a/src/NSwag.Integration.ClientPCL/UberClient.cs b/src/NSwag.Integration.ClientPCL/UberClient.cs deleted file mode 100644 index 2eeb60e5ea..0000000000 --- a/src/NSwag.Integration.ClientPCL/UberClient.cs +++ /dev/null @@ -1,1243 +0,0 @@ -//---------------------- -// -// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- - -#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." -#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." -#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' -#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... -#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." -#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" -#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" - -namespace Uber -{ - using System = global::System; - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Client - { - private string _baseUrl = "https://api.uber.com/v1"; - private System.Net.Http.HttpClient _httpClient; - private System.Lazy _settings; - - public Client(System.Net.Http.HttpClient httpClient) - { - _httpClient = httpClient; - _settings = new System.Lazy(CreateSerializerSettings); - } - - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() - { - var settings = new Newtonsoft.Json.JsonSerializerSettings(); - UpdateJsonSerializerSettings(settings); - return settings; - } - - public string BaseUrl - { - get { return _baseUrl; } - set { _baseUrl = value; } - } - - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); - - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - - /// - /// Product Types - /// - /// Latitude component of location. - /// Longitude component of location. - /// An array of products - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> ProductsAsync(double latitude, double longitude) - { - return ProductsAsync(latitude, longitude, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Product Types - /// - /// Latitude component of location. - /// Longitude component of location. - /// An array of products - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> ProductsAsync(double latitude, double longitude, System.Threading.CancellationToken cancellationToken) - { - if (latitude == null) - throw new System.ArgumentNullException("latitude"); - - if (longitude == null) - throw new System.ArgumentNullException("longitude"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/products?"); - urlBuilder_.Append(System.Uri.EscapeDataString("latitude") + "=").Append(System.Uri.EscapeDataString(ConvertToString(latitude, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append(System.Uri.EscapeDataString("longitude") + "=").Append(System.Uri.EscapeDataString(ConvertToString(longitude, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new SwaggerException("Unexpected error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Price Estimates - /// - /// Latitude component of start location. - /// Longitude component of start location. - /// Latitude component of end location. - /// Longitude component of end location. - /// An array of price estimates by product - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> PriceAsync(double start_latitude, double start_longitude, double end_latitude, double end_longitude) - { - return PriceAsync(start_latitude, start_longitude, end_latitude, end_longitude, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Price Estimates - /// - /// Latitude component of start location. - /// Longitude component of start location. - /// Latitude component of end location. - /// Longitude component of end location. - /// An array of price estimates by product - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> PriceAsync(double start_latitude, double start_longitude, double end_latitude, double end_longitude, System.Threading.CancellationToken cancellationToken) - { - if (start_latitude == null) - throw new System.ArgumentNullException("start_latitude"); - - if (start_longitude == null) - throw new System.ArgumentNullException("start_longitude"); - - if (end_latitude == null) - throw new System.ArgumentNullException("end_latitude"); - - if (end_longitude == null) - throw new System.ArgumentNullException("end_longitude"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/estimates/price?"); - urlBuilder_.Append(System.Uri.EscapeDataString("start_latitude") + "=").Append(System.Uri.EscapeDataString(ConvertToString(start_latitude, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append(System.Uri.EscapeDataString("start_longitude") + "=").Append(System.Uri.EscapeDataString(ConvertToString(start_longitude, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append(System.Uri.EscapeDataString("end_latitude") + "=").Append(System.Uri.EscapeDataString(ConvertToString(end_latitude, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append(System.Uri.EscapeDataString("end_longitude") + "=").Append(System.Uri.EscapeDataString(ConvertToString(end_longitude, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new SwaggerException("Unexpected error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Time Estimates - /// - /// Latitude component of start location. - /// Longitude component of start location. - /// Unique customer identifier to be used for experience customization. - /// Unique identifier representing a specific product for a given latitude & longitude. - /// An array of products - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> TimeAsync(double start_latitude, double start_longitude, System.Guid? customer_uuid, string product_id) - { - return TimeAsync(start_latitude, start_longitude, customer_uuid, product_id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Time Estimates - /// - /// Latitude component of start location. - /// Longitude component of start location. - /// Unique customer identifier to be used for experience customization. - /// Unique identifier representing a specific product for a given latitude & longitude. - /// An array of products - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> TimeAsync(double start_latitude, double start_longitude, System.Guid? customer_uuid, string product_id, System.Threading.CancellationToken cancellationToken) - { - if (start_latitude == null) - throw new System.ArgumentNullException("start_latitude"); - - if (start_longitude == null) - throw new System.ArgumentNullException("start_longitude"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/estimates/time?"); - urlBuilder_.Append(System.Uri.EscapeDataString("start_latitude") + "=").Append(System.Uri.EscapeDataString(ConvertToString(start_latitude, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append(System.Uri.EscapeDataString("start_longitude") + "=").Append(System.Uri.EscapeDataString(ConvertToString(start_longitude, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (customer_uuid != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("customer_uuid") + "=").Append(System.Uri.EscapeDataString(ConvertToString(customer_uuid, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - if (product_id != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("product_id") + "=").Append(System.Uri.EscapeDataString(ConvertToString(product_id, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new SwaggerException("Unexpected error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// User Profile - /// - /// Profile information for a user - /// A server side error occurred. - public virtual System.Threading.Tasks.Task MeAsync() - { - return MeAsync(System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// User Profile - /// - /// Profile information for a user - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task MeAsync(System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/me"); - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new SwaggerException("Unexpected error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// User Activity - /// - /// Offset the list of returned results by this amount. Default is zero. - /// Number of items to retrieve. Default is 5, maximum is 100. - /// History information for the given user - /// A server side error occurred. - public virtual System.Threading.Tasks.Task HistoryAsync(int? offset, int? limit) - { - return HistoryAsync(offset, limit, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// User Activity - /// - /// Offset the list of returned results by this amount. Default is zero. - /// Number of items to retrieve. Default is 5, maximum is 100. - /// History information for the given user - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task HistoryAsync(int? offset, int? limit, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/history?"); - if (offset != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("offset") + "=").Append(System.Uri.EscapeDataString(ConvertToString(offset, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - if (limit != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("limit") + "=").Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new SwaggerException("Unexpected error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new SwaggerException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - using (var streamReader = new System.IO.StreamReader(responseStream)) - using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) - { - var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings); - var typedBody = serializer.Deserialize(jsonTextReader); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new SwaggerException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value.GetType().IsArray) - { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Product : System.ComponentModel.INotifyPropertyChanged - { - private string _product_id; - private string _description; - private string _display_name; - private string _capacity; - private string _image; - - /// - /// Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. - /// - [Newtonsoft.Json.JsonProperty("product_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Product_id - { - get { return _product_id; } - - set - { - if (_product_id != value) - { - _product_id = value; - RaisePropertyChanged(); - } - } - } - - /// - /// Description of product. - /// - [Newtonsoft.Json.JsonProperty("description", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Description - { - get { return _description; } - - set - { - if (_description != value) - { - _description = value; - RaisePropertyChanged(); - } - } - } - - /// - /// Display name of product. - /// - [Newtonsoft.Json.JsonProperty("display_name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Display_name - { - get { return _display_name; } - - set - { - if (_display_name != value) - { - _display_name = value; - RaisePropertyChanged(); - } - } - } - - /// - /// Capacity of product. For example, 4 people. - /// - [Newtonsoft.Json.JsonProperty("capacity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Capacity - { - get { return _capacity; } - - set - { - if (_capacity != value) - { - _capacity = value; - RaisePropertyChanged(); - } - } - } - - /// - /// Image URL representing the product. - /// - [Newtonsoft.Json.JsonProperty("image", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Image - { - get { return _image; } - - set - { - if (_image != value) - { - _image = value; - RaisePropertyChanged(); - } - } - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class PriceEstimate : System.ComponentModel.INotifyPropertyChanged - { - private string _product_id; - private string _currency_code; - private string _display_name; - private string _estimate; - private double? _low_estimate; - private double? _high_estimate; - private double? _surge_multiplier; - - /// - /// Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles - /// - [Newtonsoft.Json.JsonProperty("product_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Product_id - { - get { return _product_id; } - - set - { - if (_product_id != value) - { - _product_id = value; - RaisePropertyChanged(); - } - } - } - - /// - /// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code. - /// - [Newtonsoft.Json.JsonProperty("currency_code", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Currency_code - { - get { return _currency_code; } - - set - { - if (_currency_code != value) - { - _currency_code = value; - RaisePropertyChanged(); - } - } - } - - /// - /// Display name of product. - /// - [Newtonsoft.Json.JsonProperty("display_name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Display_name - { - get { return _display_name; } - - set - { - if (_display_name != value) - { - _display_name = value; - RaisePropertyChanged(); - } - } - } - - /// - /// Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or "Metered" for TAXI. - /// - [Newtonsoft.Json.JsonProperty("estimate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Estimate - { - get { return _estimate; } - - set - { - if (_estimate != value) - { - _estimate = value; - RaisePropertyChanged(); - } - } - } - - /// - /// Lower bound of the estimated price. - /// - [Newtonsoft.Json.JsonProperty("low_estimate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public double? Low_estimate - { - get { return _low_estimate; } - - set - { - if (_low_estimate != value) - { - _low_estimate = value; - RaisePropertyChanged(); - } - } - } - - /// - /// Upper bound of the estimated price. - /// - [Newtonsoft.Json.JsonProperty("high_estimate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public double? High_estimate - { - get { return _high_estimate; } - - set - { - if (_high_estimate != value) - { - _high_estimate = value; - RaisePropertyChanged(); - } - } - } - - /// - /// Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier. - /// - [Newtonsoft.Json.JsonProperty("surge_multiplier", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public double? Surge_multiplier - { - get { return _surge_multiplier; } - - set - { - if (_surge_multiplier != value) - { - _surge_multiplier = value; - RaisePropertyChanged(); - } - } - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Profile : System.ComponentModel.INotifyPropertyChanged - { - private string _first_name; - private string _last_name; - private string _email; - private string _picture; - private string _promo_code; - - /// - /// First name of the Uber user. - /// - [Newtonsoft.Json.JsonProperty("first_name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string First_name - { - get { return _first_name; } - - set - { - if (_first_name != value) - { - _first_name = value; - RaisePropertyChanged(); - } - } - } - - /// - /// Last name of the Uber user. - /// - [Newtonsoft.Json.JsonProperty("last_name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Last_name - { - get { return _last_name; } - - set - { - if (_last_name != value) - { - _last_name = value; - RaisePropertyChanged(); - } - } - } - - /// - /// Email address of the Uber user - /// - [Newtonsoft.Json.JsonProperty("email", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Email - { - get { return _email; } - - set - { - if (_email != value) - { - _email = value; - RaisePropertyChanged(); - } - } - } - - /// - /// Image URL of the Uber user. - /// - [Newtonsoft.Json.JsonProperty("picture", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Picture - { - get { return _picture; } - - set - { - if (_picture != value) - { - _picture = value; - RaisePropertyChanged(); - } - } - } - - /// - /// Promo code of the Uber user. - /// - [Newtonsoft.Json.JsonProperty("promo_code", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Promo_code - { - get { return _promo_code; } - - set - { - if (_promo_code != value) - { - _promo_code = value; - RaisePropertyChanged(); - } - } - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Activity : System.ComponentModel.INotifyPropertyChanged - { - private string _uuid; - - /// - /// Unique identifier for the activity - /// - [Newtonsoft.Json.JsonProperty("uuid", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Uuid - { - get { return _uuid; } - - set - { - if (_uuid != value) - { - _uuid = value; - RaisePropertyChanged(); - } - } - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Activities : System.ComponentModel.INotifyPropertyChanged - { - private int? _offset; - private int? _limit; - private int? _count; - private System.Collections.ObjectModel.ObservableCollection _history; - - /// - /// Position in pagination. - /// - [Newtonsoft.Json.JsonProperty("offset", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? Offset - { - get { return _offset; } - - set - { - if (_offset != value) - { - _offset = value; - RaisePropertyChanged(); - } - } - } - - /// - /// Number of items to retrieve (100 max). - /// - [Newtonsoft.Json.JsonProperty("limit", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? Limit - { - get { return _limit; } - - set - { - if (_limit != value) - { - _limit = value; - RaisePropertyChanged(); - } - } - } - - /// - /// Total number of items available. - /// - [Newtonsoft.Json.JsonProperty("count", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? Count - { - get { return _count; } - - set - { - if (_count != value) - { - _count = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("history", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.ObjectModel.ObservableCollection History - { - get { return _history; } - - set - { - if (_history != value) - { - _history = value; - RaisePropertyChanged(); - } - } - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Error : System.ComponentModel.INotifyPropertyChanged - { - private int? _code; - private string _message; - private string _fields; - - [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public int? Code - { - get { return _code; } - - set - { - if (_code != value) - { - _code = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Message - { - get { return _message; } - - set - { - if (_message != value) - { - _message = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("fields", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Fields - { - get { return _fields; } - - set - { - if (_fields != value) - { - _fields = value; - RaisePropertyChanged(); - } - } - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - - - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class SwaggerException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public SwaggerException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class SwaggerException : SwaggerException - { - public TResult Result { get; private set; } - - public SwaggerException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - -} - -#pragma warning restore 1591 -#pragma warning restore 1573 -#pragma warning restore 472 -#pragma warning restore 114 -#pragma warning restore 108 -#pragma warning restore 3016 \ No newline at end of file diff --git a/src/NSwag.Integration.ClientPCL/swagger.json b/src/NSwag.Integration.ClientPCL/swagger.json deleted file mode 100644 index f2c7c88a00..0000000000 --- a/src/NSwag.Integration.ClientPCL/swagger.json +++ /dev/null @@ -1,869 +0,0 @@ -{ - "x-generator": "NSwag v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))", - "info": { - "title": "Swagger specification", - "version": "1.0.0" - }, - "host": "localhost:13452", - "schemes": [ - "http" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/api/Geo/FromBodyTest": { - "post": { - "tags": [ - "Geo" - ], - "operationId": "Geo_FromBodyTest", - "parameters": [ - { - "name": "location", - "in": "body", - "schema": { - "$ref": "#/definitions/GeoPoint" - }, - "x-nullable": true - } - ], - "responses": { - "204": { - "description": "" - } - } - } - }, - "/api/Geo/FromUriTest": { - "post": { - "tags": [ - "Geo" - ], - "operationId": "Geo_FromUriTest", - "parameters": [ - { - "type": "number", - "name": "Latitude", - "in": "query", - "format": "double", - "x-nullable": false - }, - { - "type": "number", - "name": "Longitude", - "in": "query", - "format": "double", - "x-nullable": false - } - ], - "responses": { - "204": { - "description": "" - } - } - } - }, - "/api/Geo/AddPolygon": { - "post": { - "tags": [ - "Geo" - ], - "operationId": "Geo_AddPolygon", - "parameters": [ - { - "name": "points", - "in": "body", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/GeoPoint" - } - }, - "x-nullable": true - } - ], - "responses": { - "204": { - "description": "" - } - } - } - }, - "/api/Geo/Filter": { - "post": { - "tags": [ - "Geo" - ], - "operationId": "Geo_Filter", - "parameters": [ - { - "type": "array", - "name": "currentStates", - "in": "query", - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "" - } - } - } - }, - "/api/Geo/Reverse": { - "post": { - "tags": [ - "Geo" - ], - "operationId": "Geo_Reverse", - "parameters": [ - { - "type": "array", - "name": "values", - "in": "query", - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "type": "string" - } - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - }, - "/api/Geo/Refresh": { - "post": { - "tags": [ - "Geo" - ], - "operationId": "Geo_Refresh", - "responses": { - "204": { - "description": "" - } - } - } - }, - "/api/Geo/UploadFile": { - "post": { - "tags": [ - "Geo" - ], - "operationId": "Geo_UploadFile", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "type": "file", - "name": "file", - "in": "formData", - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "type": "boolean" - } - } - } - } - }, - "/api/Geo/UploadFiles": { - "post": { - "tags": [ - "Geo" - ], - "operationId": "Geo_UploadFiles", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "type": "file", - "name": "files", - "in": "formData", - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "type": "file" - } - } - ], - "responses": { - "204": { - "description": "" - } - } - } - }, - "/api/Geo/SaveItems": { - "post": { - "tags": [ - "Geo" - ], - "operationId": "Geo_SaveItems", - "parameters": [ - { - "name": "request", - "in": "body", - "schema": { - "$ref": "#/definitions/GenericRequestOfAddressAndPerson" - }, - "x-nullable": true - } - ], - "responses": { - "204": { - "description": "" - }, - "450": { - "x-nullable": false, - "description": "A custom error occured.", - "schema": { - "$ref": "#/definitions/Exception" - } - } - } - } - }, - "/api/Geo/GetUploadedFile/{id}": { - "get": { - "tags": [ - "Geo" - ], - "operationId": "Geo_GetUploadedFile", - "parameters": [ - { - "type": "integer", - "name": "id", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "boolean", - "name": "override", - "in": "query", - "default": false, - "x-nullable": false - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "file" - } - } - } - } - }, - "/api/Geo/PostDouble": { - "post": { - "tags": [ - "Geo" - ], - "operationId": "Geo_PostDouble", - "parameters": [ - { - "type": "number", - "name": "value", - "in": "query", - "format": "double", - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "number", - "format": "double" - } - } - } - } - }, - "/api/Persons": { - "get": { - "tags": [ - "Persons" - ], - "operationId": "Persons_GetAll", - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Person" - } - } - } - } - }, - "post": { - "tags": [ - "Persons" - ], - "operationId": "Persons_Add", - "parameters": [ - { - "name": "person", - "in": "body", - "schema": { - "$ref": "#/definitions/Person" - }, - "x-nullable": true - } - ], - "responses": { - "204": { - "description": "" - } - } - } - }, - "/api/Persons/find/{gender}": { - "post": { - "tags": [ - "Persons" - ], - "operationId": "Persons_Find", - "parameters": [ - { - "type": "string", - "name": "gender", - "in": "path", - "required": true, - "x-schema": { - "$ref": "#/definitions/Gender" - }, - "x-nullable": false, - "enum": [ - "Male", - "Female" - ] - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Person" - } - } - } - } - } - }, - "/api/Persons/find2": { - "post": { - "tags": [ - "Persons" - ], - "operationId": "Persons_FindOptional", - "parameters": [ - { - "type": "string", - "name": "gender", - "in": "query", - "required": true, - "x-schema": { - "$ref": "#/definitions/Gender" - }, - "x-nullable": true, - "enum": [ - "Male", - "Female" - ] - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Person" - } - } - } - } - } - }, - "/api/Persons/{id}": { - "get": { - "tags": [ - "Persons" - ], - "operationId": "Persons_Get", - "parameters": [ - { - "type": "string", - "name": "id", - "in": "path", - "required": true, - "format": "guid", - "x-nullable": false - } - ], - "responses": { - "500": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/PersonNotFoundException" - } - }, - "200": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/Person" - } - } - } - }, - "delete": { - "tags": [ - "Persons" - ], - "operationId": "Persons_Delete", - "parameters": [ - { - "type": "string", - "name": "id", - "in": "path", - "required": true, - "format": "guid", - "x-nullable": false - } - ], - "responses": { - "204": { - "description": "" - } - } - } - }, - "/api/Persons/transform": { - "post": { - "tags": [ - "Persons" - ], - "operationId": "Persons_Transform", - "parameters": [ - { - "name": "person", - "in": "body", - "schema": { - "$ref": "#/definitions/Person" - }, - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/Person" - } - } - } - } - }, - "/api/Persons/Throw": { - "post": { - "tags": [ - "Persons" - ], - "operationId": "Persons_Throw", - "parameters": [ - { - "type": "string", - "name": "id", - "in": "query", - "required": true, - "format": "guid", - "x-nullable": false - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/Person" - } - }, - "500": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/PersonNotFoundException" - } - } - } - } - }, - "/api/Persons/{id}/Name": { - "get": { - "tags": [ - "Persons" - ], - "summary": "Gets the name of a person.", - "operationId": "Persons_GetName", - "parameters": [ - { - "type": "string", - "name": "id", - "in": "path", - "required": true, - "description": "The person ID.", - "format": "guid", - "x-nullable": false - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "The person's name.", - "schema": { - "type": "string" - } - }, - "500": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/PersonNotFoundException" - } - } - } - } - }, - "/api/Persons/AddXml": { - "post": { - "tags": [ - "Persons" - ], - "operationId": "Persons_AddXml", - "consumes": [ - "application/xml" - ], - "parameters": [ - { - "name": "person", - "in": "body", - "schema": { - "type": "string", - "x-nullable": true - }, - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "string" - } - } - } - } - }, - "/api/Persons/upload": { - "post": { - "tags": [ - "Persons" - ], - "operationId": "Persons_Upload", - "consumes": [ - "application/octet-stream", - "multipart/form-data" - ], - "parameters": [ - { - "name": "data", - "in": "body", - "schema": { - "type": "string", - "format": "binary", - "x-nullable": true - }, - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "string", - "format": "byte" - } - } - } - } - } - }, - "definitions": { - "GeoPoint": { - "type": "object", - "required": [ - "Latitude", - "Longitude" - ], - "properties": { - "Latitude": { - "type": "number", - "format": "double" - }, - "Longitude": { - "type": "number", - "format": "double" - } - } - }, - "Exception": { - "type": "object", - "properties": { - "Message": { - "type": "string" - }, - "InnerException": { - "$ref": "#/definitions/Exception" - }, - "StackTrace": { - "type": "string" - }, - "Source": { - "type": "string" - } - } - }, - "GenericRequestOfAddressAndPerson": { - "type": "object", - "properties": { - "Item1": { - "$ref": "#/definitions/Address" - }, - "Item2": { - "$ref": "#/definitions/Person" - } - } - }, - "Address": { - "type": "object", - "required": [ - "IsPrimary" - ], - "properties": { - "IsPrimary": { - "type": "boolean" - }, - "City": { - "type": "string" - } - } - }, - "Person": { - "type": "object", - "discriminator": "discriminator", - "required": [ - "Id", - "FirstName", - "LastName", - "Gender", - "DateOfBirth", - "Weight", - "Height", - "Age", - "AverageSleepTime", - "Address", - "Children", - "discriminator" - ], - "properties": { - "Id": { - "type": "string", - "format": "guid" - }, - "FirstName": { - "type": "string", - "description": "Gets or sets the first name.", - "minLength": 2 - }, - "LastName": { - "type": "string", - "description": "Gets or sets the last name.", - "minLength": 1 - }, - "Gender": { - "$ref": "#/definitions/Gender" - }, - "DateOfBirth": { - "type": "string", - "format": "date-time" - }, - "Weight": { - "type": "number", - "format": "decimal" - }, - "Height": { - "type": "number", - "format": "double" - }, - "Age": { - "type": "integer", - "format": "int32", - "maximum": 99.0, - "minimum": 5.0 - }, - "AverageSleepTime": { - "type": "string", - "format": "time-span" - }, - "Address": { - "$ref": "#/definitions/Address" - }, - "Children": { - "type": "array", - "items": { - "$ref": "#/definitions/Person" - } - }, - "Skills": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/SkillLevel" - } - }, - "discriminator": { - "type": "string" - } - } - }, - "Gender": { - "type": "string", - "description": "", - "x-enumNames": [ - "Male", - "Female" - ], - "enum": [ - "Male", - "Female" - ] - }, - "SkillLevel": { - "type": "integer", - "description": "", - "x-enumNames": [ - "Low", - "Medium", - "Height" - ], - "enum": [ - 0, - 1, - 2 - ] - }, - "Teacher": { - "allOf": [ - { - "$ref": "#/definitions/Person" - }, - { - "type": "object", - "required": [ - "SkillLevel" - ], - "properties": { - "Course": { - "type": "string" - }, - "SkillLevel": { - "default": 1, - "allOf": [ - { - "$ref": "#/definitions/SkillLevel" - } - ] - } - } - } - ] - }, - "PersonNotFoundException": { - "allOf": [ - { - "$ref": "#/definitions/Exception" - }, - { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "format": "guid" - } - } - } - ] - } - }, - "securityDefinitions": { - "api_key": { - "type": "apiKey", - "name": "api_key", - "in": "header" - }, - "petstore_auth": { - "type": "oauth2", - "flow": "implicit", - "authorizationUrl": "http://swagger.io/api/oauth/dialog", - "scopes": { - "write:pets": "modify pets in your account", - "read:pets": "read your pets" - } - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.Console/App.config b/src/NSwag.Integration.Console/App.config deleted file mode 100644 index 4db1420979..0000000000 --- a/src/NSwag.Integration.Console/App.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/src/NSwag.Integration.Console/Controllers.cs b/src/NSwag.Integration.Console/Controllers.cs deleted file mode 100644 index 255062c800..0000000000 --- a/src/NSwag.Integration.Console/Controllers.cs +++ /dev/null @@ -1,791 +0,0 @@ -//---------------------- -// -// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- - -using System.Web.Http; - -#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." -#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." -#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' -#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... -#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." -#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" -#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" - -namespace MyNamespace -{ - using System = global::System; - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public interface IGeoController - { - - - - System.Threading.Tasks.Task FromBodyTestAsync(GeoPoint location); - - - - System.Threading.Tasks.Task FromUriTestAsync(double? latitude, double? longitude); - - - System.Threading.Tasks.Task AddPolygonAsync(System.Collections.Generic.IEnumerable points); - - - System.Threading.Tasks.Task FilterAsync(System.Collections.Generic.IEnumerable currentStates); - - - System.Threading.Tasks.Task> ReverseAsync(System.Collections.Generic.IEnumerable values); - - - System.Threading.Tasks.Task RefreshAsync(); - - - System.Threading.Tasks.Task UploadFileAsync(FileParameter file); - - - System.Threading.Tasks.Task UploadFilesAsync(System.Collections.Generic.IEnumerable files); - - - System.Threading.Tasks.Task SaveItemsAsync(GenericRequestOfAddressAndPerson request); - - - - System.Threading.Tasks.Task GetUploadedFileAsync(int id, bool @override); - - - System.Threading.Tasks.Task PostDoubleAsync(double? value); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - - public partial class GeoController : System.Web.Http.ApiController - { - private IGeoController _implementation; - - public GeoController(IGeoController implementation) - { - _implementation = implementation; - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Geo/FromBodyTest")] - public System.Threading.Tasks.Task FromBodyTest([System.Web.Http.FromBody] GeoPoint location) - { - - return _implementation.FromBodyTestAsync(location); - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Geo/FromUriTest")] - public System.Threading.Tasks.Task FromUriTest([System.Web.Http.FromUri] double? latitude, [System.Web.Http.FromUri] double? longitude) - { - - return _implementation.FromUriTestAsync(latitude, longitude); - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Geo/AddPolygon")] - public System.Threading.Tasks.Task AddPolygon([System.Web.Http.FromBody] System.Collections.Generic.IEnumerable points) - { - - return _implementation.AddPolygonAsync(points); - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Geo/Filter")] - public System.Threading.Tasks.Task Filter([System.Web.Http.FromUri] System.Collections.Generic.IEnumerable currentStates) - { - - return _implementation.FilterAsync(currentStates); - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Geo/Reverse")] - public System.Threading.Tasks.Task> Reverse([System.Web.Http.FromUri] System.Collections.Generic.IEnumerable values) - { - - return _implementation.ReverseAsync(values); - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Geo/Refresh")] - public System.Threading.Tasks.Task Refresh() - { - - return _implementation.RefreshAsync(); - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Geo/UploadFile")] - public System.Threading.Tasks.Task UploadFile(FileParameter file) - { - - return _implementation.UploadFileAsync(file); - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Geo/UploadFiles")] - public System.Threading.Tasks.Task UploadFiles(System.Collections.Generic.IEnumerable files) - { - - return _implementation.UploadFilesAsync(files); - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Geo/SaveItems")] - public System.Threading.Tasks.Task SaveItems([System.Web.Http.FromBody] GenericRequestOfAddressAndPerson request) - { - - return _implementation.SaveItemsAsync(request); - } - - [System.Web.Http.HttpGet, System.Web.Http.Route("api/Geo/GetUploadedFile/{id}")] - public System.Threading.Tasks.Task GetUploadedFile(int id, [System.Web.Http.FromUri(Name = "override")] bool? @override) - { - - return _implementation.GetUploadedFileAsync(id, @override ?? false); - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Geo/PostDouble")] - public System.Threading.Tasks.Task PostDouble([System.Web.Http.FromUri] double? value) - { - - return _implementation.PostDoubleAsync(value); - } - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public interface IPersonsController - { - - System.Threading.Tasks.Task> GetAllAsync(); - - - System.Threading.Tasks.Task AddAsync(Person person); - - - System.Threading.Tasks.Task> FindAsync(Gender gender); - - - System.Threading.Tasks.Task> FindOptionalAsync(Gender? gender); - - - System.Threading.Tasks.Task GetAsync(System.Guid id); - - - System.Threading.Tasks.Task DeleteAsync(System.Guid id); - - - System.Threading.Tasks.Task TransformAsync(Person person); - - - System.Threading.Tasks.Task ThrowAsync(System.Guid id); - - /// - /// Gets the name of a person. - /// - - /// The person ID. - - /// The person's name. - - System.Threading.Tasks.Task GetNameAsync(System.Guid id); - - - System.Threading.Tasks.Task AddXmlAsync(string person); - - - System.Threading.Tasks.Task UploadAsync(System.Web.HttpPostedFileBase data); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - - public partial class PersonsController : System.Web.Http.ApiController - { - private IPersonsController _implementation; - - public PersonsController(IPersonsController implementation) - { - _implementation = implementation; - } - - [System.Web.Http.HttpGet, System.Web.Http.Route("api/Persons")] - public System.Threading.Tasks.Task> GetAll() - { - - return _implementation.GetAllAsync(); - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Persons")] - public System.Threading.Tasks.Task Add([System.Web.Http.FromBody] Person person) - { - - return _implementation.AddAsync(person); - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Persons/find/{gender}")] - public System.Threading.Tasks.Task> Find(Gender gender) - { - - return _implementation.FindAsync(gender); - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Persons/find2")] - public System.Threading.Tasks.Task> FindOptional([System.Web.Http.FromUri] Gender? gender) - { - - return _implementation.FindOptionalAsync(gender); - } - - [System.Web.Http.HttpGet, System.Web.Http.Route("api/Persons/{id}")] - public System.Threading.Tasks.Task Get(System.Guid id) - { - - return _implementation.GetAsync(id); - } - - [System.Web.Http.HttpDelete, System.Web.Http.Route("api/Persons/{id}")] - public System.Threading.Tasks.Task Delete(System.Guid id) - { - - return _implementation.DeleteAsync(id); - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Persons/transform")] - public System.Threading.Tasks.Task Transform([System.Web.Http.FromBody] Person person) - { - - return _implementation.TransformAsync(person); - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Persons/Throw")] - public System.Threading.Tasks.Task Throw([System.Web.Http.FromUri] System.Guid id) - { - - return _implementation.ThrowAsync(id); - } - - /// - /// Gets the name of a person. - /// - /// The person ID. - /// The person's name. - [System.Web.Http.HttpGet, System.Web.Http.Route("api/Persons/{id}/Name")] - public System.Threading.Tasks.Task GetName(System.Guid id) - { - - return _implementation.GetNameAsync(id); - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Persons/AddXml")] - public System.Threading.Tasks.Task AddXml([System.Web.Http.FromBody] string person) - { - - return _implementation.AddXmlAsync(person); - } - - [System.Web.Http.HttpPost, System.Web.Http.Route("api/Persons/upload")] - public System.Threading.Tasks.Task Upload(System.Web.HttpPostedFileBase data) - { - - return _implementation.UploadAsync(data); - } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class GeoPoint - { - [Newtonsoft.Json.JsonProperty("Latitude", Required = Newtonsoft.Json.Required.Always)] - public double Latitude { get; set; } - - [Newtonsoft.Json.JsonProperty("Longitude", Required = Newtonsoft.Json.Required.Always)] - public double Longitude { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class GenericRequestOfAddressAndPerson - { - [Newtonsoft.Json.JsonProperty("Item1", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Address Item1 { get; set; } - - [Newtonsoft.Json.JsonProperty("Item2", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Person Item2 { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Address - { - [Newtonsoft.Json.JsonProperty("IsPrimary", Required = Newtonsoft.Json.Required.Always)] - public bool IsPrimary { get; set; } - - [Newtonsoft.Json.JsonProperty("City", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string City { get; set; } - - } - - [Newtonsoft.Json.JsonConverter(typeof(JsonInheritanceConverter), "discriminator")] - [JsonInheritanceAttribute("Teacher", typeof(Teacher))] - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Person - { - [Newtonsoft.Json.JsonProperty("Id", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public System.Guid Id { get; set; } - - /// - /// Gets or sets the first name. - /// - [Newtonsoft.Json.JsonProperty("FirstName", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - [System.ComponentModel.DataAnnotations.StringLength(int.MaxValue, MinimumLength = 2)] - public string FirstName { get; set; } - - /// - /// Gets or sets the last name. - /// - [Newtonsoft.Json.JsonProperty("LastName", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public string LastName { get; set; } - - [Newtonsoft.Json.JsonProperty("Gender", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public Gender Gender { get; set; } - - [Newtonsoft.Json.JsonProperty("DateOfBirth", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public System.DateTime DateOfBirth { get; set; } - - [Newtonsoft.Json.JsonProperty("Weight", Required = Newtonsoft.Json.Required.Always)] - public decimal Weight { get; set; } - - [Newtonsoft.Json.JsonProperty("Height", Required = Newtonsoft.Json.Required.Always)] - public double Height { get; set; } - - [Newtonsoft.Json.JsonProperty("Age", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Range(5, 99)] - public int Age { get; set; } - - [Newtonsoft.Json.JsonProperty("AverageSleepTime", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public System.TimeSpan AverageSleepTime { get; set; } - - [Newtonsoft.Json.JsonProperty("Address", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public Address Address { get; set; } = new Address(); - - [Newtonsoft.Json.JsonProperty("Children", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public System.Collections.Generic.List Children { get; set; } = new System.Collections.Generic.List(); - - [Newtonsoft.Json.JsonProperty("Skills", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.Dictionary Skills { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public enum Gender - { - - [System.Runtime.Serialization.EnumMember(Value = @"Male")] - Male = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Female")] - Female = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public enum SkillLevel - { - - Low = 0, - - Medium = 1, - - Height = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Teacher : Person - { - [Newtonsoft.Json.JsonProperty("Course", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Course { get; set; } - - [Newtonsoft.Json.JsonProperty("SkillLevel", Required = Newtonsoft.Json.Required.Always)] - public SkillLevel SkillLevel { get; set; } = MyNamespace.SkillLevel.Medium; - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - [Newtonsoft.Json.JsonObjectAttribute] - public partial class PersonNotFoundException : System.Exception - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public System.Guid Id { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, AllowMultiple = true)] - internal class JsonInheritanceAttribute : System.Attribute - { - public JsonInheritanceAttribute(string key, System.Type type) - { - Key = key; - Type = type; - } - - public string Key { get; } - - public System.Type Type { get; } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - internal class JsonInheritanceConverter : Newtonsoft.Json.JsonConverter - { - internal static readonly string DefaultDiscriminatorName = "discriminator"; - - private readonly string _discriminatorName; - - [System.ThreadStatic] - private static bool _isReading; - - [System.ThreadStatic] - private static bool _isWriting; - - public JsonInheritanceConverter() - { - _discriminatorName = DefaultDiscriminatorName; - } - - public JsonInheritanceConverter(string discriminatorName) - { - _discriminatorName = discriminatorName; - } - - public string DiscriminatorName { get { return _discriminatorName; } } - - public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) - { - try - { - _isWriting = true; - - var jObject = Newtonsoft.Json.Linq.JObject.FromObject(value, serializer); - jObject.AddFirst(new Newtonsoft.Json.Linq.JProperty(_discriminatorName, GetSubtypeDiscriminator(value.GetType()))); - writer.WriteToken(jObject.CreateReader()); - } - finally - { - _isWriting = false; - } - } - - public override bool CanWrite - { - get - { - if (_isWriting) - { - _isWriting = false; - return false; - } - return true; - } - } - - public override bool CanRead - { - get - { - if (_isReading) - { - _isReading = false; - return false; - } - return true; - } - } - - public override bool CanConvert(System.Type objectType) - { - return true; - } - - public override object ReadJson(Newtonsoft.Json.JsonReader reader, System.Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) - { - var jObject = serializer.Deserialize(reader); - if (jObject == null) - return null; - - var discriminatorValue = jObject.GetValue(_discriminatorName); - var discriminator = discriminatorValue != null ? Newtonsoft.Json.Linq.Extensions.Value(discriminatorValue) : null; - var subtype = GetObjectSubtype(objectType, discriminator); - - var objectContract = serializer.ContractResolver.ResolveContract(subtype) as Newtonsoft.Json.Serialization.JsonObjectContract; - if (objectContract == null || System.Linq.Enumerable.All(objectContract.Properties, p => p.PropertyName != _discriminatorName)) - { - jObject.Remove(_discriminatorName); - } - - try - { - _isReading = true; - return serializer.Deserialize(jObject.CreateReader(), subtype); - } - finally - { - _isReading = false; - } - } - - private System.Type GetObjectSubtype(System.Type objectType, string discriminator) - { - foreach (var attribute in System.Reflection.CustomAttributeExtensions.GetCustomAttributes(System.Reflection.IntrospectionExtensions.GetTypeInfo(objectType), true)) - { - if (attribute.Key == discriminator) - return attribute.Type; - } - - return objectType; - } - - private string GetSubtypeDiscriminator(System.Type objectType) - { - foreach (var attribute in System.Reflection.CustomAttributeExtensions.GetCustomAttributes(System.Reflection.IntrospectionExtensions.GetTypeInfo(objectType), true)) - { - if (attribute.Type == objectType) - return attribute.Key; - } - - return objectType.Name; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class FileParameter - { - public FileParameter(System.IO.Stream data) - : this (data, null, null) - { - } - - public FileParameter(System.IO.Stream data, string fileName) - : this (data, fileName, null) - { - } - - public FileParameter(System.IO.Stream data, string fileName, string contentType) - { - Data = data; - FileName = fileName; - ContentType = contentType; - } - - public System.IO.Stream Data { get; private set; } - - public string FileName { get; private set; } - - public string ContentType { get; private set; } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class FileResponse : System.IDisposable - { - private System.IDisposable _client; - private System.IDisposable _response; - - public int StatusCode { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public System.IO.Stream Stream { get; private set; } - - public bool IsPartial - { - get { return StatusCode == 206; } - } - - public FileResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary> headers, System.IO.Stream stream, System.IDisposable client, System.IDisposable response) - { - StatusCode = statusCode; - Headers = headers; - Stream = stream; - _client = client; - _response = response; - } - - public void Dispose() - { - Stream.Dispose(); - if (_response != null) - _response.Dispose(); - if (_client != null) - _client.Dispose(); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.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(); - private readonly System.Collections.Generic.IDictionary _searchedNamespaces; - private readonly bool _hideStackTrace = false; - - public JsonExceptionConverter() - { - _searchedNamespaces = new System.Collections.Generic.Dictionary { { typeof(System.Exception).Namespace, System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(System.Exception)).Assembly } }; - } - - public override bool CanWrite => true; - - public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) - { - var exception = value as System.Exception; - if (exception != null) - { - var resolver = serializer.ContractResolver as Newtonsoft.Json.Serialization.DefaultContractResolver ?? _defaultContractResolver; - - var jObject = new Newtonsoft.Json.Linq.JObject(); - jObject.Add(resolver.GetResolvedPropertyName("discriminator"), exception.GetType().Name); - jObject.Add(resolver.GetResolvedPropertyName("Message"), exception.Message); - jObject.Add(resolver.GetResolvedPropertyName("StackTrace"), _hideStackTrace ? "HIDDEN" : exception.StackTrace); - jObject.Add(resolver.GetResolvedPropertyName("Source"), exception.Source); - jObject.Add(resolver.GetResolvedPropertyName("InnerException"), - exception.InnerException != null ? Newtonsoft.Json.Linq.JToken.FromObject(exception.InnerException, serializer) : null); - - foreach (var property in GetExceptionProperties(value.GetType())) - { - var propertyValue = property.Key.GetValue(exception); - if (propertyValue != null) - { - jObject.AddFirst(new Newtonsoft.Json.Linq.JProperty(resolver.GetResolvedPropertyName(property.Value), - Newtonsoft.Json.Linq.JToken.FromObject(propertyValue, serializer))); - } - } - - value = jObject; - } - - serializer.Serialize(writer, value); - } - - public override bool CanConvert(System.Type objectType) - { - return System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(System.Exception)).IsAssignableFrom(System.Reflection.IntrospectionExtensions.GetTypeInfo(objectType)); - } - - public override object ReadJson(Newtonsoft.Json.JsonReader reader, System.Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) - { - var jObject = serializer.Deserialize(reader); - if (jObject == null) - return null; - - var newSerializer = new Newtonsoft.Json.JsonSerializer(); - newSerializer.ContractResolver = (Newtonsoft.Json.Serialization.IContractResolver)System.Activator.CreateInstance(serializer.ContractResolver.GetType()); - - var field = GetField(typeof(Newtonsoft.Json.Serialization.DefaultContractResolver), "_sharedCache"); - if (field != null) - field.SetValue(newSerializer.ContractResolver, false); - - dynamic resolver = newSerializer.ContractResolver; - if (System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperty(newSerializer.ContractResolver.GetType(), "IgnoreSerializableAttribute") != null) - resolver.IgnoreSerializableAttribute = true; - if (System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperty(newSerializer.ContractResolver.GetType(), "IgnoreSerializableInterface") != null) - resolver.IgnoreSerializableInterface = true; - - Newtonsoft.Json.Linq.JToken token; - if (jObject.TryGetValue("discriminator", System.StringComparison.OrdinalIgnoreCase, out token)) - { - var discriminator = Newtonsoft.Json.Linq.Extensions.Value(token); - if (objectType.Name.Equals(discriminator) == false) - { - var exceptionType = System.Type.GetType("System." + discriminator, false); - if (exceptionType != null) - objectType = exceptionType; - else - { - foreach (var pair in _searchedNamespaces) - { - exceptionType = pair.Value.GetType(pair.Key + "." + discriminator); - if (exceptionType != null) - { - objectType = exceptionType; - break; - } - } - - } - } - } - - var value = jObject.ToObject(objectType, newSerializer); - foreach (var property in GetExceptionProperties(value.GetType())) - { - var jValue = jObject.GetValue(resolver.GetResolvedPropertyName(property.Value)); - var propertyValue = (object)jValue?.ToObject(property.Key.PropertyType); - if (property.Key.SetMethod != null) - property.Key.SetValue(value, propertyValue); - else - { - field = GetField(objectType, "m_" + property.Value.Substring(0, 1).ToLowerInvariant() + property.Value.Substring(1)); - if (field != null) - field.SetValue(value, propertyValue); - } - } - - SetExceptionFieldValue(jObject, "Message", value, "_message", resolver, newSerializer); - SetExceptionFieldValue(jObject, "StackTrace", value, "_stackTraceString", resolver, newSerializer); - SetExceptionFieldValue(jObject, "Source", value, "_source", resolver, newSerializer); - SetExceptionFieldValue(jObject, "InnerException", value, "_innerException", resolver, serializer); - - return value; - } - - private System.Reflection.FieldInfo GetField(System.Type type, string fieldName) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(type).GetDeclaredField(fieldName); - if (field == null && System.Reflection.IntrospectionExtensions.GetTypeInfo(type).BaseType != null) - return GetField(System.Reflection.IntrospectionExtensions.GetTypeInfo(type).BaseType, fieldName); - return field; - } - - private System.Collections.Generic.IDictionary GetExceptionProperties(System.Type exceptionType) - { - var result = new System.Collections.Generic.Dictionary(); - foreach (var property in System.Linq.Enumerable.Where(System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperties(exceptionType), - p => p.GetMethod?.IsPublic == true)) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(property); - var propertyName = attribute != null ? attribute.PropertyName : property.Name; - - if (!System.Linq.Enumerable.Contains(new[] { "Message", "StackTrace", "Source", "InnerException", "Data", "TargetSite", "HelpLink", "HResult" }, propertyName)) - result[property] = propertyName; - } - return result; - } - - private void SetExceptionFieldValue(Newtonsoft.Json.Linq.JObject jObject, string propertyName, object value, string fieldName, Newtonsoft.Json.Serialization.IContractResolver resolver, Newtonsoft.Json.JsonSerializer serializer) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(System.Exception)).GetDeclaredField(fieldName); - var jsonPropertyName = resolver is Newtonsoft.Json.Serialization.DefaultContractResolver ? ((Newtonsoft.Json.Serialization.DefaultContractResolver)resolver).GetResolvedPropertyName(propertyName) : propertyName; - var property = System.Linq.Enumerable.FirstOrDefault(jObject.Properties(), p => System.String.Equals(p.Name, jsonPropertyName, System.StringComparison.OrdinalIgnoreCase)); - if (property != null) - { - var fieldValue = property.Value.ToObject(field.FieldType, serializer); - field.SetValue(value, fieldValue); - } - } - } - -} - -#pragma warning restore 1591 -#pragma warning restore 1573 -#pragma warning restore 472 -#pragma warning restore 114 -#pragma warning restore 108 -#pragma warning restore 3016 \ No newline at end of file diff --git a/src/NSwag.Integration.Console/NSwag.Integration.Console.csproj b/src/NSwag.Integration.Console/NSwag.Integration.Console.csproj deleted file mode 100644 index 9b3d33fca5..0000000000 --- a/src/NSwag.Integration.Console/NSwag.Integration.Console.csproj +++ /dev/null @@ -1,43 +0,0 @@ - - - Exe - net46 - true - win - NSwag.Integration.Console - NSwag.Integration.Console - Copyright © 2016 - - - full - - - pdbonly - - - bin\$(Platform)\$(Configuration)\ - full - MinimumRecommendedRules.ruleset - true - - - bin\$(Platform)\$(Configuration)\ - pdbonly - MinimumRecommendedRules.ruleset - true - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Integration.Console/Program.cs b/src/NSwag.Integration.Console/Program.cs deleted file mode 100644 index 3b9021c80c..0000000000 --- a/src/NSwag.Integration.Console/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace NSwag.Integration.Console -{ - class Program - { - static void Main(string[] args) - { - } - } -} diff --git a/src/NSwag.Integration.Console/ServiceClients.cs b/src/NSwag.Integration.Console/ServiceClients.cs deleted file mode 100644 index 09a9c4707a..0000000000 --- a/src/NSwag.Integration.Console/ServiceClients.cs +++ /dev/null @@ -1,2117 +0,0 @@ -//---------------------- -// -// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- - -using NSwag.Integration.Console.Contracts; - -#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." -#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." -#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' -#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... -#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." -#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" -#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" - -namespace NSwag.Integration.Console -{ - using System = global::System; - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class GeoClient - { - private System.Lazy _settings; - - public GeoClient() - { - _settings = new System.Lazy(CreateSerializerSettings); - } - - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() - { - var settings = new Newtonsoft.Json.JsonSerializerSettings { Converters = new Newtonsoft.Json.JsonConverter[] { new Newtonsoft.Json.Converters.StringEnumConverter(), new JsonExceptionConverter() } }; - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); - - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task FromBodyTestAsync(GeoPoint location) - { - return FromBodyTestAsync(location, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task FromBodyTestAsync(GeoPoint location, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Geo/FromBodyTest"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(location, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task FromUriTestAsync(double? latitude, double? longitude) - { - return FromUriTestAsync(latitude, longitude, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task FromUriTestAsync(double? latitude, double? longitude, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Geo/FromUriTest?"); - if (latitude != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("Latitude") + "=").Append(System.Uri.EscapeDataString(ConvertToString(latitude, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - if (longitude != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("Longitude") + "=").Append(System.Uri.EscapeDataString(ConvertToString(longitude, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task AddPolygonAsync(System.Collections.Generic.IEnumerable points) - { - return AddPolygonAsync(points, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AddPolygonAsync(System.Collections.Generic.IEnumerable points, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Geo/AddPolygon"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(points, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task FilterAsync(System.Collections.Generic.IEnumerable currentStates) - { - return FilterAsync(currentStates, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task FilterAsync(System.Collections.Generic.IEnumerable currentStates, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Geo/Filter?"); - if (currentStates != null) - { - foreach (var item_ in currentStates) { urlBuilder_.Append(System.Uri.EscapeDataString("currentStates") + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } - } - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> ReverseAsync(System.Collections.Generic.IEnumerable values) - { - return ReverseAsync(values, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> ReverseAsync(System.Collections.Generic.IEnumerable values, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Geo/Reverse?"); - if (values != null) - { - foreach (var item_ in values) { urlBuilder_.Append(System.Uri.EscapeDataString("values") + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } - } - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task RefreshAsync() - { - return RefreshAsync(System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task RefreshAsync(System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Geo/Refresh"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task UploadFileAsync(FileParameter file) - { - return UploadFileAsync(file, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UploadFileAsync(FileParameter file, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Geo/UploadFile"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var boundary_ = System.Guid.NewGuid().ToString(); - var content_ = new System.Net.Http.MultipartFormDataContent(boundary_); - content_.Headers.Remove("Content-Type"); - content_.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary_); - - if (file != null) - { - var content_file_ = new System.Net.Http.StreamContent(file.Data); - if (!string.IsNullOrEmpty(file.ContentType)) - content_file_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(file.ContentType); - content_.Add(content_file_, "file", file.FileName ?? "file"); - } - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task UploadFilesAsync(System.Collections.Generic.IEnumerable files) - { - return UploadFilesAsync(files, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UploadFilesAsync(System.Collections.Generic.IEnumerable files, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Geo/UploadFiles"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var boundary_ = System.Guid.NewGuid().ToString(); - var content_ = new System.Net.Http.MultipartFormDataContent(boundary_); - content_.Headers.Remove("Content-Type"); - content_.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary_); - - if (files != null) - { - foreach (var item_ in files) - { - var content_files_ = new System.Net.Http.StreamContent(item_.Data); - if (!string.IsNullOrEmpty(item_.ContentType)) - content_files_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(item_.ContentType); - content_.Add(content_files_, "files", item_.FileName ?? "files"); - } - } - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - /// A custom error occured. - public virtual System.Threading.Tasks.Task SaveItemsAsync(GenericRequestOfAddressAndPerson request) - { - return SaveItemsAsync(request, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - /// A custom error occured. - public virtual async System.Threading.Tasks.Task SaveItemsAsync(GenericRequestOfAddressAndPerson request, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Geo/SaveItems"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(request, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - if (status_ == 450) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - var responseObject_ = objectResponse_.Object != null ? objectResponse_.Object : new System.Exception(); - responseObject_.Data.Add("HttpStatus", status_.ToString()); - responseObject_.Data.Add("HttpHeaders", headers_); - responseObject_.Data.Add("HttpResponse", objectResponse_.Text); - throw new SwaggerException("A custom error occured.", status_, objectResponse_.Text, headers_, responseObject_); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task GetUploadedFileAsync(int id, bool? @override) - { - return GetUploadedFileAsync(id, @override, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetUploadedFileAsync(int id, bool? @override, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Geo/GetUploadedFile/{id}?"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - if (@override != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("override") + "=").Append(System.Uri.EscapeDataString(ConvertToString(@override, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200 || status_ == 206) - { - var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, client_, response_); - disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse - return fileResponse_; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task PostDoubleAsync(double? value) - { - return PostDoubleAsync(value, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task PostDoubleAsync(double? value, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Geo/PostDouble?"); - if (value != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("value") + "=").Append(System.Uri.EscapeDataString(ConvertToString(value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new SwaggerException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - using (var streamReader = new System.IO.StreamReader(responseStream)) - using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) - { - var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings); - var typedBody = serializer.Deserialize(jsonTextReader); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new SwaggerException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value.GetType().IsArray) - { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class PersonsClient - { - private System.Lazy _settings; - - public PersonsClient() - { - _settings = new System.Lazy(CreateSerializerSettings); - } - - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() - { - var settings = new Newtonsoft.Json.JsonSerializerSettings { Converters = new Newtonsoft.Json.JsonConverter[] { new Newtonsoft.Json.Converters.StringEnumConverter(), new JsonExceptionConverter() } }; - UpdateJsonSerializerSettings(settings); - return settings; - } - - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); - - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> GetAllAsync() - { - return GetAllAsync(System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> GetAllAsync(System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Persons"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task AddAsync(Person person) - { - return AddAsync(person, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AddAsync(Person person, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Persons"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(person, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> FindAsync(Gender gender) - { - return FindAsync(gender, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> FindAsync(Gender gender, System.Threading.CancellationToken cancellationToken) - { - if (gender == null) - throw new System.ArgumentNullException("gender"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Persons/find/{gender}"); - urlBuilder_.Replace("{gender}", System.Uri.EscapeDataString(ConvertToString(gender, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task> FindOptionalAsync(Gender? gender) - { - return FindOptionalAsync(gender, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task> FindOptionalAsync(Gender? gender, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Persons/find2?"); - urlBuilder_.Append(System.Uri.EscapeDataString("gender") + "=").Append(System.Uri.EscapeDataString(gender != null ? ConvertToString(gender, System.Globalization.CultureInfo.InvariantCulture) : "")).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_, cancellationToken).ConfigureAwait(false); - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - /// A server side error occurred. - public virtual System.Threading.Tasks.Task GetAsync(System.Guid id) - { - return GetAsync(id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetAsync(System.Guid id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Persons/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 500) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - var responseObject_ = objectResponse_.Object != null ? objectResponse_.Object : new PersonNotFoundException(); - responseObject_.Data.Add("HttpStatus", status_.ToString()); - responseObject_.Data.Add("HttpHeaders", headers_); - responseObject_.Data.Add("HttpResponse", objectResponse_.Text); - throw new SwaggerException("A server side error occurred.", status_, objectResponse_.Text, headers_, responseObject_); - } - else - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task DeleteAsync(System.Guid id) - { - return DeleteAsync(id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task DeleteAsync(System.Guid id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Persons/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 204) - { - return; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task TransformAsync(Person person) - { - return TransformAsync(person, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task TransformAsync(Person person, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Persons/transform"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(person, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - /// A server side error occurred. - public virtual System.Threading.Tasks.Task ThrowAsync(System.Guid id) - { - return ThrowAsync(id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ThrowAsync(System.Guid id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Persons/Throw?"); - urlBuilder_.Append(System.Uri.EscapeDataString("id") + "=").Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 500) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - var responseObject_ = objectResponse_.Object != null ? objectResponse_.Object : new PersonNotFoundException(); - responseObject_.Data.Add("HttpStatus", status_.ToString()); - responseObject_.Data.Add("HttpHeaders", headers_); - responseObject_.Data.Add("HttpResponse", objectResponse_.Text); - throw new SwaggerException("A server side error occurred.", status_, objectResponse_.Text, headers_, responseObject_); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// - /// Gets the name of a person. - /// - /// The person ID. - /// The person's name. - /// A server side error occurred. - /// A server side error occurred. - public virtual System.Threading.Tasks.Task GetNameAsync(System.Guid id) - { - return GetNameAsync(id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// - /// Gets the name of a person. - /// - /// The person ID. - /// The person's name. - /// A server side error occurred. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task GetNameAsync(System.Guid id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Persons/{id}/Name"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 500) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new SwaggerException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - var responseObject_ = objectResponse_.Object != null ? objectResponse_.Object : new PersonNotFoundException(); - responseObject_.Data.Add("HttpStatus", status_.ToString()); - responseObject_.Data.Add("HttpHeaders", headers_); - responseObject_.Data.Add("HttpResponse", objectResponse_.Text); - throw new SwaggerException("A server side error occurred.", status_, objectResponse_.Text, headers_, responseObject_); - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task AddXmlAsync(string person) - { - return AddXmlAsync(person, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task AddXmlAsync(string person, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Persons/AddXml"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(person); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/xml"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// A server side error occurred. - public virtual System.Threading.Tasks.Task UploadAsync(FileParameter data) - { - return UploadAsync(data, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public virtual async System.Threading.Tasks.Task UploadAsync(FileParameter data, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append("api/Persons/upload"); - - var client_ = new System.Net.Http.HttpClient(); - var disposeClient_ = true; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StreamContent(data.Data); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(data.ContentType); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - return objectResponse_.Object; - } - else - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new SwaggerException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - using (var streamReader = new System.IO.StreamReader(responseStream)) - using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) - { - var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings); - var typedBody = serializer.Deserialize(jsonTextReader); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new SwaggerException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value.GetType().IsArray) - { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.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(); - private readonly System.Collections.Generic.IDictionary _searchedNamespaces; - private readonly bool _hideStackTrace = false; - - public JsonExceptionConverter() - { - _searchedNamespaces = new System.Collections.Generic.Dictionary { { typeof(System.Exception).Namespace, System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(System.Exception)).Assembly } }; - } - - public override bool CanWrite => true; - - public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) - { - var exception = value as System.Exception; - if (exception != null) - { - var resolver = serializer.ContractResolver as Newtonsoft.Json.Serialization.DefaultContractResolver ?? _defaultContractResolver; - - var jObject = new Newtonsoft.Json.Linq.JObject(); - jObject.Add(resolver.GetResolvedPropertyName("discriminator"), exception.GetType().Name); - jObject.Add(resolver.GetResolvedPropertyName("Message"), exception.Message); - jObject.Add(resolver.GetResolvedPropertyName("StackTrace"), _hideStackTrace ? "HIDDEN" : exception.StackTrace); - jObject.Add(resolver.GetResolvedPropertyName("Source"), exception.Source); - jObject.Add(resolver.GetResolvedPropertyName("InnerException"), - exception.InnerException != null ? Newtonsoft.Json.Linq.JToken.FromObject(exception.InnerException, serializer) : null); - - foreach (var property in GetExceptionProperties(value.GetType())) - { - var propertyValue = property.Key.GetValue(exception); - if (propertyValue != null) - { - jObject.AddFirst(new Newtonsoft.Json.Linq.JProperty(resolver.GetResolvedPropertyName(property.Value), - Newtonsoft.Json.Linq.JToken.FromObject(propertyValue, serializer))); - } - } - - value = jObject; - } - - serializer.Serialize(writer, value); - } - - public override bool CanConvert(System.Type objectType) - { - return System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(System.Exception)).IsAssignableFrom(System.Reflection.IntrospectionExtensions.GetTypeInfo(objectType)); - } - - public override object ReadJson(Newtonsoft.Json.JsonReader reader, System.Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) - { - var jObject = serializer.Deserialize(reader); - if (jObject == null) - return null; - - var newSerializer = new Newtonsoft.Json.JsonSerializer(); - newSerializer.ContractResolver = (Newtonsoft.Json.Serialization.IContractResolver)System.Activator.CreateInstance(serializer.ContractResolver.GetType()); - - var field = GetField(typeof(Newtonsoft.Json.Serialization.DefaultContractResolver), "_sharedCache"); - if (field != null) - field.SetValue(newSerializer.ContractResolver, false); - - dynamic resolver = newSerializer.ContractResolver; - if (System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperty(newSerializer.ContractResolver.GetType(), "IgnoreSerializableAttribute") != null) - resolver.IgnoreSerializableAttribute = true; - if (System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperty(newSerializer.ContractResolver.GetType(), "IgnoreSerializableInterface") != null) - resolver.IgnoreSerializableInterface = true; - - Newtonsoft.Json.Linq.JToken token; - if (jObject.TryGetValue("discriminator", System.StringComparison.OrdinalIgnoreCase, out token)) - { - var discriminator = Newtonsoft.Json.Linq.Extensions.Value(token); - if (objectType.Name.Equals(discriminator) == false) - { - var exceptionType = System.Type.GetType("System." + discriminator, false); - if (exceptionType != null) - objectType = exceptionType; - else - { - foreach (var pair in _searchedNamespaces) - { - exceptionType = pair.Value.GetType(pair.Key + "." + discriminator); - if (exceptionType != null) - { - objectType = exceptionType; - break; - } - } - - } - } - } - - var value = jObject.ToObject(objectType, newSerializer); - foreach (var property in GetExceptionProperties(value.GetType())) - { - var jValue = jObject.GetValue(resolver.GetResolvedPropertyName(property.Value)); - var propertyValue = (object)jValue?.ToObject(property.Key.PropertyType); - if (property.Key.SetMethod != null) - property.Key.SetValue(value, propertyValue); - else - { - field = GetField(objectType, "m_" + property.Value.Substring(0, 1).ToLowerInvariant() + property.Value.Substring(1)); - if (field != null) - field.SetValue(value, propertyValue); - } - } - - SetExceptionFieldValue(jObject, "Message", value, "_message", resolver, newSerializer); - SetExceptionFieldValue(jObject, "StackTrace", value, "_stackTraceString", resolver, newSerializer); - SetExceptionFieldValue(jObject, "Source", value, "_source", resolver, newSerializer); - SetExceptionFieldValue(jObject, "InnerException", value, "_innerException", resolver, serializer); - - return value; - } - - private System.Reflection.FieldInfo GetField(System.Type type, string fieldName) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(type).GetDeclaredField(fieldName); - if (field == null && System.Reflection.IntrospectionExtensions.GetTypeInfo(type).BaseType != null) - return GetField(System.Reflection.IntrospectionExtensions.GetTypeInfo(type).BaseType, fieldName); - return field; - } - - private System.Collections.Generic.IDictionary GetExceptionProperties(System.Type exceptionType) - { - var result = new System.Collections.Generic.Dictionary(); - foreach (var property in System.Linq.Enumerable.Where(System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperties(exceptionType), - p => p.GetMethod?.IsPublic == true)) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(property); - var propertyName = attribute != null ? attribute.PropertyName : property.Name; - - if (!System.Linq.Enumerable.Contains(new[] { "Message", "StackTrace", "Source", "InnerException", "Data", "TargetSite", "HelpLink", "HResult" }, propertyName)) - result[property] = propertyName; - } - return result; - } - - private void SetExceptionFieldValue(Newtonsoft.Json.Linq.JObject jObject, string propertyName, object value, string fieldName, Newtonsoft.Json.Serialization.IContractResolver resolver, Newtonsoft.Json.JsonSerializer serializer) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(System.Exception)).GetDeclaredField(fieldName); - var jsonPropertyName = resolver is Newtonsoft.Json.Serialization.DefaultContractResolver ? ((Newtonsoft.Json.Serialization.DefaultContractResolver)resolver).GetResolvedPropertyName(propertyName) : propertyName; - var property = System.Linq.Enumerable.FirstOrDefault(jObject.Properties(), p => System.String.Equals(p.Name, jsonPropertyName, System.StringComparison.OrdinalIgnoreCase)); - if (property != null) - { - var fieldValue = property.Value.ToObject(field.FieldType, serializer); - field.SetValue(value, fieldValue); - } - } - } - -} - -#pragma warning restore 1591 -#pragma warning restore 1573 -#pragma warning restore 472 -#pragma warning restore 114 -#pragma warning restore 108 -#pragma warning restore 3016 \ No newline at end of file diff --git a/src/NSwag.Integration.Console/ServiceClientsContracts.cs b/src/NSwag.Integration.Console/ServiceClientsContracts.cs deleted file mode 100644 index 0f0378357f..0000000000 --- a/src/NSwag.Integration.Console/ServiceClientsContracts.cs +++ /dev/null @@ -1,402 +0,0 @@ -//---------------------- -// -// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- - -#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." -#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." -#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' -#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... -#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." -#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" -#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" - -namespace NSwag.Integration.Console.Contracts -{ - using System = global::System; - - - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class GeoPoint - { - [Newtonsoft.Json.JsonProperty("Latitude", Required = Newtonsoft.Json.Required.Always)] - public double Latitude { get; set; } - - [Newtonsoft.Json.JsonProperty("Longitude", Required = Newtonsoft.Json.Required.Always)] - public double Longitude { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class GenericRequestOfAddressAndPerson - { - [Newtonsoft.Json.JsonProperty("Item1", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Address Item1 { get; set; } - - [Newtonsoft.Json.JsonProperty("Item2", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Person Item2 { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Address - { - [Newtonsoft.Json.JsonProperty("IsPrimary", Required = Newtonsoft.Json.Required.Always)] - public bool IsPrimary { get; set; } - - [Newtonsoft.Json.JsonProperty("City", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string City { get; set; } - - } - - [Newtonsoft.Json.JsonConverter(typeof(JsonInheritanceConverter), "discriminator")] - [JsonInheritanceAttribute("Teacher", typeof(Teacher))] - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Person - { - [Newtonsoft.Json.JsonProperty("Id", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public System.Guid Id { get; set; } - - /// - /// Gets or sets the first name. - /// - [Newtonsoft.Json.JsonProperty("FirstName", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - [System.ComponentModel.DataAnnotations.StringLength(int.MaxValue, MinimumLength = 2)] - public string FirstName { get; set; } - - /// - /// Gets or sets the last name. - /// - [Newtonsoft.Json.JsonProperty("LastName", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public string LastName { get; set; } - - [Newtonsoft.Json.JsonProperty("Gender", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public Gender Gender { get; set; } - - [Newtonsoft.Json.JsonProperty("DateOfBirth", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public System.DateTime DateOfBirth { get; set; } - - [Newtonsoft.Json.JsonProperty("Weight", Required = Newtonsoft.Json.Required.Always)] - public decimal Weight { get; set; } - - [Newtonsoft.Json.JsonProperty("Height", Required = Newtonsoft.Json.Required.Always)] - public double Height { get; set; } - - [Newtonsoft.Json.JsonProperty("Age", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Range(5, 99)] - public int Age { get; set; } - - [Newtonsoft.Json.JsonProperty("AverageSleepTime", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public System.TimeSpan AverageSleepTime { get; set; } - - [Newtonsoft.Json.JsonProperty("Address", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public Address Address { get; set; } = new Address(); - - [Newtonsoft.Json.JsonProperty("Children", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public System.Collections.ObjectModel.ObservableCollection Children { get; set; } = new System.Collections.ObjectModel.ObservableCollection(); - - [Newtonsoft.Json.JsonProperty("Skills", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.Dictionary Skills { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public enum Gender - { - - [System.Runtime.Serialization.EnumMember(Value = @"Male")] - Male = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"Female")] - Female = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public enum SkillLevel - { - - Low = 0, - - Medium = 1, - - Height = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Teacher : Person - { - [Newtonsoft.Json.JsonProperty("Course", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Course { get; set; } - - [Newtonsoft.Json.JsonProperty("SkillLevel", Required = Newtonsoft.Json.Required.Always)] - public SkillLevel SkillLevel { get; set; } = NSwag.Integration.Console.Contracts.SkillLevel.Medium; - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - [Newtonsoft.Json.JsonObjectAttribute] - public partial class PersonNotFoundException : System.Exception - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public System.Guid Id { get; set; } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - [System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, AllowMultiple = true)] - internal class JsonInheritanceAttribute : System.Attribute - { - public JsonInheritanceAttribute(string key, System.Type type) - { - Key = key; - Type = type; - } - - public string Key { get; } - - public System.Type Type { get; } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - internal class JsonInheritanceConverter : Newtonsoft.Json.JsonConverter - { - internal static readonly string DefaultDiscriminatorName = "discriminator"; - - private readonly string _discriminatorName; - - [System.ThreadStatic] - private static bool _isReading; - - [System.ThreadStatic] - private static bool _isWriting; - - public JsonInheritanceConverter() - { - _discriminatorName = DefaultDiscriminatorName; - } - - public JsonInheritanceConverter(string discriminatorName) - { - _discriminatorName = discriminatorName; - } - - public string DiscriminatorName { get { return _discriminatorName; } } - - public override void WriteJson(Newtonsoft.Json.JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) - { - try - { - _isWriting = true; - - var jObject = Newtonsoft.Json.Linq.JObject.FromObject(value, serializer); - jObject.AddFirst(new Newtonsoft.Json.Linq.JProperty(_discriminatorName, GetSubtypeDiscriminator(value.GetType()))); - writer.WriteToken(jObject.CreateReader()); - } - finally - { - _isWriting = false; - } - } - - public override bool CanWrite - { - get - { - if (_isWriting) - { - _isWriting = false; - return false; - } - return true; - } - } - - public override bool CanRead - { - get - { - if (_isReading) - { - _isReading = false; - return false; - } - return true; - } - } - - public override bool CanConvert(System.Type objectType) - { - return true; - } - - public override object ReadJson(Newtonsoft.Json.JsonReader reader, System.Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) - { - var jObject = serializer.Deserialize(reader); - if (jObject == null) - return null; - - var discriminatorValue = jObject.GetValue(_discriminatorName); - var discriminator = discriminatorValue != null ? Newtonsoft.Json.Linq.Extensions.Value(discriminatorValue) : null; - var subtype = GetObjectSubtype(objectType, discriminator); - - var objectContract = serializer.ContractResolver.ResolveContract(subtype) as Newtonsoft.Json.Serialization.JsonObjectContract; - if (objectContract == null || System.Linq.Enumerable.All(objectContract.Properties, p => p.PropertyName != _discriminatorName)) - { - jObject.Remove(_discriminatorName); - } - - try - { - _isReading = true; - return serializer.Deserialize(jObject.CreateReader(), subtype); - } - finally - { - _isReading = false; - } - } - - private System.Type GetObjectSubtype(System.Type objectType, string discriminator) - { - foreach (var attribute in System.Reflection.CustomAttributeExtensions.GetCustomAttributes(System.Reflection.IntrospectionExtensions.GetTypeInfo(objectType), true)) - { - if (attribute.Key == discriminator) - return attribute.Type; - } - - return objectType; - } - - private string GetSubtypeDiscriminator(System.Type objectType) - { - foreach (var attribute in System.Reflection.CustomAttributeExtensions.GetCustomAttributes(System.Reflection.IntrospectionExtensions.GetTypeInfo(objectType), true)) - { - if (attribute.Type == objectType) - return attribute.Key; - } - - return objectType.Name; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class FileParameter - { - public FileParameter(System.IO.Stream data) - : this (data, null, null) - { - } - - public FileParameter(System.IO.Stream data, string fileName) - : this (data, fileName, null) - { - } - - public FileParameter(System.IO.Stream data, string fileName, string contentType) - { - Data = data; - FileName = fileName; - ContentType = contentType; - } - - public System.IO.Stream Data { get; private set; } - - public string FileName { get; private set; } - - public string ContentType { get; private set; } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class FileResponse : System.IDisposable - { - private System.IDisposable _client; - private System.IDisposable _response; - - public int StatusCode { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public System.IO.Stream Stream { get; private set; } - - public bool IsPartial - { - get { return StatusCode == 206; } - } - - public FileResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary> headers, System.IO.Stream stream, System.IDisposable client, System.IDisposable response) - { - StatusCode = statusCode; - Headers = headers; - Stream = stream; - _client = client; - _response = response; - } - - public void Dispose() - { - Stream.Dispose(); - if (_response != null) - _response.Dispose(); - if (_client != null) - _client.Dispose(); - } - } - - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class SwaggerException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public SwaggerException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class SwaggerException : SwaggerException - { - public TResult Result { get; private set; } - - public SwaggerException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - -} - -#pragma warning restore 1591 -#pragma warning restore 1573 -#pragma warning restore 472 -#pragma warning restore 114 -#pragma warning restore 108 -#pragma warning restore 3016 \ No newline at end of file diff --git a/src/NSwag.Integration.Tests/Issue807/input/IdentityModel.AspNetCore.OAuth2Introspection.dll b/src/NSwag.Integration.Tests/Issue807/input/IdentityModel.AspNetCore.OAuth2Introspection.dll deleted file mode 100644 index b399615beb..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/IdentityModel.AspNetCore.OAuth2Introspection.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/IdentityModel.AspNetCore.ScopeValidation.dll b/src/NSwag.Integration.Tests/Issue807/input/IdentityModel.AspNetCore.ScopeValidation.dll deleted file mode 100644 index 2c9f860374..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/IdentityModel.AspNetCore.ScopeValidation.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/IdentityModel.dll b/src/NSwag.Integration.Tests/Issue807/input/IdentityModel.dll deleted file mode 100644 index af7dc5e183..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/IdentityModel.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/IdentityServer4.AccessTokenValidation.dll b/src/NSwag.Integration.Tests/Issue807/input/IdentityServer4.AccessTokenValidation.dll deleted file mode 100644 index 658d9ff4f5..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/IdentityServer4.AccessTokenValidation.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.ApplicationInsights.AspNetCore.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.ApplicationInsights.AspNetCore.dll deleted file mode 100644 index 3ab053a5bf..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.ApplicationInsights.AspNetCore.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.ApplicationInsights.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.ApplicationInsights.dll deleted file mode 100644 index a77d18c0db..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.ApplicationInsights.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Antiforgery.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Antiforgery.dll deleted file mode 100644 index f2db44ac7c..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Antiforgery.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Authentication.JwtBearer.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Authentication.JwtBearer.dll deleted file mode 100644 index 2097d79012..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Authentication.JwtBearer.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Authentication.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Authentication.dll deleted file mode 100644 index bd5e09ca1c..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Authentication.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Authorization.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Authorization.dll deleted file mode 100644 index 8bec0e5276..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Authorization.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Cors.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Cors.dll deleted file mode 100644 index 87d85f0ea6..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Cors.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Cryptography.Internal.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Cryptography.Internal.dll deleted file mode 100644 index 0c009f8054..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Cryptography.Internal.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.DataProtection.Abstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.DataProtection.Abstractions.dll deleted file mode 100644 index 6eb66279f8..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.DataProtection.Abstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.DataProtection.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.DataProtection.dll deleted file mode 100644 index 8551fbe60f..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.DataProtection.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Diagnostics.Abstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Diagnostics.Abstractions.dll deleted file mode 100644 index f1ee48ef74..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Diagnostics.Abstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Diagnostics.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Diagnostics.dll deleted file mode 100644 index d269d80d3c..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Diagnostics.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Hosting.Abstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Hosting.Abstractions.dll deleted file mode 100644 index c1c848f424..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Hosting.Abstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Hosting.Server.Abstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Hosting.Server.Abstractions.dll deleted file mode 100644 index aad3ce46e5..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Hosting.Server.Abstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Hosting.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Hosting.dll deleted file mode 100644 index 15eb4b65db..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Hosting.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Html.Abstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Html.Abstractions.dll deleted file mode 100644 index e65b52553b..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Html.Abstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Http.Abstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Http.Abstractions.dll deleted file mode 100644 index 8a23ae9424..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Http.Abstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Http.Extensions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Http.Extensions.dll deleted file mode 100644 index 9887c2a9eb..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Http.Extensions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Http.Features.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Http.Features.dll deleted file mode 100644 index e3f09e0e7e..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Http.Features.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Http.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Http.dll deleted file mode 100644 index 3e4cfe9272..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Http.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.HttpOverrides.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.HttpOverrides.dll deleted file mode 100644 index be4a1d2da3..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.HttpOverrides.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.JsonPatch.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.JsonPatch.dll deleted file mode 100644 index f997b29756..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.JsonPatch.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Localization.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Localization.dll deleted file mode 100644 index 5934d20339..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Localization.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Abstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Abstractions.dll deleted file mode 100644 index a0b2a0c039..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Abstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.ApiExplorer.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.ApiExplorer.dll deleted file mode 100644 index 534ed87701..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.ApiExplorer.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Core.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Core.dll deleted file mode 100644 index d66a63c69f..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Core.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Cors.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Cors.dll deleted file mode 100644 index 8ebcc098fa..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Cors.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.DataAnnotations.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.DataAnnotations.dll deleted file mode 100644 index d0277ea77e..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.DataAnnotations.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Formatters.Json.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Formatters.Json.dll deleted file mode 100644 index 33945400d2..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Formatters.Json.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Localization.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Localization.dll deleted file mode 100644 index 9e2af6a970..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Localization.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Razor.Host.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Razor.Host.dll deleted file mode 100644 index f453cb3d24..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Razor.Host.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Razor.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Razor.dll deleted file mode 100644 index 8e71c038bc..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.Razor.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.TagHelpers.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.TagHelpers.dll deleted file mode 100644 index 8735687eeb..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.TagHelpers.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.ViewFeatures.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.ViewFeatures.dll deleted file mode 100644 index 59bf80672a..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.ViewFeatures.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.dll deleted file mode 100644 index 2e260a331b..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Mvc.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Razor.Runtime.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Razor.Runtime.dll deleted file mode 100644 index 551316bd51..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Razor.Runtime.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Razor.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Razor.dll deleted file mode 100644 index db7c4eea22..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Razor.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.ResponseCaching.Abstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.ResponseCaching.Abstractions.dll deleted file mode 100644 index 045b802142..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.ResponseCaching.Abstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Routing.Abstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Routing.Abstractions.dll deleted file mode 100644 index fe597a00bb..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Routing.Abstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Routing.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Routing.dll deleted file mode 100644 index 27e3e8f4ee..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Routing.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Server.IISIntegration.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Server.IISIntegration.dll deleted file mode 100644 index e9251c974e..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Server.IISIntegration.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Server.Kestrel.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Server.Kestrel.dll deleted file mode 100644 index 2e1fd1a43e..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.Server.Kestrel.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.StaticFiles.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.StaticFiles.dll deleted file mode 100644 index ad72fd27bb..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.StaticFiles.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.WebUtilities.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.WebUtilities.dll deleted file mode 100644 index daa18020e3..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.AspNetCore.WebUtilities.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.CodeAnalysis.CSharp.Workspaces.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.CodeAnalysis.CSharp.Workspaces.dll deleted file mode 100644 index b298496990..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.CodeAnalysis.CSharp.Workspaces.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.CodeAnalysis.Workspaces.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.CodeAnalysis.Workspaces.dll deleted file mode 100644 index db22606a4a..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.CodeAnalysis.Workspaces.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.DotNet.PlatformAbstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.DotNet.PlatformAbstractions.dll deleted file mode 100644 index 6dfe535fd5..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.DotNet.PlatformAbstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.Design.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.Design.dll deleted file mode 100644 index 512a5912fa..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.Design.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.Relational.Design.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.Relational.Design.dll deleted file mode 100644 index 3019afb1f5..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.Relational.Design.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.Relational.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.Relational.dll deleted file mode 100644 index b0d9f5950e..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.Relational.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.SqlServer.Design.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.SqlServer.Design.dll deleted file mode 100644 index a460999ccd..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.SqlServer.Design.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.SqlServer.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.SqlServer.dll deleted file mode 100644 index 5e9d1a0de2..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.SqlServer.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.dll deleted file mode 100644 index 7e69bd1931..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.EntityFrameworkCore.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Caching.Abstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Caching.Abstractions.dll deleted file mode 100644 index 5705f404a3..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Caching.Abstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Caching.Memory.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Caching.Memory.dll deleted file mode 100644 index ad621f631b..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Caching.Memory.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.CommandLineUtils.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.CommandLineUtils.dll deleted file mode 100644 index 658221fa99..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.CommandLineUtils.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.Abstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.Abstractions.dll deleted file mode 100644 index 0bf6058748..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.Abstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.Binder.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.Binder.dll deleted file mode 100644 index 07fb904870..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.Binder.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.EnvironmentVariables.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.EnvironmentVariables.dll deleted file mode 100644 index 487eb2fdd0..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.EnvironmentVariables.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.FileExtensions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.FileExtensions.dll deleted file mode 100644 index 85b236731b..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.FileExtensions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.Json.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.Json.dll deleted file mode 100644 index a5c6c2e475..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.Json.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.dll deleted file mode 100644 index 5a5641ef08..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Configuration.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.DependencyInjection.Abstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.DependencyInjection.Abstractions.dll deleted file mode 100644 index 475fd58df3..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.DependencyInjection.Abstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.DependencyInjection.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.DependencyInjection.dll deleted file mode 100644 index c807803e31..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.DependencyInjection.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.DependencyModel.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.DependencyModel.dll deleted file mode 100644 index 00fbc3a0b5..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.DependencyModel.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.DiagnosticAdapter.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.DiagnosticAdapter.dll deleted file mode 100644 index edaf534c0a..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.DiagnosticAdapter.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.FileProviders.Abstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.FileProviders.Abstractions.dll deleted file mode 100644 index 61e61c9a24..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.FileProviders.Abstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.FileProviders.Composite.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.FileProviders.Composite.dll deleted file mode 100644 index c225028b95..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.FileProviders.Composite.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.FileProviders.Embedded.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.FileProviders.Embedded.dll deleted file mode 100644 index 0a191b0be8..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.FileProviders.Embedded.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.FileProviders.Physical.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.FileProviders.Physical.dll deleted file mode 100644 index cd7ff5b4b5..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.FileProviders.Physical.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.FileSystemGlobbing.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.FileSystemGlobbing.dll deleted file mode 100644 index eb2ebf7203..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.FileSystemGlobbing.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Globalization.CultureInfoCache.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Globalization.CultureInfoCache.dll deleted file mode 100644 index 2585e495e2..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Globalization.CultureInfoCache.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Localization.Abstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Localization.Abstractions.dll deleted file mode 100644 index c535580e72..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Localization.Abstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Localization.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Localization.dll deleted file mode 100644 index dbcb0d478a..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Localization.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Logging.Abstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Logging.Abstractions.dll deleted file mode 100644 index 4aa58f9441..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Logging.Abstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Logging.Console.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Logging.Console.dll deleted file mode 100644 index bb604696dd..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Logging.Console.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Logging.Debug.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Logging.Debug.dll deleted file mode 100644 index f887851dd5..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Logging.Debug.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Logging.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Logging.dll deleted file mode 100644 index 95170675ed..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Logging.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.ObjectPool.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.ObjectPool.dll deleted file mode 100644 index 604adb220c..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.ObjectPool.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Options.ConfigurationExtensions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Options.ConfigurationExtensions.dll deleted file mode 100644 index 239f6d069c..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Options.ConfigurationExtensions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Options.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Options.dll deleted file mode 100644 index 8d8f7d3d8a..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Options.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.PlatformAbstractions.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.PlatformAbstractions.dll deleted file mode 100644 index 0b13c4795b..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.PlatformAbstractions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Primitives.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Primitives.dll deleted file mode 100644 index c88734ff0a..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.Primitives.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.WebEncoders.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.WebEncoders.dll deleted file mode 100644 index 67b20f8c82..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Extensions.WebEncoders.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.IdentityModel.Logging.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.IdentityModel.Logging.dll deleted file mode 100644 index 6e67633b9f..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.IdentityModel.Logging.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll deleted file mode 100644 index 1b842fe73d..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.IdentityModel.Protocols.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.IdentityModel.Protocols.dll deleted file mode 100644 index 3aaf345fc0..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.IdentityModel.Protocols.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.IdentityModel.Tokens.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.IdentityModel.Tokens.dll deleted file mode 100644 index 485752fb32..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.IdentityModel.Tokens.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Net.Http.Headers.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Net.Http.Headers.dll deleted file mode 100644 index cea6d85a7d..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.Net.Http.Headers.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.BrowserLink.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.BrowserLink.dll deleted file mode 100644 index e37e1f4b82..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.BrowserLink.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGeneration.Core.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGeneration.Core.dll deleted file mode 100644 index 4ce32c1003..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGeneration.Core.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore.dll deleted file mode 100644 index e4b4c66edd..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGeneration.Templating.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGeneration.Templating.dll deleted file mode 100644 index ba7e019027..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGeneration.Templating.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGeneration.Utils.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGeneration.Utils.dll deleted file mode 100644 index d3379bbfc2..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGeneration.Utils.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGeneration.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGeneration.dll deleted file mode 100644 index ff645c9faf..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGeneration.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGenerators.Mvc.dll b/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGenerators.Mvc.dll deleted file mode 100644 index f3e8081c95..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Microsoft.VisualStudio.Web.CodeGenerators.Mvc.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/NLog.Extensions.Logging.dll b/src/NSwag.Integration.Tests/Issue807/input/NLog.Extensions.Logging.dll deleted file mode 100644 index 2dc0b4d499..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/NLog.Extensions.Logging.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/NLog.dll b/src/NSwag.Integration.Tests/Issue807/input/NLog.dll deleted file mode 100644 index 873014c175..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/NLog.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Newtonsoft.Json.dll b/src/NSwag.Integration.Tests/Issue807/input/Newtonsoft.Json.dll deleted file mode 100644 index 5f2336e6c2..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Newtonsoft.Json.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/NuGet.Frameworks.dll b/src/NSwag.Integration.Tests/Issue807/input/NuGet.Frameworks.dll deleted file mode 100644 index 7b6fb65054..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/NuGet.Frameworks.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Remotion.Linq.dll b/src/NSwag.Integration.Tests/Issue807/input/Remotion.Linq.dll deleted file mode 100644 index 02636737e7..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Remotion.Linq.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Swashbuckle.AspNetCore.Swagger.dll b/src/NSwag.Integration.Tests/Issue807/input/Swashbuckle.AspNetCore.Swagger.dll deleted file mode 100644 index 251497798b..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Swashbuckle.AspNetCore.Swagger.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Swashbuckle.AspNetCore.SwaggerGen.dll b/src/NSwag.Integration.Tests/Issue807/input/Swashbuckle.AspNetCore.SwaggerGen.dll deleted file mode 100644 index 48b28a58c8..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Swashbuckle.AspNetCore.SwaggerGen.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Swashbuckle.AspNetCore.SwaggerUI.dll b/src/NSwag.Integration.Tests/Issue807/input/Swashbuckle.AspNetCore.SwaggerUI.dll deleted file mode 100644 index 6f729082e7..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Swashbuckle.AspNetCore.SwaggerUI.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/Swashbuckle.AspNetCore.dll b/src/NSwag.Integration.Tests/Issue807/input/Swashbuckle.AspNetCore.dll deleted file mode 100644 index 4c29478f65..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/Swashbuckle.AspNetCore.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.Collections.NonGeneric.dll b/src/NSwag.Integration.Tests/Issue807/input/System.Collections.NonGeneric.dll deleted file mode 100644 index 92fc8f20ed..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.Collections.NonGeneric.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.Collections.Specialized.dll b/src/NSwag.Integration.Tests/Issue807/input/System.Collections.Specialized.dll deleted file mode 100644 index a1323642b9..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.Collections.Specialized.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.ComponentModel.Primitives.dll b/src/NSwag.Integration.Tests/Issue807/input/System.ComponentModel.Primitives.dll deleted file mode 100644 index 44bdd096e6..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.ComponentModel.Primitives.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.ComponentModel.TypeConverter.dll b/src/NSwag.Integration.Tests/Issue807/input/System.ComponentModel.TypeConverter.dll deleted file mode 100644 index 82463bec44..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.ComponentModel.TypeConverter.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.Composition.AttributedModel.dll b/src/NSwag.Integration.Tests/Issue807/input/System.Composition.AttributedModel.dll deleted file mode 100644 index af0aa13f37..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.Composition.AttributedModel.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.Composition.Convention.dll b/src/NSwag.Integration.Tests/Issue807/input/System.Composition.Convention.dll deleted file mode 100644 index 108179cf3a..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.Composition.Convention.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.Composition.Hosting.dll b/src/NSwag.Integration.Tests/Issue807/input/System.Composition.Hosting.dll deleted file mode 100644 index 2b25a90cdb..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.Composition.Hosting.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.Composition.Runtime.dll b/src/NSwag.Integration.Tests/Issue807/input/System.Composition.Runtime.dll deleted file mode 100644 index 660ac75ae4..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.Composition.Runtime.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.Composition.TypedParts.dll b/src/NSwag.Integration.Tests/Issue807/input/System.Composition.TypedParts.dll deleted file mode 100644 index 4435eaabdf..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.Composition.TypedParts.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.Data.Common.dll b/src/NSwag.Integration.Tests/Issue807/input/System.Data.Common.dll deleted file mode 100644 index e9eeed49de..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.Data.Common.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.Diagnostics.Contracts.dll b/src/NSwag.Integration.Tests/Issue807/input/System.Diagnostics.Contracts.dll deleted file mode 100644 index dabbc7181b..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.Diagnostics.Contracts.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.Diagnostics.StackTrace.dll b/src/NSwag.Integration.Tests/Issue807/input/System.Diagnostics.StackTrace.dll deleted file mode 100644 index 15ef090971..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.Diagnostics.StackTrace.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.IdentityModel.Tokens.Jwt.dll b/src/NSwag.Integration.Tests/Issue807/input/System.IdentityModel.Tokens.Jwt.dll deleted file mode 100644 index eab700da5d..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.IdentityModel.Tokens.Jwt.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.Interactive.Async.dll b/src/NSwag.Integration.Tests/Issue807/input/System.Interactive.Async.dll deleted file mode 100644 index 44e4554107..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.Interactive.Async.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.Net.WebSockets.dll b/src/NSwag.Integration.Tests/Issue807/input/System.Net.WebSockets.dll deleted file mode 100644 index 5cab71f346..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.Net.WebSockets.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.Runtime.CompilerServices.Unsafe.dll b/src/NSwag.Integration.Tests/Issue807/input/System.Runtime.CompilerServices.Unsafe.dll deleted file mode 100644 index 62896561bc..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.Runtime.CompilerServices.Unsafe.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.Runtime.Serialization.Primitives.dll b/src/NSwag.Integration.Tests/Issue807/input/System.Runtime.Serialization.Primitives.dll deleted file mode 100644 index 5f6ecb46be..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.Runtime.Serialization.Primitives.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.Text.Encodings.Web.dll b/src/NSwag.Integration.Tests/Issue807/input/System.Text.Encodings.Web.dll deleted file mode 100644 index eac443d0d1..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.Text.Encodings.Web.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/System.ValueTuple.dll b/src/NSwag.Integration.Tests/Issue807/input/System.ValueTuple.dll deleted file mode 100644 index 4b8f102eef..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/System.ValueTuple.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/WebApplication1.deps.json b/src/NSwag.Integration.Tests/Issue807/input/WebApplication1.deps.json deleted file mode 100644 index 61e99b88bc..0000000000 --- a/src/NSwag.Integration.Tests/Issue807/input/WebApplication1.deps.json +++ /dev/null @@ -1,5681 +0,0 @@ -{ - "runtimeTarget": { - "name": ".NETCoreApp,Version=v1.1", - "signature": "1fcdcc2fb47a74bfd11314727a191b097d692451" - }, - "compilationOptions": { - "defines": [ - "TRACE", - "RELEASE", - "NETCOREAPP1_1" - ], - "languageVersion": "", - "platform": "", - "allowUnsafe": false, - "warningsAsErrors": false, - "optimize": true, - "keyFile": "", - "emitEntryPoint": true, - "xmlDoc": false, - "debugType": "portable" - }, - "targets": { - ".NETCoreApp,Version=v1.1": { - "webapplication1/1.0.0": { - "dependencies": { - "IdentityServer4.AccessTokenValidation": "1.2.1", - "Microsoft.ApplicationInsights.AspNetCore": "2.0.1", - "Microsoft.AspNetCore": "1.1.2", - "Microsoft.AspNetCore.Authentication.JwtBearer": "1.1.2", - "Microsoft.AspNetCore.Mvc": "1.1.3", - "Microsoft.AspNetCore.Mvc.Cors": "1.1.3", - "Microsoft.AspNetCore.Mvc.Formatters.Json": "1.1.3", - "Microsoft.AspNetCore.Server.IISIntegration": "1.1.2", - "Microsoft.AspNetCore.StaticFiles": "1.1.2", - "Microsoft.EntityFrameworkCore": "1.1.2", - "Microsoft.EntityFrameworkCore.Design": "1.1.2", - "Microsoft.EntityFrameworkCore.SqlServer": "1.1.2", - "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.2", - "Microsoft.EntityFrameworkCore.Tools": "1.1.1", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.2", - "Microsoft.Extensions.Configuration.FileExtensions": "1.1.2", - "Microsoft.Extensions.Configuration.Json": "1.1.2", - "Microsoft.Extensions.Logging": "1.1.2", - "Microsoft.Extensions.Logging.Console": "1.1.2", - "Microsoft.Extensions.Logging.Debug": "1.1.2", - "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.2", - "Microsoft.NETCore.App": "1.1.2", - "Microsoft.VisualStudio.Web.BrowserLink": "1.1.2", - "Microsoft.VisualStudio.Web.CodeGeneration.Design": "1.1.1", - "NLog.Extensions.Logging": "1.0.0-rtm-beta5", - "Swashbuckle.AspNetCore": "1.0.0" - }, - "runtime": { - "WebApplication1.dll": {} - }, - "compile": { - "WebApplication1.dll": {} - } - }, - "identitymodel/2.8.1": { - "dependencies": { - "NETStandard.Library": "1.6.1", - "Newtonsoft.Json": "9.0.1", - "System.Net.Http": "4.3.2", - "System.Security.Claims": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.X509Certificates": "4.3.0", - "System.ValueTuple": "4.3.1" - }, - "runtime": { - "lib/netstandard1.4/IdentityModel.dll": {} - }, - "compile": { - "lib/netstandard1.4/IdentityModel.dll": {} - } - }, - "identitymodel.aspnetcore.oauth2introspection/2.1.1": { - "dependencies": { - "IdentityModel": "2.8.1", - "Microsoft.AspNetCore.Authentication": "1.1.2", - "Microsoft.AspNetCore.Http.Abstractions": "1.1.2", - "Microsoft.Extensions.Caching.Memory": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.4/IdentityModel.AspNetCore.OAuth2Introspection.dll": {} - }, - "compile": { - "lib/netstandard1.4/IdentityModel.AspNetCore.OAuth2Introspection.dll": {} - } - }, - "identitymodel.aspnetcore.scopevalidation/1.1.1": { - "dependencies": { - "Microsoft.AspNetCore.Http.Abstractions": "1.1.2", - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/IdentityModel.AspNetCore.ScopeValidation.dll": {} - }, - "compile": { - "lib/netstandard1.3/IdentityModel.AspNetCore.ScopeValidation.dll": {} - } - }, - "identityserver4.accesstokenvalidation/1.2.1": { - "dependencies": { - "IdentityModel": "2.8.1", - "IdentityModel.AspNetCore.OAuth2Introspection": "2.1.1", - "IdentityModel.AspNetCore.ScopeValidation": "1.1.1", - "Microsoft.AspNetCore.Authentication.JwtBearer": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.IdentityModel.Tokens.Jwt": "5.1.3" - }, - "runtime": { - "lib/netstandard1.4/IdentityServer4.AccessTokenValidation.dll": {} - }, - "compile": { - "lib/netstandard1.4/IdentityServer4.AccessTokenValidation.dll": {} - } - }, - "microsoft.applicationinsights/2.2.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.Tools": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.IO.Compression": "4.3.0", - "System.Linq": "4.3.0", - "System.Net.Http": "4.3.2", - "System.Reflection": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Text.Encoding.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "System.Xml.XDocument": "4.3.0" - }, - "runtime": { - "lib/netstandard1.5/Microsoft.ApplicationInsights.dll": {} - }, - "compile": { - "lib/netstandard1.5/Microsoft.ApplicationInsights.dll": {} - } - }, - "microsoft.applicationinsights.aspnetcore/2.0.1": { - "dependencies": { - "Microsoft.ApplicationInsights": "2.2.0", - "Microsoft.AspNetCore.Hosting": "1.1.2", - "Microsoft.Extensions.Configuration": "1.1.2", - "Microsoft.Extensions.Configuration.Json": "1.1.2", - "Microsoft.Extensions.DiagnosticAdapter": "1.0.0", - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.Net.NameResolution": "4.3.0" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll": {} - } - }, - "microsoft.aspnetcore/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Diagnostics": "1.1.2", - "Microsoft.AspNetCore.Hosting": "1.1.2", - "Microsoft.AspNetCore.Routing": "1.1.2", - "Microsoft.AspNetCore.Server.IISIntegration": "1.1.2", - "Microsoft.AspNetCore.Server.Kestrel": "1.1.2", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.2", - "Microsoft.Extensions.Configuration.FileExtensions": "1.1.2", - "Microsoft.Extensions.Configuration.Json": "1.1.2", - "Microsoft.Extensions.Logging": "1.1.2", - "Microsoft.Extensions.Logging.Console": "1.1.2", - "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.2", - "NETStandard.Library": "1.6.1" - } - }, - "microsoft.aspnetcore.antiforgery/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.DataProtection": "1.1.2", - "Microsoft.AspNetCore.Http.Abstractions": "1.1.2", - "Microsoft.AspNetCore.Http.Extensions": "1.1.2", - "Microsoft.AspNetCore.WebUtilities": "1.1.2", - "Microsoft.Extensions.ObjectPool": "1.1.1", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Antiforgery.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Antiforgery.dll": {} - } - }, - "microsoft.aspnetcore.authentication/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.DataProtection": "1.1.2", - "Microsoft.AspNetCore.Http": "1.1.2", - "Microsoft.AspNetCore.Http.Extensions": "1.1.2", - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "Microsoft.Extensions.Options": "1.1.2", - "Microsoft.Extensions.WebEncoders": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Authentication.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Authentication.dll": {} - } - }, - "microsoft.aspnetcore.authentication.jwtbearer/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Authentication": "1.1.2", - "Microsoft.IdentityModel.Protocols.OpenIdConnect": "2.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.4/Microsoft.AspNetCore.Authentication.JwtBearer.dll": {} - }, - "compile": { - "lib/netstandard1.4/Microsoft.AspNetCore.Authentication.JwtBearer.dll": {} - } - }, - "microsoft.aspnetcore.authorization/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "Microsoft.Extensions.Options": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.Security.Claims": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Authorization.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Authorization.dll": {} - } - }, - "microsoft.aspnetcore.cors/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Http.Extensions": "1.1.2", - "Microsoft.Extensions.Configuration.Abstractions": "1.1.2", - "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.1", - "Microsoft.Extensions.Options": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Cors.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Cors.dll": {} - } - }, - "microsoft.aspnetcore.cryptography.internal/1.1.2": { - "dependencies": { - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Cryptography.Internal.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Cryptography.Internal.dll": {} - } - }, - "microsoft.aspnetcore.dataprotection/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Cryptography.Internal": "1.1.2", - "Microsoft.AspNetCore.DataProtection.Abstractions": "1.1.2", - "Microsoft.AspNetCore.Hosting.Abstractions": "1.1.2", - "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.1", - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "Microsoft.Extensions.Options": "1.1.2", - "Microsoft.Win32.Registry": "4.3.0", - "NETStandard.Library": "1.6.1", - "System.Security.Claims": "4.3.0", - "System.Security.Principal.Windows": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.DataProtection.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.DataProtection.dll": {} - } - }, - "microsoft.aspnetcore.dataprotection.abstractions/1.1.2": { - "dependencies": { - "NETStandard.Library": "1.6.1", - "System.ComponentModel": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.DataProtection.Abstractions.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.DataProtection.Abstractions.dll": {} - } - }, - "microsoft.aspnetcore.diagnostics/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Diagnostics.Abstractions": "1.1.2", - "Microsoft.AspNetCore.Hosting.Abstractions": "1.1.2", - "Microsoft.AspNetCore.Http.Extensions": "1.1.2", - "Microsoft.AspNetCore.WebUtilities": "1.1.2", - "Microsoft.Extensions.FileProviders.Physical": "1.1.1", - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "Microsoft.Extensions.Options": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.Diagnostics.DiagnosticSource": "4.3.1", - "System.Diagnostics.StackTrace": "4.3.0", - "System.Reflection.Metadata": "1.4.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Diagnostics.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Diagnostics.dll": {} - } - }, - "microsoft.aspnetcore.diagnostics.abstractions/1.1.2": { - "dependencies": { - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.0/Microsoft.AspNetCore.Diagnostics.Abstractions.dll": {} - }, - "compile": { - "lib/netstandard1.0/Microsoft.AspNetCore.Diagnostics.Abstractions.dll": {} - } - }, - "microsoft.aspnetcore.hosting/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Hosting.Abstractions": "1.1.2", - "Microsoft.AspNetCore.Hosting.Server.Abstractions": "1.1.2", - "Microsoft.AspNetCore.Http": "1.1.2", - "Microsoft.AspNetCore.Http.Extensions": "1.1.2", - "Microsoft.Extensions.Configuration": "1.1.2", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.2", - "Microsoft.Extensions.DependencyInjection": "1.1.1", - "Microsoft.Extensions.FileProviders.Physical": "1.1.1", - "Microsoft.Extensions.Logging": "1.1.2", - "Microsoft.Extensions.Options": "1.1.2", - "Microsoft.Extensions.PlatformAbstractions": "1.1.0", - "NETStandard.Library": "1.6.1", - "System.Diagnostics.DiagnosticSource": "4.3.1", - "System.Diagnostics.StackTrace": "4.3.0", - "System.Reflection.Metadata": "1.4.1", - "System.Runtime.Loader": "4.3.0" - }, - "runtime": { - "lib/netstandard1.5/Microsoft.AspNetCore.Hosting.dll": {} - }, - "compile": { - "lib/netstandard1.5/Microsoft.AspNetCore.Hosting.dll": {} - } - }, - "microsoft.aspnetcore.hosting.abstractions/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Hosting.Server.Abstractions": "1.1.2", - "Microsoft.AspNetCore.Http.Abstractions": "1.1.2", - "Microsoft.Extensions.Configuration.Abstractions": "1.1.2", - "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.1", - "Microsoft.Extensions.FileProviders.Abstractions": "1.1.1", - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Hosting.Abstractions.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Hosting.Abstractions.dll": {} - } - }, - "microsoft.aspnetcore.hosting.server.abstractions/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Http.Features": "1.1.2", - "Microsoft.Extensions.Configuration.Abstractions": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Hosting.Server.Abstractions.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Hosting.Server.Abstractions.dll": {} - } - }, - "microsoft.aspnetcore.html.abstractions/1.1.2": { - "dependencies": { - "NETStandard.Library": "1.6.1", - "System.Text.Encodings.Web": "4.3.1" - }, - "runtime": { - "lib/netstandard1.0/Microsoft.AspNetCore.Html.Abstractions.dll": {} - }, - "compile": { - "lib/netstandard1.0/Microsoft.AspNetCore.Html.Abstractions.dll": {} - } - }, - "microsoft.aspnetcore.http/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Http.Abstractions": "1.1.2", - "Microsoft.AspNetCore.WebUtilities": "1.1.2", - "Microsoft.Extensions.ObjectPool": "1.1.1", - "Microsoft.Extensions.Options": "1.1.2", - "Microsoft.Net.Http.Headers": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.Buffers": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Http.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Http.dll": {} - } - }, - "microsoft.aspnetcore.http.abstractions/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Http.Features": "1.1.2", - "Microsoft.Extensions.Primitives": "1.1.1", - "NETStandard.Library": "1.6.1", - "System.Globalization.Extensions": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Text.Encodings.Web": "4.3.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Http.Abstractions.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Http.Abstractions.dll": {} - } - }, - "microsoft.aspnetcore.http.extensions/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Http.Abstractions": "1.1.2", - "Microsoft.Extensions.FileProviders.Abstractions": "1.1.1", - "Microsoft.Net.Http.Headers": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.Buffers": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Http.Extensions.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Http.Extensions.dll": {} - } - }, - "microsoft.aspnetcore.http.features/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Primitives": "1.1.1", - "NETStandard.Library": "1.6.1", - "System.ComponentModel": "4.3.0", - "System.Net.WebSockets": "4.3.0", - "System.Security.Claims": "4.3.0", - "System.Security.Principal": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Http.Features.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Http.Features.dll": {} - } - }, - "microsoft.aspnetcore.httpoverrides/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Http.Extensions": "1.1.2", - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "Microsoft.Extensions.Options": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.HttpOverrides.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.HttpOverrides.dll": {} - } - }, - "microsoft.aspnetcore.jsonpatch/1.1.2": { - "dependencies": { - "Microsoft.CSharp": "4.3.0", - "NETStandard.Library": "1.6.1", - "Newtonsoft.Json": "9.0.1", - "System.Reflection.TypeExtensions": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.JsonPatch.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.JsonPatch.dll": {} - } - }, - "microsoft.aspnetcore.localization/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Http.Extensions": "1.1.2", - "Microsoft.Extensions.Globalization.CultureInfoCache": "1.1.2", - "Microsoft.Extensions.Localization.Abstractions": "1.1.2", - "Microsoft.Extensions.Options": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Localization.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Localization.dll": {} - } - }, - "microsoft.aspnetcore.mvc/1.1.3": { - "dependencies": { - "Microsoft.AspNetCore.Mvc.ApiExplorer": "1.1.3", - "Microsoft.AspNetCore.Mvc.Cors": "1.1.3", - "Microsoft.AspNetCore.Mvc.DataAnnotations": "1.1.3", - "Microsoft.AspNetCore.Mvc.Formatters.Json": "1.1.3", - "Microsoft.AspNetCore.Mvc.Localization": "1.1.3", - "Microsoft.AspNetCore.Mvc.Razor": "1.1.3", - "Microsoft.AspNetCore.Mvc.TagHelpers": "1.1.3", - "Microsoft.AspNetCore.Mvc.ViewFeatures": "1.1.3", - "Microsoft.Extensions.Caching.Memory": "1.1.2", - "Microsoft.Extensions.DependencyInjection": "1.1.1", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.dll": {} - } - }, - "microsoft.aspnetcore.mvc.abstractions/1.1.3": { - "dependencies": { - "Microsoft.AspNetCore.Routing.Abstractions": "1.1.2", - "Microsoft.CSharp": "4.3.0", - "Microsoft.Net.Http.Headers": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.ComponentModel.TypeConverter": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Mvc.Abstractions.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Mvc.Abstractions.dll": {} - } - }, - "microsoft.aspnetcore.mvc.apiexplorer/1.1.3": { - "dependencies": { - "Microsoft.AspNetCore.Mvc.Core": "1.1.3", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.ApiExplorer.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.ApiExplorer.dll": {} - } - }, - "microsoft.aspnetcore.mvc.core/1.1.3": { - "dependencies": { - "Microsoft.AspNetCore.Authorization": "1.1.2", - "Microsoft.AspNetCore.Hosting.Abstractions": "1.1.2", - "Microsoft.AspNetCore.Http": "1.1.2", - "Microsoft.AspNetCore.Mvc.Abstractions": "1.1.3", - "Microsoft.AspNetCore.ResponseCaching.Abstractions": "1.1.2", - "Microsoft.AspNetCore.Routing": "1.1.2", - "Microsoft.Extensions.DependencyModel": "1.1.2", - "Microsoft.Extensions.FileProviders.Abstractions": "1.1.1", - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "Microsoft.Extensions.PlatformAbstractions": "1.1.0", - "NETStandard.Library": "1.6.1", - "System.Buffers": "4.3.0", - "System.Diagnostics.DiagnosticSource": "4.3.1" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Core.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Core.dll": {} - } - }, - "microsoft.aspnetcore.mvc.cors/1.1.3": { - "dependencies": { - "Microsoft.AspNetCore.Cors": "1.1.2", - "Microsoft.AspNetCore.Mvc.Core": "1.1.3", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Cors.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Cors.dll": {} - } - }, - "microsoft.aspnetcore.mvc.dataannotations/1.1.3": { - "dependencies": { - "Microsoft.AspNetCore.Mvc.Core": "1.1.3", - "Microsoft.Extensions.Localization": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.ComponentModel.Annotations": "4.3.0" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.DataAnnotations.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.DataAnnotations.dll": {} - } - }, - "microsoft.aspnetcore.mvc.formatters.json/1.1.3": { - "dependencies": { - "Microsoft.AspNetCore.JsonPatch": "1.1.2", - "Microsoft.AspNetCore.Mvc.Core": "1.1.3", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Formatters.Json.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Formatters.Json.dll": {} - } - }, - "microsoft.aspnetcore.mvc.localization/1.1.3": { - "dependencies": { - "Microsoft.AspNetCore.Localization": "1.1.2", - "Microsoft.AspNetCore.Mvc.Razor": "1.1.3", - "Microsoft.Extensions.DependencyInjection": "1.1.1", - "Microsoft.Extensions.Localization": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Localization.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Localization.dll": {} - } - }, - "microsoft.aspnetcore.mvc.razor/1.1.3": { - "dependencies": { - "Microsoft.AspNetCore.Mvc.Razor.Host": "1.1.3", - "Microsoft.AspNetCore.Mvc.ViewFeatures": "1.1.3", - "Microsoft.CodeAnalysis.CSharp": "1.3.0", - "Microsoft.Extensions.FileProviders.Composite": "1.1.1", - "NETStandard.Library": "1.6.1", - "System.Runtime.Loader": "4.3.0" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Razor.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Razor.dll": {} - } - }, - "microsoft.aspnetcore.mvc.razor.host/1.1.3": { - "dependencies": { - "Microsoft.AspNetCore.Razor.Runtime": "1.1.2", - "Microsoft.Extensions.Caching.Memory": "1.1.2", - "Microsoft.Extensions.FileProviders.Physical": "1.1.1", - "NETStandard.Library": "1.6.1", - "System.ComponentModel.TypeConverter": "4.3.0" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Razor.Host.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.Razor.Host.dll": {} - } - }, - "microsoft.aspnetcore.mvc.taghelpers/1.1.3": { - "dependencies": { - "Microsoft.AspNetCore.Mvc.Razor": "1.1.3", - "Microsoft.AspNetCore.Routing.Abstractions": "1.1.2", - "Microsoft.Extensions.Caching.Memory": "1.1.2", - "Microsoft.Extensions.FileSystemGlobbing": "1.1.1", - "Microsoft.Extensions.Primitives": "1.1.1", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.TagHelpers.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.TagHelpers.dll": {} - } - }, - "microsoft.aspnetcore.mvc.viewfeatures/1.1.3": { - "dependencies": { - "Microsoft.AspNetCore.Antiforgery": "1.1.2", - "Microsoft.AspNetCore.Diagnostics.Abstractions": "1.1.2", - "Microsoft.AspNetCore.Html.Abstractions": "1.1.2", - "Microsoft.AspNetCore.Mvc.Core": "1.1.3", - "Microsoft.AspNetCore.Mvc.DataAnnotations": "1.1.3", - "Microsoft.AspNetCore.Mvc.Formatters.Json": "1.1.3", - "Microsoft.Extensions.WebEncoders": "1.1.2", - "NETStandard.Library": "1.6.1", - "Newtonsoft.Json": "9.0.1", - "System.Buffers": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.ViewFeatures.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.AspNetCore.Mvc.ViewFeatures.dll": {} - } - }, - "microsoft.aspnetcore.razor/1.1.2": { - "dependencies": { - "NETStandard.Library": "1.6.1", - "System.Threading.Thread": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Razor.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Razor.dll": {} - } - }, - "microsoft.aspnetcore.razor.runtime/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Html.Abstractions": "1.1.2", - "Microsoft.AspNetCore.Razor": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.Reflection.TypeExtensions": "4.3.0" - }, - "runtime": { - "lib/netstandard1.5/Microsoft.AspNetCore.Razor.Runtime.dll": {} - }, - "compile": { - "lib/netstandard1.5/Microsoft.AspNetCore.Razor.Runtime.dll": {} - } - }, - "microsoft.aspnetcore.responsecaching.abstractions/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Primitives": "1.1.1", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.ResponseCaching.Abstractions.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.ResponseCaching.Abstractions.dll": {} - } - }, - "microsoft.aspnetcore.routing/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Http.Extensions": "1.1.2", - "Microsoft.AspNetCore.Routing.Abstractions": "1.1.2", - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "Microsoft.Extensions.ObjectPool": "1.1.1", - "Microsoft.Extensions.Options": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Routing.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Routing.dll": {} - } - }, - "microsoft.aspnetcore.routing.abstractions/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Http.Abstractions": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Routing.Abstractions.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Routing.Abstractions.dll": {} - } - }, - "microsoft.aspnetcore.server.iisintegration/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Hosting.Abstractions": "1.1.2", - "Microsoft.AspNetCore.Http": "1.1.2", - "Microsoft.AspNetCore.Http.Extensions": "1.1.2", - "Microsoft.AspNetCore.HttpOverrides": "1.1.2", - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "Microsoft.Extensions.Options": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.Security.Principal.Windows": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Server.IISIntegration.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Server.IISIntegration.dll": {} - } - }, - "microsoft.aspnetcore.server.kestrel/1.1.2": { - "dependencies": { - "Libuv": "1.9.1", - "Microsoft.AspNetCore.Hosting": "1.1.2", - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.Buffers": "4.3.0", - "System.Numerics.Vectors": "4.3.0", - "System.Threading.Tasks.Extensions": "4.3.0", - "System.Threading.Thread": "4.3.0", - "System.Threading.ThreadPool": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.Server.Kestrel.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.Server.Kestrel.dll": {} - } - }, - "microsoft.aspnetcore.staticfiles/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Hosting.Abstractions": "1.1.2", - "Microsoft.AspNetCore.Http.Extensions": "1.1.2", - "Microsoft.Extensions.FileProviders.Abstractions": "1.1.1", - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "Microsoft.Extensions.WebEncoders": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.StaticFiles.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.StaticFiles.dll": {} - } - }, - "microsoft.aspnetcore.webutilities/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Primitives": "1.1.1", - "Microsoft.Net.Http.Headers": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.Buffers": "4.3.0", - "System.Text.Encodings.Web": "4.3.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.AspNetCore.WebUtilities.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.AspNetCore.WebUtilities.dll": {} - } - }, - "microsoft.codeanalysis.csharp.workspaces/1.3.0": { - "dependencies": { - "Microsoft.CodeAnalysis.CSharp": "1.3.0", - "Microsoft.CodeAnalysis.Workspaces.Common": "1.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.CodeAnalysis.CSharp.Workspaces.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.CodeAnalysis.CSharp.Workspaces.dll": {} - } - }, - "microsoft.codeanalysis.workspaces.common/1.3.0": { - "dependencies": { - "Microsoft.CodeAnalysis.Common": "1.3.0", - "Microsoft.Composition": "1.0.27" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.CodeAnalysis.Workspaces.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.CodeAnalysis.Workspaces.dll": {} - } - }, - "microsoft.composition/1.0.27": { - "runtime": { - "lib/portable-net45+win8+wp8+wpa81/System.Composition.AttributedModel.dll": {}, - "lib/portable-net45+win8+wp8+wpa81/System.Composition.Convention.dll": {}, - "lib/portable-net45+win8+wp8+wpa81/System.Composition.Hosting.dll": {}, - "lib/portable-net45+win8+wp8+wpa81/System.Composition.Runtime.dll": {}, - "lib/portable-net45+win8+wp8+wpa81/System.Composition.TypedParts.dll": {} - }, - "compile": { - "lib/portable-net45+win8+wp8+wpa81/System.Composition.AttributedModel.dll": {}, - "lib/portable-net45+win8+wp8+wpa81/System.Composition.Convention.dll": {}, - "lib/portable-net45+win8+wp8+wpa81/System.Composition.Hosting.dll": {}, - "lib/portable-net45+win8+wp8+wpa81/System.Composition.Runtime.dll": {}, - "lib/portable-net45+win8+wp8+wpa81/System.Composition.TypedParts.dll": {} - } - }, - "microsoft.dotnet.platformabstractions/1.1.2": { - "dependencies": { - "System.AppContext": "4.3.0", - "System.Collections": "4.3.0", - "System.IO": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.InteropServices.RuntimeInformation": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.DotNet.PlatformAbstractions.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.DotNet.PlatformAbstractions.dll": {} - } - }, - "microsoft.entityframeworkcore/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Caching.Memory": "1.1.2", - "Microsoft.Extensions.DependencyInjection": "1.1.1", - "Microsoft.Extensions.Logging": "1.1.2", - "NETStandard.Library": "1.6.1", - "Remotion.Linq": "2.1.1", - "System.Collections.Immutable": "1.3.0", - "System.ComponentModel.Annotations": "4.3.0", - "System.Interactive.Async": "3.0.0", - "System.Linq.Queryable": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.EntityFrameworkCore.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.EntityFrameworkCore.dll": {} - } - }, - "microsoft.entityframeworkcore.design/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Hosting.Abstractions": "1.1.2", - "Microsoft.EntityFrameworkCore.Relational.Design": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.Collections.NonGeneric": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.EntityFrameworkCore.Design.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.EntityFrameworkCore.Design.dll": {} - } - }, - "microsoft.entityframeworkcore.relational/1.1.2": { - "dependencies": { - "Microsoft.CSharp": "4.3.0", - "Microsoft.EntityFrameworkCore": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.Data.Common": "4.3.0", - "System.Diagnostics.DiagnosticSource": "4.3.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.EntityFrameworkCore.Relational.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.EntityFrameworkCore.Relational.dll": {} - } - }, - "microsoft.entityframeworkcore.relational.design/1.1.2": { - "dependencies": { - "Microsoft.EntityFrameworkCore.Relational": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.EntityFrameworkCore.Relational.Design.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.EntityFrameworkCore.Relational.Design.dll": {} - } - }, - "microsoft.entityframeworkcore.sqlserver/1.1.2": { - "dependencies": { - "Microsoft.EntityFrameworkCore.Relational": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.Data.SqlClient": "4.3.1", - "System.Threading.Thread": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.EntityFrameworkCore.SqlServer.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.EntityFrameworkCore.SqlServer.dll": {} - } - }, - "microsoft.entityframeworkcore.sqlserver.design/1.1.2": { - "dependencies": { - "Microsoft.EntityFrameworkCore.Relational.Design": "1.1.2", - "Microsoft.EntityFrameworkCore.SqlServer": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.EntityFrameworkCore.SqlServer.Design.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.EntityFrameworkCore.SqlServer.Design.dll": {} - } - }, - "microsoft.entityframeworkcore.tools/1.1.1": { - "dependencies": { - "Microsoft.EntityFrameworkCore.Design": "1.1.2" - } - }, - "microsoft.extensions.caching.abstractions/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Primitives": "1.1.1", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.0/Microsoft.Extensions.Caching.Abstractions.dll": {} - }, - "compile": { - "lib/netstandard1.0/Microsoft.Extensions.Caching.Abstractions.dll": {} - } - }, - "microsoft.extensions.caching.memory/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Caching.Abstractions": "1.1.2", - "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.1", - "Microsoft.Extensions.Options": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.Extensions.Caching.Memory.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.Extensions.Caching.Memory.dll": {} - } - }, - "microsoft.extensions.commandlineutils/1.1.1": { - "dependencies": { - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.Extensions.CommandLineUtils.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.Extensions.CommandLineUtils.dll": {} - } - }, - "microsoft.extensions.configuration/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.1/Microsoft.Extensions.Configuration.dll": {} - }, - "compile": { - "lib/netstandard1.1/Microsoft.Extensions.Configuration.dll": {} - } - }, - "microsoft.extensions.configuration.abstractions/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Primitives": "1.1.1", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.0/Microsoft.Extensions.Configuration.Abstractions.dll": {} - }, - "compile": { - "lib/netstandard1.0/Microsoft.Extensions.Configuration.Abstractions.dll": {} - } - }, - "microsoft.extensions.configuration.binder/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Configuration": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.ComponentModel.TypeConverter": "4.3.0" - }, - "runtime": { - "lib/netstandard1.1/Microsoft.Extensions.Configuration.Binder.dll": {} - }, - "compile": { - "lib/netstandard1.1/Microsoft.Extensions.Configuration.Binder.dll": {} - } - }, - "microsoft.extensions.configuration.environmentvariables/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Configuration": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.Extensions.Configuration.EnvironmentVariables.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.Extensions.Configuration.EnvironmentVariables.dll": {} - } - }, - "microsoft.extensions.configuration.fileextensions/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Configuration": "1.1.2", - "Microsoft.Extensions.FileProviders.Physical": "1.1.1", - "NETStandard.Library": "1.6.1", - "System.Threading.Thread": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.Extensions.Configuration.FileExtensions.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.Extensions.Configuration.FileExtensions.dll": {} - } - }, - "microsoft.extensions.configuration.json/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Configuration": "1.1.2", - "Microsoft.Extensions.Configuration.FileExtensions": "1.1.2", - "NETStandard.Library": "1.6.1", - "Newtonsoft.Json": "9.0.1", - "System.Dynamic.Runtime": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.Extensions.Configuration.Json.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.Extensions.Configuration.Json.dll": {} - } - }, - "microsoft.extensions.dependencyinjection/1.1.1": { - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.1", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.1/Microsoft.Extensions.DependencyInjection.dll": {} - }, - "compile": { - "lib/netstandard1.1/Microsoft.Extensions.DependencyInjection.dll": {} - } - }, - "microsoft.extensions.dependencyinjection.abstractions/1.1.1": { - "dependencies": { - "NETStandard.Library": "1.6.1", - "System.ComponentModel": "4.3.0" - }, - "runtime": { - "lib/netstandard1.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": {} - }, - "compile": { - "lib/netstandard1.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": {} - } - }, - "microsoft.extensions.dependencymodel/1.1.2": { - "dependencies": { - "Microsoft.DotNet.PlatformAbstractions": "1.1.2", - "Newtonsoft.Json": "9.0.1", - "System.Diagnostics.Debug": "4.3.0", - "System.Dynamic.Runtime": "4.3.0", - "System.Linq": "4.3.0" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.Extensions.DependencyModel.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.Extensions.DependencyModel.dll": {} - } - }, - "microsoft.extensions.diagnosticadapter/1.0.0": { - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.1", - "System.Collections.Concurrent": "4.3.0", - "System.ComponentModel": "4.3.0", - "System.Diagnostics.DiagnosticSource": "4.3.1", - "System.Reflection.Emit": "4.3.0", - "System.Reflection.Emit.Lightweight": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Runtime.Extensions": "4.3.0" - }, - "runtime": { - "lib/netstandard1.1/Microsoft.Extensions.DiagnosticAdapter.dll": {} - }, - "compile": { - "lib/netstandard1.1/Microsoft.Extensions.DiagnosticAdapter.dll": {} - } - }, - "microsoft.extensions.fileproviders.abstractions/1.1.1": { - "dependencies": { - "Microsoft.Extensions.Primitives": "1.1.1", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.0/Microsoft.Extensions.FileProviders.Abstractions.dll": {} - }, - "compile": { - "lib/netstandard1.0/Microsoft.Extensions.FileProviders.Abstractions.dll": {} - } - }, - "microsoft.extensions.fileproviders.composite/1.1.1": { - "dependencies": { - "Microsoft.Extensions.FileProviders.Abstractions": "1.1.1", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.0/Microsoft.Extensions.FileProviders.Composite.dll": {} - }, - "compile": { - "lib/netstandard1.0/Microsoft.Extensions.FileProviders.Composite.dll": {} - } - }, - "microsoft.extensions.fileproviders.embedded/1.0.0": { - "dependencies": { - "Microsoft.Extensions.FileProviders.Abstractions": "1.1.1", - "System.Runtime.Extensions": "4.3.0" - }, - "runtime": { - "lib/netstandard1.0/Microsoft.Extensions.FileProviders.Embedded.dll": {} - }, - "compile": { - "lib/netstandard1.0/Microsoft.Extensions.FileProviders.Embedded.dll": {} - } - }, - "microsoft.extensions.fileproviders.physical/1.1.1": { - "dependencies": { - "Microsoft.Extensions.FileProviders.Abstractions": "1.1.1", - "Microsoft.Extensions.FileSystemGlobbing": "1.1.1", - "NETStandard.Library": "1.6.1", - "System.IO.FileSystem.Watcher": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.Extensions.FileProviders.Physical.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.Extensions.FileProviders.Physical.dll": {} - } - }, - "microsoft.extensions.filesystemglobbing/1.1.1": { - "dependencies": { - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.Extensions.FileSystemGlobbing.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.Extensions.FileSystemGlobbing.dll": {} - } - }, - "microsoft.extensions.globalization.cultureinfocache/1.1.2": { - "dependencies": { - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.1/Microsoft.Extensions.Globalization.CultureInfoCache.dll": {} - }, - "compile": { - "lib/netstandard1.1/Microsoft.Extensions.Globalization.CultureInfoCache.dll": {} - } - }, - "microsoft.extensions.localization/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Hosting.Abstractions": "1.1.2", - "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.1", - "Microsoft.Extensions.Localization.Abstractions": "1.1.2", - "Microsoft.Extensions.Options": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.Resources.Reader": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.Extensions.Localization.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.Extensions.Localization.dll": {} - } - }, - "microsoft.extensions.localization.abstractions/1.1.2": { - "dependencies": { - "Microsoft.CSharp": "4.3.0", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.0/Microsoft.Extensions.Localization.Abstractions.dll": {} - }, - "compile": { - "lib/netstandard1.0/Microsoft.Extensions.Localization.Abstractions.dll": {} - } - }, - "microsoft.extensions.logging/1.1.2": { - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.1", - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.1/Microsoft.Extensions.Logging.dll": {} - }, - "compile": { - "lib/netstandard1.1/Microsoft.Extensions.Logging.dll": {} - } - }, - "microsoft.extensions.logging.abstractions/1.1.2": { - "dependencies": { - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.1/Microsoft.Extensions.Logging.Abstractions.dll": {} - }, - "compile": { - "lib/netstandard1.1/Microsoft.Extensions.Logging.Abstractions.dll": {} - } - }, - "microsoft.extensions.logging.console/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "1.1.2", - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.Extensions.Logging.Console.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.Extensions.Logging.Console.dll": {} - } - }, - "microsoft.extensions.logging.debug/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.Extensions.Logging.Debug.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.Extensions.Logging.Debug.dll": {} - } - }, - "microsoft.extensions.objectpool/1.1.1": { - "dependencies": { - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.Extensions.ObjectPool.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.Extensions.ObjectPool.dll": {} - } - }, - "microsoft.extensions.options/1.1.2": { - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.1", - "Microsoft.Extensions.Primitives": "1.1.1", - "NETStandard.Library": "1.6.1", - "System.ComponentModel": "4.3.0" - }, - "runtime": { - "lib/netstandard1.0/Microsoft.Extensions.Options.dll": {} - }, - "compile": { - "lib/netstandard1.0/Microsoft.Extensions.Options.dll": {} - } - }, - "microsoft.extensions.options.configurationextensions/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "1.1.2", - "Microsoft.Extensions.Configuration.Binder": "1.1.2", - "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.1", - "Microsoft.Extensions.Options": "1.1.2", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.1/Microsoft.Extensions.Options.ConfigurationExtensions.dll": {} - }, - "compile": { - "lib/netstandard1.1/Microsoft.Extensions.Options.ConfigurationExtensions.dll": {} - } - }, - "microsoft.extensions.platformabstractions/1.1.0": { - "dependencies": { - "NETStandard.Library": "1.6.1", - "System.Reflection.TypeExtensions": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/Microsoft.Extensions.PlatformAbstractions.dll": {} - }, - "compile": { - "lib/netstandard1.3/Microsoft.Extensions.PlatformAbstractions.dll": {} - } - }, - "microsoft.extensions.primitives/1.1.1": { - "dependencies": { - "NETStandard.Library": "1.6.1", - "System.Runtime.CompilerServices.Unsafe": "4.3.0" - }, - "runtime": { - "lib/netstandard1.0/Microsoft.Extensions.Primitives.dll": {} - }, - "compile": { - "lib/netstandard1.0/Microsoft.Extensions.Primitives.dll": {} - } - }, - "microsoft.extensions.webencoders/1.1.2": { - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.1", - "Microsoft.Extensions.Options": "1.1.2", - "NETStandard.Library": "1.6.1", - "System.Text.Encodings.Web": "4.3.1" - }, - "runtime": { - "lib/netstandard1.0/Microsoft.Extensions.WebEncoders.dll": {} - }, - "compile": { - "lib/netstandard1.0/Microsoft.Extensions.WebEncoders.dll": {} - } - }, - "microsoft.identitymodel.logging/1.1.3": { - "dependencies": { - "System.Diagnostics.Tracing": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.IO.FileSystem": "4.3.0" - }, - "runtime": { - "lib/netstandard1.4/Microsoft.IdentityModel.Logging.dll": {} - }, - "compile": { - "lib/netstandard1.4/Microsoft.IdentityModel.Logging.dll": {} - } - }, - "microsoft.identitymodel.protocols/2.1.2": { - "dependencies": { - "System.Collections.Specialized": "4.3.0", - "System.Diagnostics.Contracts": "4.3.0", - "System.IdentityModel.Tokens.Jwt": "5.1.3", - "System.Net.Http": "4.3.2" - }, - "runtime": { - "lib/netstandard1.4/Microsoft.IdentityModel.Protocols.dll": {} - }, - "compile": { - "lib/netstandard1.4/Microsoft.IdentityModel.Protocols.dll": {} - } - }, - "microsoft.identitymodel.protocols.openidconnect/2.1.2": { - "dependencies": { - "Microsoft.IdentityModel.Protocols": "2.1.2", - "System.Dynamic.Runtime": "4.3.0" - }, - "runtime": { - "lib/netstandard1.4/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll": {} - }, - "compile": { - "lib/netstandard1.4/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll": {} - } - }, - "microsoft.identitymodel.tokens/5.1.3": { - "dependencies": { - "Microsoft.IdentityModel.Logging": "1.1.3", - "Newtonsoft.Json": "9.0.1", - "System.Collections": "4.3.0", - "System.Diagnostics.Tools": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.InteropServices.RuntimeInformation": "4.3.0", - "System.Security.Claims": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.X509Certificates": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0" - }, - "runtime": { - "lib/netstandard1.4/Microsoft.IdentityModel.Tokens.dll": {} - }, - "compile": { - "lib/netstandard1.4/Microsoft.IdentityModel.Tokens.dll": {} - } - }, - "microsoft.net.http.headers/1.1.2": { - "dependencies": { - "Microsoft.Extensions.Primitives": "1.1.1", - "NETStandard.Library": "1.6.1", - "System.Buffers": "4.3.0", - "System.Diagnostics.Contracts": "4.3.0" - }, - "runtime": { - "lib/netstandard1.1/Microsoft.Net.Http.Headers.dll": {} - }, - "compile": { - "lib/netstandard1.1/Microsoft.Net.Http.Headers.dll": {} - } - }, - "microsoft.visualstudio.web.browserlink/1.1.2": { - "dependencies": { - "Microsoft.AspNetCore.Hosting.Abstractions": "1.1.2", - "Microsoft.AspNetCore.Http.Abstractions": "1.1.2", - "Microsoft.AspNetCore.Http.Extensions": "1.1.2", - "Microsoft.Extensions.FileProviders.Physical": "1.1.1", - "System.Diagnostics.Tools": "4.3.0", - "System.IO.MemoryMappedFiles": "4.3.0", - "System.Net.Primitives": "4.3.0", - "System.Net.Sockets": "4.3.0" - }, - "runtime": { - "lib/netstandard1.5/Microsoft.VisualStudio.Web.BrowserLink.dll": {} - }, - "compile": { - "lib/netstandard1.5/Microsoft.VisualStudio.Web.BrowserLink.dll": {} - } - }, - "microsoft.visualstudio.web.codegeneration/1.1.1": { - "dependencies": { - "Microsoft.Extensions.CommandLineUtils": "1.1.1", - "Microsoft.Extensions.DependencyInjection": "1.1.1", - "Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore": "1.1.1", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.VisualStudio.Web.CodeGeneration.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.VisualStudio.Web.CodeGeneration.dll": {} - } - }, - "microsoft.visualstudio.web.codegeneration.core/1.1.1": { - "dependencies": { - "Microsoft.Extensions.CommandLineUtils": "1.1.1", - "Microsoft.Extensions.DependencyInjection": "1.1.1", - "Microsoft.VisualStudio.Web.CodeGeneration.Templating": "1.1.1", - "NETStandard.Library": "1.6.1", - "Newtonsoft.Json": "9.0.1", - "System.Diagnostics.Process": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.VisualStudio.Web.CodeGeneration.Core.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.VisualStudio.Web.CodeGeneration.Core.dll": {} - } - }, - "microsoft.visualstudio.web.codegeneration.design/1.1.1": { - "dependencies": { - "Microsoft.NETCore.App": "1.1.2", - "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": "1.1.1" - }, - "runtime": { - "lib/netcoreapp1.1/dotnet-aspnet-codegenerator-design.dll": {} - }, - "compile": { - "lib/netcoreapp1.1/dotnet-aspnet-codegenerator-design.dll": {} - } - }, - "microsoft.visualstudio.web.codegeneration.entityframeworkcore/1.1.1": { - "dependencies": { - "Microsoft.AspNetCore.Hosting": "1.1.2", - "Microsoft.AspNetCore.Server.Kestrel": "1.1.2", - "Microsoft.EntityFrameworkCore": "1.1.2", - "Microsoft.EntityFrameworkCore.Design": "1.1.2", - "Microsoft.EntityFrameworkCore.SqlServer": "1.1.2", - "Microsoft.VisualStudio.Web.CodeGeneration.Core": "1.1.1", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore.dll": {} - } - }, - "microsoft.visualstudio.web.codegeneration.templating/1.1.1": { - "dependencies": { - "Microsoft.AspNetCore.Razor": "1.1.2", - "Microsoft.CodeAnalysis.CSharp": "1.3.0", - "Microsoft.VisualStudio.Web.CodeGeneration.Utils": "1.1.1", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.VisualStudio.Web.CodeGeneration.Templating.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.VisualStudio.Web.CodeGeneration.Templating.dll": {} - } - }, - "microsoft.visualstudio.web.codegeneration.utils/1.1.1": { - "dependencies": { - "Microsoft.CodeAnalysis.CSharp.Workspaces": "1.3.0", - "Microsoft.Extensions.PlatformAbstractions": "1.1.0", - "NETStandard.Library": "1.6.1", - "Newtonsoft.Json": "9.0.1", - "NuGet.Frameworks": "3.5.0", - "System.AppContext": "4.3.0", - "System.Runtime.Loader": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Threading.Tasks.Parallel": "4.3.0" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.VisualStudio.Web.CodeGeneration.Utils.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.VisualStudio.Web.CodeGeneration.Utils.dll": {} - } - }, - "microsoft.visualstudio.web.codegenerators.mvc/1.1.1": { - "dependencies": { - "Microsoft.VisualStudio.Web.CodeGeneration": "1.1.1", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.6/Microsoft.VisualStudio.Web.CodeGenerators.Mvc.dll": {} - }, - "compile": { - "lib/netstandard1.6/Microsoft.VisualStudio.Web.CodeGenerators.Mvc.dll": {} - } - }, - "newtonsoft.json/9.0.1": { - "dependencies": { - "Microsoft.CSharp": "4.3.0", - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Dynamic.Runtime": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Linq": "4.3.0", - "System.Linq.Expressions": "4.3.0", - "System.ObjectModel": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Text.Encoding.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0", - "System.Xml.XDocument": "4.3.0" - }, - "runtime": { - "lib/netstandard1.0/Newtonsoft.Json.dll": {} - }, - "compile": { - "lib/netstandard1.0/Newtonsoft.Json.dll": {} - } - }, - "nlog/5.0.0-beta07": { - "dependencies": { - "Microsoft.Extensions.PlatformAbstractions": "1.1.0", - "NETStandard.Library": "1.6.1", - "System.Collections.NonGeneric": "4.3.0", - "System.ComponentModel.TypeConverter": "4.3.0", - "System.Data.Common": "4.3.0", - "System.Diagnostics.Contracts": "4.3.0", - "System.Diagnostics.Process": "4.3.0", - "System.Diagnostics.StackTrace": "4.3.0", - "System.Diagnostics.TraceSource": "4.0.0", - "System.IO.FileSystem.AccessControl": "4.0.0", - "System.IO.FileSystem.Watcher": "4.3.0", - "System.Net.NameResolution": "4.3.0", - "System.Net.Requests": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Runtime.Loader": "4.3.0", - "System.Runtime.Serialization.Primitives": "4.3.0", - "System.Security.AccessControl": "4.0.0", - "System.Security.Principal": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.AccessControl": "4.0.0", - "System.Threading.Thread": "4.3.0", - "System.Threading.ThreadPool": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0", - "System.Xml.XmlDocument": "4.0.1" - }, - "runtime": { - "lib/netstandard1.5/NLog.dll": {} - }, - "compile": { - "lib/netstandard1.5/NLog.dll": {} - } - }, - "nlog.extensions.logging/1.0.0-rtm-beta5": { - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "1.1.2", - "NETStandard.Library": "1.6.1", - "NLog": "5.0.0-beta07", - "System.AppContext": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/NLog.Extensions.Logging.dll": {} - }, - "compile": { - "lib/netstandard1.3/NLog.Extensions.Logging.dll": {} - } - }, - "nuget.frameworks/3.5.0": { - "dependencies": { - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.3/NuGet.Frameworks.dll": {} - }, - "compile": { - "lib/netstandard1.3/NuGet.Frameworks.dll": {} - } - }, - "remotion.linq/2.1.1": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Linq": "4.3.0", - "System.Linq.Expressions": "4.3.0", - "System.Linq.Queryable": "4.3.0", - "System.ObjectModel": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0" - }, - "runtime": { - "lib/netstandard1.0/Remotion.Linq.dll": {} - }, - "compile": { - "lib/netstandard1.0/Remotion.Linq.dll": {} - } - }, - "runtime.native.system.data.sqlclient.sni/4.3.0": { - "dependencies": { - "runtime.win7-x64.runtime.native.System.Data.SqlClient.sni": "4.3.0", - "runtime.win7-x86.runtime.native.System.Data.SqlClient.sni": "4.3.0" - } - }, - "runtime.win7-x64.runtime.native.system.data.sqlclient.sni/4.3.0": { - "runtimeTargets": { - "runtimes/win7-x64/native/sni.dll": { - "rid": "win7-x64", - "assetType": "native" - } - } - }, - "runtime.win7-x86.runtime.native.system.data.sqlclient.sni/4.3.0": { - "runtimeTargets": { - "runtimes/win7-x86/native/sni.dll": { - "rid": "win7-x86", - "assetType": "native" - } - } - }, - "swashbuckle.aspnetcore/1.0.0": { - "dependencies": { - "NETStandard.Library": "1.6.1", - "Swashbuckle.AspNetCore.Swagger": "1.0.0", - "Swashbuckle.AspNetCore.SwaggerGen": "1.0.0", - "Swashbuckle.AspNetCore.SwaggerUI": "1.0.0" - }, - "runtime": { - "lib/netstandard1.6/Swashbuckle.AspNetCore.dll": {} - }, - "compile": { - "lib/netstandard1.6/Swashbuckle.AspNetCore.dll": {} - } - }, - "swashbuckle.aspnetcore.swagger/1.0.0": { - "dependencies": { - "Microsoft.AspNetCore.Mvc.Core": "1.1.3", - "Microsoft.AspNetCore.Mvc.Formatters.Json": "1.1.3", - "NETStandard.Library": "1.6.1" - }, - "runtime": { - "lib/netstandard1.6/Swashbuckle.AspNetCore.Swagger.dll": {} - }, - "compile": { - "lib/netstandard1.6/Swashbuckle.AspNetCore.Swagger.dll": {} - } - }, - "swashbuckle.aspnetcore.swaggergen/1.0.0": { - "dependencies": { - "Microsoft.AspNetCore.Mvc.ApiExplorer": "1.1.3", - "Microsoft.AspNetCore.Mvc.Core": "1.1.3", - "Microsoft.AspNetCore.Mvc.DataAnnotations": "1.1.3", - "NETStandard.Library": "1.6.1", - "Swashbuckle.AspNetCore.Swagger": "1.0.0", - "System.Xml.XPath": "4.0.1" - }, - "runtime": { - "lib/netstandard1.6/Swashbuckle.AspNetCore.SwaggerGen.dll": {} - }, - "compile": { - "lib/netstandard1.6/Swashbuckle.AspNetCore.SwaggerGen.dll": {} - } - }, - "swashbuckle.aspnetcore.swaggerui/1.0.0": { - "dependencies": { - "Microsoft.AspNetCore.Routing": "1.1.2", - "Microsoft.AspNetCore.StaticFiles": "1.1.2", - "Microsoft.Extensions.FileProviders.Embedded": "1.0.0", - "NETStandard.Library": "1.6.1", - "Newtonsoft.Json": "9.0.1", - "System.Xml.XPath": "4.0.1" - }, - "runtime": { - "lib/netstandard1.6/Swashbuckle.AspNetCore.SwaggerUI.dll": {} - }, - "compile": { - "lib/netstandard1.6/Swashbuckle.AspNetCore.SwaggerUI.dll": {} - } - }, - "system.collections.nongeneric/4.3.0": { - "dependencies": { - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/System.Collections.NonGeneric.dll": {} - }, - "compile": { - "ref/netstandard1.3/System.Collections.NonGeneric.dll": {} - } - }, - "system.collections.specialized/4.3.0": { - "dependencies": { - "System.Collections.NonGeneric": "4.3.0", - "System.Globalization": "4.3.0", - "System.Globalization.Extensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/System.Collections.Specialized.dll": {} - }, - "compile": { - "ref/netstandard1.3/System.Collections.Specialized.dll": {} - } - }, - "system.componentmodel.primitives/4.3.0": { - "dependencies": { - "System.ComponentModel": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0" - }, - "runtime": { - "lib/netstandard1.0/System.ComponentModel.Primitives.dll": {} - }, - "compile": { - "ref/netstandard1.0/System.ComponentModel.Primitives.dll": {} - } - }, - "system.componentmodel.typeconverter/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Collections.NonGeneric": "4.3.0", - "System.Collections.Specialized": "4.3.0", - "System.ComponentModel": "4.3.0", - "System.ComponentModel.Primitives": "4.3.0", - "System.Globalization": "4.3.0", - "System.Linq": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0" - }, - "runtime": { - "lib/netstandard1.5/System.ComponentModel.TypeConverter.dll": {} - }, - "compile": { - "ref/netstandard1.5/System.ComponentModel.TypeConverter.dll": {} - } - }, - "system.data.common/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading.Tasks": "4.3.0" - }, - "runtime": { - "lib/netstandard1.2/System.Data.Common.dll": {} - }, - "compile": { - "ref/netstandard1.2/System.Data.Common.dll": {} - } - }, - "system.data.sqlclient/4.3.1": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.Win32.Primitives": "4.3.0", - "System.Collections": "4.3.0", - "System.Collections.Concurrent": "4.3.0", - "System.Data.Common": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.DiagnosticSource": "4.3.1", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.IO.Pipes": "4.3.0", - "System.Linq": "4.3.0", - "System.Net.NameResolution": "4.3.0", - "System.Net.Primitives": "4.3.0", - "System.Net.Security": "4.3.1", - "System.Net.Sockets": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.InteropServices.RuntimeInformation": "4.3.0", - "System.Security.Cryptography.X509Certificates": "4.3.0", - "System.Security.Principal": "4.3.0", - "System.Security.Principal.Windows": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Text.Encoding.CodePages": "4.3.0", - "System.Text.Encoding.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "System.Threading.Thread": "4.3.0", - "System.Threading.ThreadPool": "4.3.0", - "System.Threading.Timer": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0", - "runtime.native.System.Data.SqlClient.sni": "4.3.0" - }, - "runtimeTargets": { - "runtimes/unix/lib/netstandard1.3/System.Data.SqlClient.dll": { - "rid": "unix", - "assetType": "runtime" - }, - "runtimes/win/lib/netstandard1.3/System.Data.SqlClient.dll": { - "rid": "win", - "assetType": "runtime" - } - }, - "compile": { - "ref/netstandard1.3/System.Data.SqlClient.dll": {} - } - }, - "system.diagnostics.contracts/4.3.0": { - "dependencies": { - "System.Runtime": "4.3.0" - }, - "runtime": { - "lib/netstandard1.0/System.Diagnostics.Contracts.dll": {} - }, - "compile": { - "ref/netstandard1.0/System.Diagnostics.Contracts.dll": {} - } - }, - "system.diagnostics.stacktrace/4.3.0": { - "dependencies": { - "System.IO.FileSystem": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Metadata": "1.4.1", - "System.Runtime": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/System.Diagnostics.StackTrace.dll": {} - }, - "compile": { - "ref/netstandard1.3/System.Diagnostics.StackTrace.dll": {} - } - }, - "system.diagnostics.tracesource/4.0.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0", - "runtime.native.System": "4.3.0" - }, - "runtimeTargets": { - "runtimes/unix/lib/netstandard1.3/System.Diagnostics.TraceSource.dll": { - "rid": "unix", - "assetType": "runtime" - }, - "runtimes/win/lib/netstandard1.3/System.Diagnostics.TraceSource.dll": { - "rid": "win", - "assetType": "runtime" - } - }, - "compile": { - "ref/netstandard1.3/System.Diagnostics.TraceSource.dll": {} - } - }, - "system.identitymodel.tokens.jwt/5.1.3": { - "dependencies": { - "Microsoft.IdentityModel.Tokens": "5.1.3" - }, - "runtime": { - "lib/netstandard1.4/System.IdentityModel.Tokens.Jwt.dll": {} - }, - "compile": { - "lib/netstandard1.4/System.IdentityModel.Tokens.Jwt.dll": {} - } - }, - "system.interactive.async/3.0.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Linq": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0" - }, - "runtime": { - "lib/netstandard1.0/System.Interactive.Async.dll": {} - }, - "compile": { - "lib/netstandard1.0/System.Interactive.Async.dll": {} - } - }, - "system.io.filesystem.accesscontrol/4.0.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.IO.FileSystem": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Security.AccessControl": "4.0.0", - "System.Security.Principal.Windows": "4.3.0" - }, - "runtimeTargets": { - "runtimes/unix/lib/netstandard1.3/System.IO.FileSystem.AccessControl.dll": { - "rid": "unix", - "assetType": "runtime" - }, - "runtimes/win/lib/netstandard1.3/System.IO.FileSystem.AccessControl.dll": { - "rid": "win", - "assetType": "runtime" - } - }, - "compile": { - "ref/netstandard1.3/System.IO.FileSystem.AccessControl.dll": {} - } - }, - "system.io.pipes/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Buffers": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.IO": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Net.Primitives": "4.3.0", - "System.Net.Sockets": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Principal": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Overlapped": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "runtime.native.System": "4.3.0" - }, - "runtimeTargets": { - "runtimes/unix/lib/netstandard1.3/System.IO.Pipes.dll": { - "rid": "unix", - "assetType": "runtime" - }, - "runtimes/win/lib/netstandard1.3/System.IO.Pipes.dll": { - "rid": "win", - "assetType": "runtime" - } - } - }, - "system.net.websockets/4.3.0": { - "dependencies": { - "Microsoft.Win32.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading.Tasks": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/System.Net.WebSockets.dll": {} - }, - "compile": { - "ref/netstandard1.3/System.Net.WebSockets.dll": {} - } - }, - "system.runtime.compilerservices.unsafe/4.3.0": { - "dependencies": { - "System.Runtime": "4.3.0" - }, - "runtime": { - "lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll": {} - }, - "compile": { - "lib/netstandard1.0/System.Runtime.CompilerServices.Unsafe.dll": {} - } - }, - "system.runtime.serialization.primitives/4.3.0": { - "dependencies": { - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0" - }, - "runtime": { - "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": {} - }, - "compile": { - "ref/netstandard1.3/System.Runtime.Serialization.Primitives.dll": {} - } - }, - "system.security.accesscontrol/4.0.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.Globalization": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Principal.Windows": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Thread": "4.3.0" - }, - "runtimeTargets": { - "runtimes/unix/lib/netstandard1.3/System.Security.AccessControl.dll": { - "rid": "unix", - "assetType": "runtime" - }, - "runtimes/win/lib/netstandard1.3/System.Security.AccessControl.dll": { - "rid": "win", - "assetType": "runtime" - } - }, - "compile": { - "ref/netstandard1.3/System.Security.AccessControl.dll": {} - } - }, - "system.text.encoding.codepages/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0" - }, - "runtimeTargets": { - "runtimes/unix/lib/netstandard1.3/System.Text.Encoding.CodePages.dll": { - "rid": "unix", - "assetType": "runtime" - }, - "runtimes/win/lib/netstandard1.3/System.Text.Encoding.CodePages.dll": { - "rid": "win", - "assetType": "runtime" - } - } - }, - "system.text.encodings.web/4.3.1": { - "dependencies": { - "System.Diagnostics.Debug": "4.3.0", - "System.IO": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0" - }, - "runtime": { - "lib/netstandard1.0/System.Text.Encodings.Web.dll": {} - }, - "compile": { - "lib/netstandard1.0/System.Text.Encodings.Web.dll": {} - } - }, - "system.threading.accesscontrol/4.0.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Security.AccessControl": "4.0.0", - "System.Security.Principal.Windows": "4.3.0", - "System.Threading": "4.3.0" - }, - "runtimeTargets": { - "runtimes/unix/lib/netstandard1.3/System.Threading.AccessControl.dll": { - "rid": "unix", - "assetType": "runtime" - }, - "runtimes/win/lib/netstandard1.3/System.Threading.AccessControl.dll": { - "rid": "win", - "assetType": "runtime" - } - }, - "compile": { - "ref/netstandard1.3/System.Threading.AccessControl.dll": {} - } - }, - "system.valuetuple/4.3.1": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0" - }, - "runtime": { - "lib/netstandard1.0/System.ValueTuple.dll": {} - }, - "compile": { - "lib/netstandard1.0/System.ValueTuple.dll": {} - } - }, - "libuv/1.9.1": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0" - }, - "compileOnly": true - }, - "microsoft.codeanalysis.analyzers/1.1.0": { - "compileOnly": true - }, - "microsoft.codeanalysis.common/1.3.0": { - "dependencies": { - "Microsoft.CodeAnalysis.Analyzers": "1.1.0", - "System.AppContext": "4.3.0", - "System.Collections": "4.3.0", - "System.Collections.Concurrent": "4.3.0", - "System.Collections.Immutable": "1.3.0", - "System.Console": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.FileVersionInfo": "4.0.0", - "System.Diagnostics.StackTrace": "4.3.0", - "System.Diagnostics.Tools": "4.3.0", - "System.Dynamic.Runtime": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Linq": "4.3.0", - "System.Linq.Expressions": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Metadata": "1.4.1", - "System.Reflection.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.Numerics": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.X509Certificates": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Text.Encoding.CodePages": "4.3.0", - "System.Text.Encoding.Extensions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "System.Threading.Tasks.Parallel": "4.3.0", - "System.Threading.Thread": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0", - "System.Xml.XDocument": "4.3.0", - "System.Xml.XPath.XDocument": "4.0.1", - "System.Xml.XmlDocument": "4.0.1" - }, - "compile": { - "lib/netstandard1.3/Microsoft.CodeAnalysis.dll": {} - }, - "compileOnly": true - }, - "microsoft.codeanalysis.csharp/1.3.0": { - "dependencies": { - "Microsoft.CodeAnalysis.Common": "1.3.0" - }, - "compile": { - "lib/netstandard1.3/Microsoft.CodeAnalysis.CSharp.dll": {} - }, - "compileOnly": true - }, - "microsoft.codeanalysis.visualbasic/1.3.0": { - "dependencies": { - "Microsoft.CodeAnalysis.Common": "1.3.0" - }, - "compileOnly": true - }, - "microsoft.csharp/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Dynamic.Runtime": "4.3.0", - "System.Globalization": "4.3.0", - "System.Linq": "4.3.0", - "System.Linq.Expressions": "4.3.0", - "System.ObjectModel": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Threading": "4.3.0" - }, - "compile": { - "ref/netstandard1.0/Microsoft.CSharp.dll": {} - }, - "compileOnly": true - }, - "microsoft.diasymreader.native/1.4.1": { - "compileOnly": true - }, - "microsoft.netcore.app/1.1.2": { - "dependencies": { - "Libuv": "1.9.1", - "Microsoft.CSharp": "4.3.0", - "Microsoft.CodeAnalysis.CSharp": "1.3.0", - "Microsoft.CodeAnalysis.VisualBasic": "1.3.0", - "Microsoft.DiaSymReader.Native": "1.4.1", - "Microsoft.NETCore.DotNetHostPolicy": "1.1.2", - "Microsoft.NETCore.Runtime.CoreCLR": "1.1.2", - "Microsoft.VisualBasic": "10.1.0", - "NETStandard.Library": "1.6.1", - "System.Buffers": "4.3.0", - "System.Collections.Immutable": "1.3.0", - "System.ComponentModel": "4.3.0", - "System.ComponentModel.Annotations": "4.3.0", - "System.Diagnostics.DiagnosticSource": "4.3.1", - "System.Diagnostics.Process": "4.3.0", - "System.Dynamic.Runtime": "4.3.0", - "System.Globalization.Extensions": "4.3.0", - "System.IO.FileSystem.Watcher": "4.3.0", - "System.IO.MemoryMappedFiles": "4.3.0", - "System.IO.UnmanagedMemoryStream": "4.3.0", - "System.Linq.Expressions": "4.3.0", - "System.Linq.Parallel": "4.3.0", - "System.Linq.Queryable": "4.3.0", - "System.Net.Http": "4.3.2", - "System.Net.NameResolution": "4.3.0", - "System.Net.Requests": "4.3.0", - "System.Net.Security": "4.3.1", - "System.Net.WebHeaderCollection": "4.3.0", - "System.Numerics.Vectors": "4.3.0", - "System.Reflection.DispatchProxy": "4.3.0", - "System.Reflection.Metadata": "1.4.1", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.Reader": "4.3.0", - "System.Runtime.Loader": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Security.Cryptography.X509Certificates": "4.3.0", - "System.Threading.Tasks.Dataflow": "4.7.0", - "System.Threading.Tasks.Extensions": "4.3.0", - "System.Threading.Tasks.Parallel": "4.3.0", - "System.Threading.Thread": "4.3.0", - "System.Threading.ThreadPool": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1" - }, - "compileOnly": true - }, - "microsoft.netcore.dotnethost/1.1.0": { - "compileOnly": true - }, - "microsoft.netcore.dotnethostpolicy/1.1.2": { - "dependencies": { - "Microsoft.NETCore.DotNetHostResolver": "1.1.0" - }, - "compileOnly": true - }, - "microsoft.netcore.dotnethostresolver/1.1.0": { - "dependencies": { - "Microsoft.NETCore.DotNetHost": "1.1.0" - }, - "compileOnly": true - }, - "microsoft.netcore.jit/1.1.2": { - "compileOnly": true - }, - "microsoft.netcore.platforms/1.1.0": { - "compileOnly": true - }, - "microsoft.netcore.runtime.coreclr/1.1.2": { - "dependencies": { - "Microsoft.NETCore.Jit": "1.1.2", - "Microsoft.NETCore.Windows.ApiSets": "1.0.1" - }, - "compileOnly": true - }, - "microsoft.netcore.targets/1.1.0": { - "compileOnly": true - }, - "microsoft.netcore.windows.apisets/1.0.1": { - "compileOnly": true - }, - "microsoft.visualbasic/10.1.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Dynamic.Runtime": "4.3.0", - "System.Globalization": "4.3.0", - "System.Linq": "4.3.0", - "System.Linq.Expressions": "4.3.0", - "System.ObjectModel": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Threading": "4.3.0" - }, - "compile": { - "ref/netstandard1.1/Microsoft.VisualBasic.dll": {} - }, - "compileOnly": true - }, - "microsoft.win32.primitives/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/Microsoft.Win32.Primitives.dll": {} - }, - "compileOnly": true - }, - "microsoft.win32.registry/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.Globalization": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/Microsoft.Win32.Registry.dll": {} - }, - "compileOnly": true - }, - "netstandard.library/1.6.1": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.Win32.Primitives": "4.3.0", - "System.AppContext": "4.3.0", - "System.Collections": "4.3.0", - "System.Collections.Concurrent": "4.3.0", - "System.Console": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.Tools": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Globalization": "4.3.0", - "System.Globalization.Calendars": "4.3.0", - "System.IO": "4.3.0", - "System.IO.Compression": "4.3.0", - "System.IO.Compression.ZipFile": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Linq": "4.3.0", - "System.Linq.Expressions": "4.3.0", - "System.Net.Http": "4.3.2", - "System.Net.Primitives": "4.3.0", - "System.Net.Sockets": "4.3.0", - "System.ObjectModel": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.InteropServices.RuntimeInformation": "4.3.0", - "System.Runtime.Numerics": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Security.Cryptography.X509Certificates": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Text.Encoding.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "System.Threading.Timer": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0", - "System.Xml.XDocument": "4.3.0" - }, - "compileOnly": true - }, - "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "compileOnly": true - }, - "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "compileOnly": true - }, - "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "compileOnly": true - }, - "runtime.native.system/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - }, - "compileOnly": true - }, - "runtime.native.system.io.compression/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - }, - "compileOnly": true - }, - "runtime.native.system.net.http/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - }, - "compileOnly": true - }, - "runtime.native.system.net.security/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - }, - "compileOnly": true - }, - "runtime.native.system.security.cryptography.apple/4.3.0": { - "dependencies": { - "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" - }, - "compileOnly": true - }, - "runtime.native.system.security.cryptography.openssl/4.3.1": { - "dependencies": { - "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1", - "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1", - "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1", - "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1", - "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1", - "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1", - "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1", - "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1", - "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1", - "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1" - }, - "compileOnly": true - }, - "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "compileOnly": true - }, - "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "compileOnly": true - }, - "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0": { - "compileOnly": true - }, - "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "compileOnly": true - }, - "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "compileOnly": true - }, - "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "compileOnly": true - }, - "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "compileOnly": true - }, - "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "compileOnly": true - }, - "system.appcontext/4.3.0": { - "dependencies": { - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.6/System.AppContext.dll": {} - }, - "compileOnly": true - }, - "system.buffers/4.3.0": { - "dependencies": { - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading": "4.3.0" - }, - "compile": { - "lib/netstandard1.1/System.Buffers.dll": {} - }, - "compileOnly": true - }, - "system.collections/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Collections.dll": {} - }, - "compileOnly": true - }, - "system.collections.concurrent/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Globalization": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Collections.Concurrent.dll": {} - }, - "compileOnly": true - }, - "system.collections.immutable/1.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.Linq": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0" - }, - "compile": { - "lib/netstandard1.0/System.Collections.Immutable.dll": {} - }, - "compileOnly": true - }, - "system.componentmodel/4.3.0": { - "dependencies": { - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.0/System.ComponentModel.dll": {} - }, - "compileOnly": true - }, - "system.componentmodel.annotations/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.ComponentModel": "4.3.0", - "System.Globalization": "4.3.0", - "System.Linq": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading": "4.3.0" - }, - "compile": { - "ref/netstandard1.4/System.ComponentModel.Annotations.dll": {} - }, - "compileOnly": true - }, - "system.console/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.IO": "4.3.0", - "System.Runtime": "4.3.0", - "System.Text.Encoding": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Console.dll": {} - }, - "compileOnly": true - }, - "system.diagnostics.debug/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Diagnostics.Debug.dll": {} - }, - "compileOnly": true - }, - "system.diagnostics.diagnosticsource/4.3.1": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Reflection": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading": "4.3.0" - }, - "compile": { - "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": {} - }, - "compileOnly": true - }, - "system.diagnostics.fileversioninfo/4.0.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Reflection.Metadata": "1.4.1", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.InteropServices": "4.3.0" - }, - "compileOnly": true - }, - "system.diagnostics.process/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.Win32.Primitives": "4.3.0", - "Microsoft.Win32.Registry": "4.3.0", - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Text.Encoding.Extensions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "System.Threading.Thread": "4.3.0", - "System.Threading.ThreadPool": "4.3.0", - "runtime.native.System": "4.3.0" - }, - "compile": { - "ref/netstandard1.4/System.Diagnostics.Process.dll": {} - }, - "compileOnly": true - }, - "system.diagnostics.tools/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.0/System.Diagnostics.Tools.dll": {} - }, - "compileOnly": true - }, - "system.diagnostics.tracing/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.5/System.Diagnostics.Tracing.dll": {} - }, - "compileOnly": true - }, - "system.dynamic.runtime/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Linq": "4.3.0", - "System.Linq.Expressions": "4.3.0", - "System.ObjectModel": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Emit": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Dynamic.Runtime.dll": {} - }, - "compileOnly": true - }, - "system.globalization/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Globalization.dll": {} - }, - "compileOnly": true - }, - "system.globalization.calendars/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Globalization": "4.3.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Globalization.Calendars.dll": {} - }, - "compileOnly": true - }, - "system.globalization.extensions/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Globalization": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.InteropServices": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Globalization.Extensions.dll": {} - }, - "compileOnly": true - }, - "system.io/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading.Tasks": "4.3.0" - }, - "compile": { - "ref/netstandard1.5/System.IO.dll": {} - }, - "compileOnly": true - }, - "system.io.compression/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Buffers": "4.3.0", - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "runtime.native.System": "4.3.0", - "runtime.native.System.IO.Compression": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.IO.Compression.dll": {} - }, - "compileOnly": true - }, - "system.io.compression.zipfile/4.3.0": { - "dependencies": { - "System.Buffers": "4.3.0", - "System.IO": "4.3.0", - "System.IO.Compression": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Text.Encoding": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.IO.Compression.ZipFile.dll": {} - }, - "compileOnly": true - }, - "system.io.filesystem/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.IO": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading.Tasks": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.IO.FileSystem.dll": {} - }, - "compileOnly": true - }, - "system.io.filesystem.primitives/4.3.0": { - "dependencies": { - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.IO.FileSystem.Primitives.dll": {} - }, - "compileOnly": true - }, - "system.io.filesystem.watcher/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.Win32.Primitives": "4.3.0", - "System.Collections": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Overlapped": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "System.Threading.Thread": "4.3.0", - "runtime.native.System": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.IO.FileSystem.Watcher.dll": {} - }, - "compileOnly": true - }, - "system.io.memorymappedfiles/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.IO": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.IO.UnmanagedMemoryStream": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "runtime.native.System": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.IO.MemoryMappedFiles.dll": {} - }, - "compileOnly": true - }, - "system.io.unmanagedmemorystream/4.3.0": { - "dependencies": { - "System.Buffers": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.IO": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.IO.UnmanagedMemoryStream.dll": {} - }, - "compileOnly": true - }, - "system.linq/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0" - }, - "compile": { - "ref/netstandard1.6/System.Linq.dll": {} - }, - "compileOnly": true - }, - "system.linq.expressions/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Linq": "4.3.0", - "System.ObjectModel": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Emit": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Emit.Lightweight": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Reflection.TypeExtensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0" - }, - "compile": { - "ref/netstandard1.6/System.Linq.Expressions.dll": {} - }, - "compileOnly": true - }, - "system.linq.parallel/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Collections.Concurrent": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Linq": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0" - }, - "compile": { - "ref/netstandard1.1/System.Linq.Parallel.dll": {} - }, - "compileOnly": true - }, - "system.linq.queryable/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Linq": "4.3.0", - "System.Linq.Expressions": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.0/System.Linq.Queryable.dll": {} - }, - "compileOnly": true - }, - "system.net.http/4.3.2": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.DiagnosticSource": "4.3.1", - "System.Diagnostics.Tracing": "4.3.0", - "System.Globalization": "4.3.0", - "System.Globalization.Extensions": "4.3.0", - "System.IO": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.Net.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.OpenSsl": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Security.Cryptography.X509Certificates": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "runtime.native.System": "4.3.0", - "runtime.native.System.Net.Http": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1" - }, - "compile": { - "ref/netstandard1.3/System.Net.Http.dll": {} - }, - "compileOnly": true - }, - "system.net.nameresolution/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Globalization": "4.3.0", - "System.Net.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Principal.Windows": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "runtime.native.System": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Net.NameResolution.dll": {} - }, - "compileOnly": true - }, - "system.net.primitives/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Net.Primitives.dll": {} - }, - "compileOnly": true - }, - "system.net.requests/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Net.Http": "4.3.2", - "System.Net.Primitives": "4.3.0", - "System.Net.WebHeaderCollection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Net.Requests.dll": {} - }, - "compileOnly": true - }, - "system.net.security/4.3.1": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.Win32.Primitives": "4.3.0", - "System.Collections": "4.3.0", - "System.Collections.Concurrent": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Globalization": "4.3.0", - "System.Globalization.Extensions": "4.3.0", - "System.IO": "4.3.0", - "System.Net.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Claims": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.OpenSsl": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Security.Cryptography.X509Certificates": "4.3.0", - "System.Security.Principal": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "System.Threading.ThreadPool": "4.3.0", - "runtime.native.System": "4.3.0", - "runtime.native.System.Net.Security": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1" - }, - "compile": { - "ref/netstandard1.3/System.Net.Security.dll": {} - }, - "compileOnly": true - }, - "system.net.sockets/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.IO": "4.3.0", - "System.Net.Primitives": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading.Tasks": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Net.Sockets.dll": {} - }, - "compileOnly": true - }, - "system.net.webheadercollection/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Net.WebHeaderCollection.dll": {} - }, - "compileOnly": true - }, - "system.numerics.vectors/4.3.0": { - "dependencies": { - "System.Globalization": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0" - }, - "compile": { - "ref/netstandard1.0/System.Numerics.Vectors.dll": {} - }, - "compileOnly": true - }, - "system.objectmodel/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.ObjectModel.dll": {} - }, - "compileOnly": true - }, - "system.reflection/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.IO": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.5/System.Reflection.dll": {} - }, - "compileOnly": true - }, - "system.reflection.dispatchproxy/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Linq": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Emit": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Reflection.DispatchProxy.dll": {} - }, - "compileOnly": true - }, - "system.reflection.emit/4.3.0": { - "dependencies": { - "System.IO": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.1/System.Reflection.Emit.dll": {} - }, - "compileOnly": true - }, - "system.reflection.emit.ilgeneration/4.3.0": { - "dependencies": { - "System.Reflection": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.0/System.Reflection.Emit.ILGeneration.dll": {} - }, - "compileOnly": true - }, - "system.reflection.emit.lightweight/4.3.0": { - "dependencies": { - "System.Reflection": "4.3.0", - "System.Reflection.Emit.ILGeneration": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.0/System.Reflection.Emit.Lightweight.dll": {} - }, - "compileOnly": true - }, - "system.reflection.extensions/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Reflection": "4.3.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.0/System.Reflection.Extensions.dll": {} - }, - "compileOnly": true - }, - "system.reflection.metadata/1.4.1": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Collections.Immutable": "1.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.IO": "4.3.0", - "System.IO.Compression": "4.3.0", - "System.Linq": "4.3.0", - "System.Reflection": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Text.Encoding.Extensions": "4.3.0", - "System.Threading": "4.3.0" - }, - "compile": { - "lib/netstandard1.1/System.Reflection.Metadata.dll": {} - }, - "compileOnly": true - }, - "system.reflection.primitives/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.0/System.Reflection.Primitives.dll": {} - }, - "compileOnly": true - }, - "system.reflection.typeextensions/4.3.0": { - "dependencies": { - "System.Reflection": "4.3.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.5/System.Reflection.TypeExtensions.dll": {} - }, - "compileOnly": true - }, - "system.resources.reader/4.3.0": { - "dependencies": { - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0" - }, - "compile": { - "lib/netstandard1.0/System.Resources.Reader.dll": {} - }, - "compileOnly": true - }, - "system.resources.resourcemanager/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Globalization": "4.3.0", - "System.Reflection": "4.3.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.0/System.Resources.ResourceManager.dll": {} - }, - "compileOnly": true - }, - "system.runtime/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - }, - "compile": { - "ref/netstandard1.5/System.Runtime.dll": {} - }, - "compileOnly": true - }, - "system.runtime.extensions/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.5/System.Runtime.Extensions.dll": {} - }, - "compileOnly": true - }, - "system.runtime.handles/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Runtime.Handles.dll": {} - }, - "compileOnly": true - }, - "system.runtime.interopservices/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Reflection": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0" - }, - "compile": { - "ref/netcoreapp1.1/System.Runtime.InteropServices.dll": {} - }, - "compileOnly": true - }, - "system.runtime.interopservices.runtimeinformation/4.3.0": { - "dependencies": { - "System.Reflection": "4.3.0", - "System.Reflection.Extensions": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Threading": "4.3.0", - "runtime.native.System": "4.3.0" - }, - "compile": { - "ref/netstandard1.1/System.Runtime.InteropServices.RuntimeInformation.dll": {} - }, - "compileOnly": true - }, - "system.runtime.loader/4.3.0": { - "dependencies": { - "System.IO": "4.3.0", - "System.Reflection": "4.3.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.5/System.Runtime.Loader.dll": {} - }, - "compileOnly": true - }, - "system.runtime.numerics/4.3.0": { - "dependencies": { - "System.Globalization": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0" - }, - "compile": { - "ref/netstandard1.1/System.Runtime.Numerics.dll": {} - }, - "compileOnly": true - }, - "system.security.claims/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Security.Principal": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Security.Claims.dll": {} - }, - "compileOnly": true - }, - "system.security.cryptography.algorithms/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.Numerics": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "runtime.native.System.Security.Cryptography.Apple": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1" - }, - "compile": { - "ref/netstandard1.6/System.Security.Cryptography.Algorithms.dll": {} - }, - "compileOnly": true - }, - "system.security.cryptography.cng/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0" - }, - "compileOnly": true - }, - "system.security.cryptography.csp/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.IO": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0" - }, - "compileOnly": true - }, - "system.security.cryptography.encoding/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.Collections.Concurrent": "4.3.0", - "System.Linq": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1" - }, - "compile": { - "ref/netstandard1.3/System.Security.Cryptography.Encoding.dll": {} - }, - "compileOnly": true - }, - "system.security.cryptography.openssl/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.Numerics": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1" - }, - "compileOnly": true - }, - "system.security.cryptography.primitives/4.3.0": { - "dependencies": { - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Security.Cryptography.Primitives.dll": {} - }, - "compileOnly": true - }, - "system.security.cryptography.x509certificates/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.Globalization.Calendars": "4.3.0", - "System.IO": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Runtime.Numerics": "4.3.0", - "System.Security.Cryptography.Algorithms": "4.3.0", - "System.Security.Cryptography.Cng": "4.3.0", - "System.Security.Cryptography.Csp": "4.3.0", - "System.Security.Cryptography.Encoding": "4.3.0", - "System.Security.Cryptography.OpenSsl": "4.3.0", - "System.Security.Cryptography.Primitives": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "runtime.native.System": "4.3.0", - "runtime.native.System.Net.Http": "4.3.0", - "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.1" - }, - "compile": { - "ref/netstandard1.4/System.Security.Cryptography.X509Certificates.dll": {} - }, - "compileOnly": true - }, - "system.security.principal/4.3.0": { - "dependencies": { - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.0/System.Security.Principal.dll": {} - }, - "compileOnly": true - }, - "system.security.principal.windows/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.Win32.Primitives": "4.3.0", - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.Handles": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Security.Claims": "4.3.0", - "System.Security.Principal": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Security.Principal.Windows.dll": {} - }, - "compileOnly": true - }, - "system.text.encoding/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Text.Encoding.dll": {} - }, - "compileOnly": true - }, - "system.text.encoding.extensions/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0", - "System.Text.Encoding": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Text.Encoding.Extensions.dll": {} - }, - "compileOnly": true - }, - "system.text.regularexpressions/4.3.0": { - "dependencies": { - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netcoreapp1.1/System.Text.RegularExpressions.dll": {} - }, - "compileOnly": true - }, - "system.threading/4.3.0": { - "dependencies": { - "System.Runtime": "4.3.0", - "System.Threading.Tasks": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Threading.dll": {} - }, - "compileOnly": true - }, - "system.threading.overlapped/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0" - }, - "compileOnly": true - }, - "system.threading.tasks/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Threading.Tasks.dll": {} - }, - "compileOnly": true - }, - "system.threading.tasks.dataflow/4.7.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Collections.Concurrent": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Dynamic.Runtime": "4.3.0", - "System.Linq": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0" - }, - "compile": { - "lib/netstandard1.1/System.Threading.Tasks.Dataflow.dll": {} - }, - "compileOnly": true - }, - "system.threading.tasks.extensions/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Runtime": "4.3.0", - "System.Threading.Tasks": "4.3.0" - }, - "compile": { - "lib/netstandard1.0/System.Threading.Tasks.Extensions.dll": {} - }, - "compileOnly": true - }, - "system.threading.tasks.parallel/4.3.0": { - "dependencies": { - "System.Collections.Concurrent": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.Tracing": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0", - "System.Threading.Tasks": "4.3.0" - }, - "compile": { - "ref/netstandard1.1/System.Threading.Tasks.Parallel.dll": {} - }, - "compileOnly": true - }, - "system.threading.thread/4.3.0": { - "dependencies": { - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Threading.Thread.dll": {} - }, - "compileOnly": true - }, - "system.threading.threadpool/4.3.0": { - "dependencies": { - "System.Runtime": "4.3.0", - "System.Runtime.Handles": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Threading.ThreadPool.dll": {} - }, - "compileOnly": true - }, - "system.threading.timer/4.3.0": { - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - }, - "compile": { - "ref/netstandard1.2/System.Threading.Timer.dll": {} - }, - "compileOnly": true - }, - "system.xml.readerwriter/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.IO.FileSystem": "4.3.0", - "System.IO.FileSystem.Primitives": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Runtime.InteropServices": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Text.Encoding.Extensions": "4.3.0", - "System.Text.RegularExpressions": "4.3.0", - "System.Threading.Tasks": "4.3.0", - "System.Threading.Tasks.Extensions": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Xml.ReaderWriter.dll": {} - }, - "compileOnly": true - }, - "system.xml.xdocument/4.3.0": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Diagnostics.Tools": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Reflection": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Xml.XDocument.dll": {} - }, - "compileOnly": true - }, - "system.xml.xmldocument/4.0.1": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Xml.XmlDocument.dll": {} - }, - "compileOnly": true - }, - "system.xml.xpath/4.0.1": { - "dependencies": { - "System.Collections": "4.3.0", - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.IO": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0" - }, - "compile": { - "ref/netstandard1.3/System.Xml.XPath.dll": {} - }, - "compileOnly": true - }, - "system.xml.xpath.xdocument/4.0.1": { - "dependencies": { - "System.Diagnostics.Debug": "4.3.0", - "System.Linq": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0", - "System.Xml.ReaderWriter": "4.3.0", - "System.Xml.XDocument": "4.3.0", - "System.Xml.XPath": "4.0.1" - }, - "compileOnly": true - } - } - }, - "libraries": { - "webapplication1/1.0.0": { - "type": "project", - "serviceable": false, - "sha512": "" - }, - "identitymodel/2.8.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-bVY5P/wNHvglbNwB3dsdI63sLa6GQAdhjynfRb7sBknbq0Rcz2s/u8VPT/k1+OqnMEjQE1RzRRIeHV0hj02poA==", - "path": "identitymodel/2.8.1", - "hashPath": "identitymodel.2.8.1.nupkg.sha512" - }, - "identitymodel.aspnetcore.oauth2introspection/2.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-uqgJCGLExfp0t4dfhIN5wXuO6vebGHu4yRBvUYV9aLCb4UecF/tYAaxjz2o+hRoJn6Ox4TRNsqaMSidEUPcNCg==", - "path": "identitymodel.aspnetcore.oauth2introspection/2.1.1", - "hashPath": "identitymodel.aspnetcore.oauth2introspection.2.1.1.nupkg.sha512" - }, - "identitymodel.aspnetcore.scopevalidation/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-zgChNvmTwjU0QFXcxNwnQhVA41SX01ummyuCHnsZr1NVSRUVrNKZHGyaMIB+dJtfJeuwUjTbiKafGU++s+La+Q==", - "path": "identitymodel.aspnetcore.scopevalidation/1.1.1", - "hashPath": "identitymodel.aspnetcore.scopevalidation.1.1.1.nupkg.sha512" - }, - "identityserver4.accesstokenvalidation/1.2.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-0Y6BMx4R73nV9MvUz9iTdRZmmnph/rVbsmaEzzjWq1UwBcs5fE3AKLhtUZgB3eGk6j2bMj95NTvvF1fq5Ah7gA==", - "path": "identityserver4.accesstokenvalidation/1.2.1", - "hashPath": "identityserver4.accesstokenvalidation.1.2.1.nupkg.sha512" - }, - "microsoft.applicationinsights/2.2.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-+JJ6qygUKQY2YnRfr0GlgdbKAhUqZhwd9zija0aKdDVQK60lQtnsBKzFY8/kMg0SH2MRXtmLkHG53oiNDQsLJQ==", - "path": "microsoft.applicationinsights/2.2.0", - "hashPath": "microsoft.applicationinsights.2.2.0.nupkg.sha512" - }, - "microsoft.applicationinsights.aspnetcore/2.0.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-6XR356YN/o9RveaYPfZpgMEHVOM2PBS09h87lxRgupQ136Z82AviP8EvHOUjstnBizKQOjpzMkxAsGvTu4HZgg==", - "path": "microsoft.applicationinsights.aspnetcore/2.0.1", - "hashPath": "microsoft.applicationinsights.aspnetcore.2.0.1.nupkg.sha512" - }, - "microsoft.aspnetcore/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Cna3kVQs0eNCUcXv0SXwZQm1PXhAW4SH6H2OPfjlFLCnKInkTxr9z0mXyTpk+5BGMvSfjwIe2ANvf4BPmCz/lA==", - "path": "microsoft.aspnetcore/1.1.2", - "hashPath": "microsoft.aspnetcore.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.antiforgery/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-h3Gq4YDBoCX4Yume1m93gS6x+8ay08nN4kJpap0iTcj1NbbOpiaTx3ngugnLxx+KZQvn61FabeK9SlsyApQduQ==", - "path": "microsoft.aspnetcore.antiforgery/1.1.2", - "hashPath": "microsoft.aspnetcore.antiforgery.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.authentication/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-6HBtCPApOJK9eMNH5X9eWvq7ofFqiEShkWOg9qwYsj5Lm2d7/yBvmwyQp9k98EnWByAbbEK7O3CVO3ECspNmiQ==", - "path": "microsoft.aspnetcore.authentication/1.1.2", - "hashPath": "microsoft.aspnetcore.authentication.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.authentication.jwtbearer/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-+RxT2GItuFrlUiMmvKUUwQAFPeIOEVycRo/GEiL5xvVpbtW3jqckSq5Ux4H+ML9WZhHJKYi+cWIEyqFgtoQh+g==", - "path": "microsoft.aspnetcore.authentication.jwtbearer/1.1.2", - "hashPath": "microsoft.aspnetcore.authentication.jwtbearer.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.authorization/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-AiJGulaUblwMcE7iAk+3zMz0RGwk8bkIZIj53TnqIP8mBV+WbkTq1O0lDmpWssyVl/wxScgeeNBqUj/DkSHqIg==", - "path": "microsoft.aspnetcore.authorization/1.1.2", - "hashPath": "microsoft.aspnetcore.authorization.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.cors/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-LklocRILh7GyaA6hD2n6UfrcI2FOzTOgsBWrmWQJy7PlgW/W7gaKyY9pzYF5TiqCdvZVuoazh6Wob2vSGv3HEQ==", - "path": "microsoft.aspnetcore.cors/1.1.2", - "hashPath": "microsoft.aspnetcore.cors.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.cryptography.internal/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-eqIu9z+iI+YwTGFSbYors4JCgrsq+BqFEaPsQ2bnRTMbYRm2z5scyx/X0U6kkPFKL/bx5QxUXvlxSwnD7ZRpdg==", - "path": "microsoft.aspnetcore.cryptography.internal/1.1.2", - "hashPath": "microsoft.aspnetcore.cryptography.internal.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.dataprotection/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-5lc59tq1VucPNJ6M/cGsigFK9glBRh79ep51Xk5CR/0GiLKl4WOCLclP40DNzm9GIc/TkXA4qR2GcHbiKeyLnA==", - "path": "microsoft.aspnetcore.dataprotection/1.1.2", - "hashPath": "microsoft.aspnetcore.dataprotection.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.dataprotection.abstractions/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-VVjX9kdLcjTvSqyCCxBJcoJcLG4BEpMvU9HK6xU5yOjg2DJKu9mH4pjUKpla/t0JHabj1hzrGkDReLSm2RJUlg==", - "path": "microsoft.aspnetcore.dataprotection.abstractions/1.1.2", - "hashPath": "microsoft.aspnetcore.dataprotection.abstractions.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.diagnostics/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-z7W08K6voY1DFPtvyosRB34WTr6vj8lATRuswT7R9DgaKVbwhqueHQSGSKrDXZGyw9Wh9kytPj0qjXmOdeU7/w==", - "path": "microsoft.aspnetcore.diagnostics/1.1.2", - "hashPath": "microsoft.aspnetcore.diagnostics.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.diagnostics.abstractions/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-aw1DtJ2oE9YKzt4WYbykFq3l0+3HuXFwV/oUQ3XAmlwof08CjioNtYEHly0cbp5csxmgPhdILwqiHLDMcgQdMQ==", - "path": "microsoft.aspnetcore.diagnostics.abstractions/1.1.2", - "hashPath": "microsoft.aspnetcore.diagnostics.abstractions.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.hosting/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-s9qYylD2SLA0i/JCj2ZUEjh+a6ZisF2haYpjBRxhy/XiTIUxkCoM1qw7IP0usrUo5qvbC1jXvhJYh6LClVQNgA==", - "path": "microsoft.aspnetcore.hosting/1.1.2", - "hashPath": "microsoft.aspnetcore.hosting.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.hosting.abstractions/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-qWOEO+AUjsBmvVaQ3ZW4WmWPzRqHUevOvsGzNwQcSkyY7GG8jLFS3B/7GbqzCn+SqEgOPlTGvBZCEzUuXOXSrw==", - "path": "microsoft.aspnetcore.hosting.abstractions/1.1.2", - "hashPath": "microsoft.aspnetcore.hosting.abstractions.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.hosting.server.abstractions/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-U8ZfrViTsgI5ZhFDzRlMHpNLV8E1o0CqYpigbnwZZIM2NNk7djwXuK4Apq394lst2ooIhydcCH76qfIUkULtuQ==", - "path": "microsoft.aspnetcore.hosting.server.abstractions/1.1.2", - "hashPath": "microsoft.aspnetcore.hosting.server.abstractions.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.html.abstractions/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-eV9CTfen1EOv4RV7YICRi09InuBpRQqYFRzst17BfvPTIvA9KikJCZ49JJQ0NjKspY1ognO5o5X9q03OWhMgsA==", - "path": "microsoft.aspnetcore.html.abstractions/1.1.2", - "hashPath": "microsoft.aspnetcore.html.abstractions.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.http/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-QxPOoZfl86WtRF2h3aMk++KwTGEJEDdCeQ8Oq+sKoFHg+M8jExwWhh17kGu3FcqEFfN4p6H9PJz45Z5jDqMltg==", - "path": "microsoft.aspnetcore.http/1.1.2", - "hashPath": "microsoft.aspnetcore.http.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.http.abstractions/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-mkqXobevZZ40fB8mv/nBbB0DytAiIK3L++Jj/SJzJ3qZBvyVs6TRlv9Tol2ysOOsQpIUC08Cuf6tRm1R6YBlGA==", - "path": "microsoft.aspnetcore.http.abstractions/1.1.2", - "hashPath": "microsoft.aspnetcore.http.abstractions.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.http.extensions/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-xlN7VjIx5ZReyz4WOfXUqQlF17lyvoNosGaLJ5B93lybUwvWH1PpD6Q90sNlKI+csCsYVeChTBxgvGWPxLAMvA==", - "path": "microsoft.aspnetcore.http.extensions/1.1.2", - "hashPath": "microsoft.aspnetcore.http.extensions.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.http.features/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-0Ehs2xpH4LXkHZGzHjDgibe5/MuIi174i9zPF5I1dDmfh3zEKsyFADWZmnzdI5KN2KPa8fxPiaXfoxBIcLaQKQ==", - "path": "microsoft.aspnetcore.http.features/1.1.2", - "hashPath": "microsoft.aspnetcore.http.features.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.httpoverrides/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-ioSBMpbFAdOFTMu2mDhr1WBp+Oo5jzfePUPsFHmONJHHy3A4vjMe5KKDskR3w22uuW2PoQqH+zImFE0C3fCTBw==", - "path": "microsoft.aspnetcore.httpoverrides/1.1.2", - "hashPath": "microsoft.aspnetcore.httpoverrides.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.jsonpatch/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-eD4eCbN7uD99JXPEtQJ4S9BX1f4PecdbUHPyD34aI6gAo5HNwMmqbgRYBwr0++v5zkmR2gUKxO2Ykot50w6Raw==", - "path": "microsoft.aspnetcore.jsonpatch/1.1.2", - "hashPath": "microsoft.aspnetcore.jsonpatch.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.localization/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-0aXacialQvq2sdfVHP704eHEwngOlRyiUmr1vR5eRJSWdxFyeYo7PAQH5e3FBxdwziDehu+sexho6Bsy+WLFXQ==", - "path": "microsoft.aspnetcore.localization/1.1.2", - "hashPath": "microsoft.aspnetcore.localization.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.mvc/1.1.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-sFfiMV9j7F5tlnpXz2frK7ubTeWDYMS+fYc1zXw0/maggGFyp3xPwUkivhXovIkyKdUTDZXTZvkFRVMji+HZBg==", - "path": "microsoft.aspnetcore.mvc/1.1.3", - "hashPath": "microsoft.aspnetcore.mvc.1.1.3.nupkg.sha512" - }, - "microsoft.aspnetcore.mvc.abstractions/1.1.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-7mcHx3KI9caAOjavh+mQ46TWJnY8GHEl/f8qTKGFysYZAPNPdXyg2VCi//k2A4ecICbBitetH0B7TdiyQ+GC4Q==", - "path": "microsoft.aspnetcore.mvc.abstractions/1.1.3", - "hashPath": "microsoft.aspnetcore.mvc.abstractions.1.1.3.nupkg.sha512" - }, - "microsoft.aspnetcore.mvc.apiexplorer/1.1.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-/AdwkC0Z53P3WK3UBp0ztQzaXnE62aG1ldVBHFAybRwqT1kFwxcFQsx3fAMmmvoKtzGzJ/2IK6Dvh50+EjjPaA==", - "path": "microsoft.aspnetcore.mvc.apiexplorer/1.1.3", - "hashPath": "microsoft.aspnetcore.mvc.apiexplorer.1.1.3.nupkg.sha512" - }, - "microsoft.aspnetcore.mvc.core/1.1.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-KXoNgdCInBr61HHVS2dO3E2j1gtbieHEGG74ZWkuuS4tFxOtzq8wu+KXDJXP35RMqvMI7J0P9ZuhdXG1pyQanQ==", - "path": "microsoft.aspnetcore.mvc.core/1.1.3", - "hashPath": "microsoft.aspnetcore.mvc.core.1.1.3.nupkg.sha512" - }, - "microsoft.aspnetcore.mvc.cors/1.1.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-agYJRUoyYHtmm9FtCFKhaiWAJLj3trE6yViJJUwaB4N401qffj1xmzVPahoZZCugBk/fU0cJLR8beYlD0xSqBg==", - "path": "microsoft.aspnetcore.mvc.cors/1.1.3", - "hashPath": "microsoft.aspnetcore.mvc.cors.1.1.3.nupkg.sha512" - }, - "microsoft.aspnetcore.mvc.dataannotations/1.1.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-2QUIKHUuHII80naUIxyv+tjxy7E1JZW3iuOgUguiMk9HkstSVJxq4m2sUPdOOiRqpFEiwJ4D3EbcEBv1eKYxEQ==", - "path": "microsoft.aspnetcore.mvc.dataannotations/1.1.3", - "hashPath": "microsoft.aspnetcore.mvc.dataannotations.1.1.3.nupkg.sha512" - }, - "microsoft.aspnetcore.mvc.formatters.json/1.1.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-hwxJwC6fG7Aesw1AqJeI9byEnGYB8dU5b33+4Io35sq7QCfi+mWmE0e1Bky4qfohaIV+OjaZ8y9ES1z8rIr2BQ==", - "path": "microsoft.aspnetcore.mvc.formatters.json/1.1.3", - "hashPath": "microsoft.aspnetcore.mvc.formatters.json.1.1.3.nupkg.sha512" - }, - "microsoft.aspnetcore.mvc.localization/1.1.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-jqz00aD6h+toHk+iWF0TsjSPSZEHsDeNMembchsozqw6NbcPQu/knvK0DhiKdzIFjbnaZ+PLpanU4LImlx/ONQ==", - "path": "microsoft.aspnetcore.mvc.localization/1.1.3", - "hashPath": "microsoft.aspnetcore.mvc.localization.1.1.3.nupkg.sha512" - }, - "microsoft.aspnetcore.mvc.razor/1.1.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-J5TokgrnUP0Z1n79djGvgEOvjzyP5zb27nGbv0mRegmH0higaYI/m3Xd8RfNhsSyOzhWSq9JsIvHD3+1uNRQOw==", - "path": "microsoft.aspnetcore.mvc.razor/1.1.3", - "hashPath": "microsoft.aspnetcore.mvc.razor.1.1.3.nupkg.sha512" - }, - "microsoft.aspnetcore.mvc.razor.host/1.1.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-/pOxVLFghEEtaKKHjbsDgrCVLCFUMnEDKv6HQ3zMRl3iCTyIf57vzbzG8t70dXAwEXOfkNtzxWXcQs5uC0gcRQ==", - "path": "microsoft.aspnetcore.mvc.razor.host/1.1.3", - "hashPath": "microsoft.aspnetcore.mvc.razor.host.1.1.3.nupkg.sha512" - }, - "microsoft.aspnetcore.mvc.taghelpers/1.1.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-CIVMrAG/8VkIqCjbHEntbGOImmBQkXU2QwUIZQaaBh+NsF26UW1ICfK+5sohmbPOkGZJCJ7jgBgH7eyr4roTcw==", - "path": "microsoft.aspnetcore.mvc.taghelpers/1.1.3", - "hashPath": "microsoft.aspnetcore.mvc.taghelpers.1.1.3.nupkg.sha512" - }, - "microsoft.aspnetcore.mvc.viewfeatures/1.1.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-c7A42n5W1cJx4CBvcUiQHSTX42MMwy7brjRKBEjPa8/8xI2SN4il0maBjU5qhyFeyIZSkVA/iQeLYg0Rem1nAw==", - "path": "microsoft.aspnetcore.mvc.viewfeatures/1.1.3", - "hashPath": "microsoft.aspnetcore.mvc.viewfeatures.1.1.3.nupkg.sha512" - }, - "microsoft.aspnetcore.razor/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-+3FxuH0T+48Wq8LQwyaAE5/bNrdVn6csEdsjaCwpRbdu+sACaUhksAmvwJPJri0TQtMn5tmFRzCIQfOKAuA+4A==", - "path": "microsoft.aspnetcore.razor/1.1.2", - "hashPath": "microsoft.aspnetcore.razor.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.razor.runtime/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-wfpsCiojTfftnIkZtEArdefnG32i8UHP8qRu5hD0r/amQWGNEOIm3Ygw5Sw9paIQg+hM0N+9dOV4AOvrmUMbYw==", - "path": "microsoft.aspnetcore.razor.runtime/1.1.2", - "hashPath": "microsoft.aspnetcore.razor.runtime.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.responsecaching.abstractions/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-PGgCMwFuuq/zp7RBJzs4CGbxASN4UGfRtd305i4ENlQgqdRucHJqvIbOg/Ov4bQeMoVICLyUdPROXs+SdgzgLw==", - "path": "microsoft.aspnetcore.responsecaching.abstractions/1.1.2", - "hashPath": "microsoft.aspnetcore.responsecaching.abstractions.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.routing/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-O5bX6HUs6W6iklfy4jhSRMnA3BZpdSmOGcjyGzFIyUAh2VQW4EscHRfgps5Hu+2quGJyV4twOmtRap4vbwSeeA==", - "path": "microsoft.aspnetcore.routing/1.1.2", - "hashPath": "microsoft.aspnetcore.routing.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.routing.abstractions/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-oFodoubpL0dTUbAc/5/RgrBp/k470xfBkXUSnzcQdvqlzdCIDhnIJCGJ5CIBKNkcJFNdqASqvR4bndtmF37eaA==", - "path": "microsoft.aspnetcore.routing.abstractions/1.1.2", - "hashPath": "microsoft.aspnetcore.routing.abstractions.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.server.iisintegration/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-79XxeDovmbIl4vnO80RHkVxMIJIkzbmuY4E2fo5wQPzRBRThAZTp78WAEaqeqTBY0pd3MtXGRYSJ0Y4lar10Hw==", - "path": "microsoft.aspnetcore.server.iisintegration/1.1.2", - "hashPath": "microsoft.aspnetcore.server.iisintegration.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.server.kestrel/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-2r/o16g8tyebnTmxQofSdN8c2ZNAN/decVeLYDuoZAKhPh9JKeEzrTvPqKUqRah0pnRHrgTdvbT/nq/UciWYbA==", - "path": "microsoft.aspnetcore.server.kestrel/1.1.2", - "hashPath": "microsoft.aspnetcore.server.kestrel.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.staticfiles/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-IzvHxW35BO/1zwxTT/1Q4+5/1xplGZxZwSvH3weK2DQg0GXbrfIjrcvCf9r2rh5NyplwGD1nr0Clfq12sxNNCA==", - "path": "microsoft.aspnetcore.staticfiles/1.1.2", - "hashPath": "microsoft.aspnetcore.staticfiles.1.1.2.nupkg.sha512" - }, - "microsoft.aspnetcore.webutilities/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Y6qJPRGmstUl9CJf8smw28+SVAnqPfRfG61TFzFJsdbksaP4kakUoTUcjzOnJHsqZ+K4DFXhiJ2A9g7OROvaDw==", - "path": "microsoft.aspnetcore.webutilities/1.1.2", - "hashPath": "microsoft.aspnetcore.webutilities.1.1.2.nupkg.sha512" - }, - "microsoft.codeanalysis.csharp.workspaces/1.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-wYqbzi7CEhj669g/QmBGKQdzqMDViz/7MeNAQwlbRZf8zhSQ8oYGDUXO0QaPfbpyarhVB1QOBnVdGr3c/mtibQ==", - "path": "microsoft.codeanalysis.csharp.workspaces/1.3.0", - "hashPath": "microsoft.codeanalysis.csharp.workspaces.1.3.0.nupkg.sha512" - }, - "microsoft.codeanalysis.workspaces.common/1.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-dfH9HlSgfjGMkHaaKRkO28ycwtruLpZfqHTb+LPqhQlsqaHUNG5x7ezzEMENKMepeqZq6KCFSGtFR5JgLXXoqA==", - "path": "microsoft.codeanalysis.workspaces.common/1.3.0", - "hashPath": "microsoft.codeanalysis.workspaces.common.1.3.0.nupkg.sha512" - }, - "microsoft.composition/1.0.27": { - "type": "package", - "serviceable": true, - "sha512": "sha512-pwu80Ohe7SBzZ6i69LVdzowp6V+LaVRzd5F7A6QlD42vQkX0oT7KXKWWPlM/S00w1gnMQMRnEdbtOV12z6rXdQ==", - "path": "microsoft.composition/1.0.27", - "hashPath": "microsoft.composition.1.0.27.nupkg.sha512" - }, - "microsoft.dotnet.platformabstractions/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-0pL3jZE8+Ksu/YVqiSR7wX4SG6ppYiqLWw6gXz63MwHQxsGT8tU4hNp8i9y5a1AM1SGAomtWJymTkWcdG5k4BQ==", - "path": "microsoft.dotnet.platformabstractions/1.1.2", - "hashPath": "microsoft.dotnet.platformabstractions.1.1.2.nupkg.sha512" - }, - "microsoft.entityframeworkcore/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-RqR1q5jJHPc90kN6E2QeEHt2OzwdBWgt+9wGJsK+TW3iVtpqUiBJiIfpm9Z3+AoszeXTvTGXpEQ/9zgh2btosQ==", - "path": "microsoft.entityframeworkcore/1.1.2", - "hashPath": "microsoft.entityframeworkcore.1.1.2.nupkg.sha512" - }, - "microsoft.entityframeworkcore.design/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-ijSD1CAqfrhHmu66emZy73LaSTl/WLc9Lvf1BzL60GmZTOpEbhEJsDjB0BpbyCdQtahu0WooMIGgoXsXRxVnCw==", - "path": "microsoft.entityframeworkcore.design/1.1.2", - "hashPath": "microsoft.entityframeworkcore.design.1.1.2.nupkg.sha512" - }, - "microsoft.entityframeworkcore.relational/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-FPODGiLRuMUO4OyTLi8BictN7oPaRheriy83BYhHYedLluiuD0UinCjD/RxbJsJQS1OFftoQf72LPLmqAhhkew==", - "path": "microsoft.entityframeworkcore.relational/1.1.2", - "hashPath": "microsoft.entityframeworkcore.relational.1.1.2.nupkg.sha512" - }, - "microsoft.entityframeworkcore.relational.design/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-5cKh4pGN9fvQSFuS1/IZTy4evsTP4P3Xg5+UZ/ZEEa1Rc3z6WAN/LW2QqylPSdD8eadTNpdKkFrUxL7QP2Jr3g==", - "path": "microsoft.entityframeworkcore.relational.design/1.1.2", - "hashPath": "microsoft.entityframeworkcore.relational.design.1.1.2.nupkg.sha512" - }, - "microsoft.entityframeworkcore.sqlserver/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-/PpnI2G7zitSAjCtDqVjElhKM3Gpxc+9Su6OhYqYavZS/Ouc/bNAWsoWEj/tbeYSGMUdZyjeAm9xKKJSF/h3Dw==", - "path": "microsoft.entityframeworkcore.sqlserver/1.1.2", - "hashPath": "microsoft.entityframeworkcore.sqlserver.1.1.2.nupkg.sha512" - }, - "microsoft.entityframeworkcore.sqlserver.design/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-OmFK0Qr2saaQNjz4ilp0f5mYQ1ORvtAjaU+H/TQdU4EMcSoaFs2LEebyNLn0hpt452+7x89D9bD3f6J34k7YyQ==", - "path": "microsoft.entityframeworkcore.sqlserver.design/1.1.2", - "hashPath": "microsoft.entityframeworkcore.sqlserver.design.1.1.2.nupkg.sha512" - }, - "microsoft.entityframeworkcore.tools/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-d50Y7pFv0dAUzgBM0mrvjBAW6+AFSa2Cp0fbYl7fibCOZ3J+hUxQ0gkuY+u4uiK+vzi3TuDSVamkl2YLwmQ56Q==", - "path": "microsoft.entityframeworkcore.tools/1.1.1", - "hashPath": "microsoft.entityframeworkcore.tools.1.1.1.nupkg.sha512" - }, - "microsoft.extensions.caching.abstractions/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-vHcEbjbtbLahMgZl9+OXlSgT+p7VOL+I1GEqfuUFWLIXACCbg85d1bHmJBYcq51wEW8z6FBOje1R4d0WQGfTqw==", - "path": "microsoft.extensions.caching.abstractions/1.1.2", - "hashPath": "microsoft.extensions.caching.abstractions.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.caching.memory/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-dLubgx06WSdLeiUhb4npKeIngdPCtmkYk7W/hoN+ioTYC4giLfjRx18/ec/kLmLzAB3EX7TI2HKi5Mj5fQGWvA==", - "path": "microsoft.extensions.caching.memory/1.1.2", - "hashPath": "microsoft.extensions.caching.memory.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.commandlineutils/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-vsI1L6Bx602aQ/8051nrRbAWGxCQQX7IKT/9XApnEYfzLPBX7LcCZuwnDyD1bHTm2D8GcMweVSPr1H2rAfAgbA==", - "path": "microsoft.extensions.commandlineutils/1.1.1", - "hashPath": "microsoft.extensions.commandlineutils.1.1.1.nupkg.sha512" - }, - "microsoft.extensions.configuration/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-5yNq/It7GmCQeg4JEnDsqXZb4uz8ys+e+7CyxCNW3n2LD8/QQgJHLFZeh4vankwSs3iPWGjudF4TjW/4pYeu9w==", - "path": "microsoft.extensions.configuration/1.1.2", - "hashPath": "microsoft.extensions.configuration.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.configuration.abstractions/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-G7UrVjVmTBGKDOz3A6wp5McZAe+1qibieDUllHtDRbngBdij7/68UvWQ1ZLCFiM7cIBuxDs7uWRJ2oCretQtgw==", - "path": "microsoft.extensions.configuration.abstractions/1.1.2", - "hashPath": "microsoft.extensions.configuration.abstractions.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.configuration.binder/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-bL8RKGZXzJHHLtH3fEDnA2XFm6muCX4EBsuPMkJlMOCX99SMX1mgxJSug36mGUHLDsRONlA6pC+cIS/VN6JU0Q==", - "path": "microsoft.extensions.configuration.binder/1.1.2", - "hashPath": "microsoft.extensions.configuration.binder.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.configuration.environmentvariables/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-6GdkM3IuNhKEQAyZ2HkZH4lBeOZdlnhU3vrzPHHGGrGpSbs2RwUrCZeaGcQwE74siYv8If7CtKz1bWJaCigX2w==", - "path": "microsoft.extensions.configuration.environmentvariables/1.1.2", - "hashPath": "microsoft.extensions.configuration.environmentvariables.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.configuration.fileextensions/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-GbpnipPOd/HwbNlcd3N0PaEQCYTonvUgvNs2Nr6h7fL2CLMWvtIOgby3IuC+pieX+HGT/wQy052ELO3CoiJi7g==", - "path": "microsoft.extensions.configuration.fileextensions/1.1.2", - "hashPath": "microsoft.extensions.configuration.fileextensions.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.configuration.json/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-n6C0EdSRlF5ctNyvYMQh7i54juLDeDa7D3HJYSXU/gsOFC1El/cDMe+qeqOGTeuEUCtfonmIxT9e/GxHZR4nvg==", - "path": "microsoft.extensions.configuration.json/1.1.2", - "hashPath": "microsoft.extensions.configuration.json.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.dependencyinjection/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-azPfb900AhOAwAcv8Yey388wMDRpNSWkSY21fftXI0/swx1I2CE8Pmf6HcHvDJeFOJ9I3JAXrThvu4yy95IO/A==", - "path": "microsoft.extensions.dependencyinjection/1.1.1", - "hashPath": "microsoft.extensions.dependencyinjection.1.1.1.nupkg.sha512" - }, - "microsoft.extensions.dependencyinjection.abstractions/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-dfMN6nPX9sdrZKFAoElS7zIstiqQuydovXTWmCQH8Et1yv6rvgpRqNCTyAxp17YI9xkQUAcLwWuaXTMnh3TwLw==", - "path": "microsoft.extensions.dependencyinjection.abstractions/1.1.1", - "hashPath": "microsoft.extensions.dependencyinjection.abstractions.1.1.1.nupkg.sha512" - }, - "microsoft.extensions.dependencymodel/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-stV/qd6yC/ip1spPugUfb2ssQkOmplXi4ohzvjjvAduc0JW02AVKbPgZlbwyexDWvsPWVwlc5yudpcjIZlmtVA==", - "path": "microsoft.extensions.dependencymodel/1.1.2", - "hashPath": "microsoft.extensions.dependencymodel.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.diagnosticadapter/1.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-GGI4Pp9DpRBFlAXDcZRz5e+R+TqLFBWzToTDXqxPjQiRq6DwPvDYuKD10rlJD4QxxeX8fcjakTlKO1RfC+DmFg==", - "path": "microsoft.extensions.diagnosticadapter/1.0.0", - "hashPath": "microsoft.extensions.diagnosticadapter.1.0.0.nupkg.sha512" - }, - "microsoft.extensions.fileproviders.abstractions/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-O4Y9QCbRhLPiG4OpntHYNpHVwo0mjRYjZ1WRmcgC47ZA5zP8VfAmUNmeedQCOzvZS4R18QG6r4SKeFpyrnk7uw==", - "path": "microsoft.extensions.fileproviders.abstractions/1.1.1", - "hashPath": "microsoft.extensions.fileproviders.abstractions.1.1.1.nupkg.sha512" - }, - "microsoft.extensions.fileproviders.composite/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-9VdrtVd+jXDETMu8sSOz1EkPHgbI0A8AKLiFPK9JmQ1BKl7nBDdlRlcKw8HaYNI5ZDEKdhABaCJV0dxQw8odhg==", - "path": "microsoft.extensions.fileproviders.composite/1.1.1", - "hashPath": "microsoft.extensions.fileproviders.composite.1.1.1.nupkg.sha512" - }, - "microsoft.extensions.fileproviders.embedded/1.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-mMCI3/BLXAyBCDneqOI4ohETd0IXjbXZdoiCm1dYdnOdV193ByEOCFQ6/Vn9RVdU5UlC4Nn1P4J5Df7pXG/vGg==", - "path": "microsoft.extensions.fileproviders.embedded/1.0.0", - "hashPath": "microsoft.extensions.fileproviders.embedded.1.0.0.nupkg.sha512" - }, - "microsoft.extensions.fileproviders.physical/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-XnnEdKSfGhNfKicPcnrvfJGCDkFUF2gXcMFKhbZfi3RxqXEE0+mne6OBskuR3hhYeS21KpH3b/m7zqpXsw+x6A==", - "path": "microsoft.extensions.fileproviders.physical/1.1.1", - "hashPath": "microsoft.extensions.fileproviders.physical.1.1.1.nupkg.sha512" - }, - "microsoft.extensions.filesystemglobbing/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-eG0mV7gF9wcQ86KzfYo4Z6ux7T5tk7jQFLCT6Q14UNxAouvg2el1s8A7W4NUYlxXHcOqzSQJQrnDYXXirztkbQ==", - "path": "microsoft.extensions.filesystemglobbing/1.1.1", - "hashPath": "microsoft.extensions.filesystemglobbing.1.1.1.nupkg.sha512" - }, - "microsoft.extensions.globalization.cultureinfocache/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-yTPAwuWaZE9L0COQq3cu9/rZb+3iauN+VjBiwI+NI6fW+73TtyHZTCOp+s/X/FGh1nN32ka3ZnAz7swG9/E0Kw==", - "path": "microsoft.extensions.globalization.cultureinfocache/1.1.2", - "hashPath": "microsoft.extensions.globalization.cultureinfocache.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.localization/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-2rufzyiIZFcHz79Wt0tm+Trv89W5Wuc5re2TeqCPz/Uwx9O/jGAKeb2ec7qDj0hXKQO5VI/kJwRnT4qzs7luAg==", - "path": "microsoft.extensions.localization/1.1.2", - "hashPath": "microsoft.extensions.localization.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.localization.abstractions/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-VZRZcqcJP5dr+uxXfTgLZt1cxmDJSK2BoGB+tY/kBNcyDlxijnYF26tUl84HOpp9lF4ikPE07BsaeXUF1VVMcQ==", - "path": "microsoft.extensions.localization.abstractions/1.1.2", - "hashPath": "microsoft.extensions.localization.abstractions.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.logging/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-3VtEJo2MNuLiZIE8ftZrfd5/vdtM9jIBRI3AP02a3nd5aw9yzkXgkaIfN/cYLMW4OZEjdtnu7fIqnhSLNhp5bA==", - "path": "microsoft.extensions.logging/1.1.2", - "hashPath": "microsoft.extensions.logging.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.logging.abstractions/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Mt8pnWMLY/7/wrt74F7lsgFSxt0qRLATNU7qEw1y3uUmvIyedKwbIsAo51thIBgwtLFEvfD6foThX1oQXWlJ1w==", - "path": "microsoft.extensions.logging.abstractions/1.1.2", - "hashPath": "microsoft.extensions.logging.abstractions.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.logging.console/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Ohpfw72y9FX7dH77AOKIqfjnX6uZ68jir9V/9ryACQFPr5GYZd2QM7vZoVuMu8zro0r6MqvCTaE855UebLL+yQ==", - "path": "microsoft.extensions.logging.console/1.1.2", - "hashPath": "microsoft.extensions.logging.console.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.logging.debug/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-8dYXrR0xIbZpNneeFb03C4MoumEf/HrtfZybhg3BHdQBNHiUgAl+r8cm5revNejXwfhJm9MuXmCJoXxYfmyOfg==", - "path": "microsoft.extensions.logging.debug/1.1.2", - "hashPath": "microsoft.extensions.logging.debug.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.objectpool/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-OHmpU9+gqq0OMUcnA4JJlejHzOrUeLxT8FluS4aVR0ryT4gOInXYQ0pQbKx2ZBeWGcQM1JvaShod3AZB/jBvTQ==", - "path": "microsoft.extensions.objectpool/1.1.1", - "hashPath": "microsoft.extensions.objectpool.1.1.1.nupkg.sha512" - }, - "microsoft.extensions.options/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-WVjPxm/zEkW9YAL4r2XfNk4SFqwnO3ZGOt5akRsoAqj0Etk4nXhAvF4uuAa/n84tFT9tWiN8feis1ovq0HB6eg==", - "path": "microsoft.extensions.options/1.1.2", - "hashPath": "microsoft.extensions.options.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.options.configurationextensions/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-fWDLzVUbIx+CkV43NW6TjHQIUNJWpRJYNemZ1f73YCYBSFpD2K3ToWti8y4d1lLIKDRVMJ5N1jA959gDk/OfPg==", - "path": "microsoft.extensions.options.configurationextensions/1.1.2", - "hashPath": "microsoft.extensions.options.configurationextensions.1.1.2.nupkg.sha512" - }, - "microsoft.extensions.platformabstractions/1.1.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-H6ZsQzxYw/6k2DfEQRXdC+vQ6obd6Uba3uGJrnJ2vG4PRXjQZ7seB13JdCfE72abp8E6Fk3gGgDzfJiLZi5ZpQ==", - "path": "microsoft.extensions.platformabstractions/1.1.0", - "hashPath": "microsoft.extensions.platformabstractions.1.1.0.nupkg.sha512" - }, - "microsoft.extensions.primitives/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-RQqb40axQBpez35ViI3EHHfuA8VhMY26vJTrVhmROdeWgd4o9laZR/Hhh3xhIzju8VbXqCwb5J2XgNS0o7B1fQ==", - "path": "microsoft.extensions.primitives/1.1.1", - "hashPath": "microsoft.extensions.primitives.1.1.1.nupkg.sha512" - }, - "microsoft.extensions.webencoders/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-bED4eHsgf10pCRehGR7RZOVEpUzpBn6zmngwNnGrWGT4OsQQTr4ZygsXqQ7OysDNpGTqydKh1gyTo1fjSj/fwQ==", - "path": "microsoft.extensions.webencoders/1.1.2", - "hashPath": "microsoft.extensions.webencoders.1.1.2.nupkg.sha512" - }, - "microsoft.identitymodel.logging/1.1.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-2QS51c01mQVcy2Jsx7E3g1A2aXt3HBTN1in4YcBAFbIgfXkVIwquGAlaw1H+UwM2BvPajs5DCeyvMrse6Uxshw==", - "path": "microsoft.identitymodel.logging/1.1.3", - "hashPath": "microsoft.identitymodel.logging.1.1.3.nupkg.sha512" - }, - "microsoft.identitymodel.protocols/2.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-DYjTihC3VrzhXiv2cdoAxBx2RhFphad5BXfwmebdt3aNqrUpCOfsfYN7Ivequ05MiNBfgjBfWf8pd0+6S8jSCA==", - "path": "microsoft.identitymodel.protocols/2.1.2", - "hashPath": "microsoft.identitymodel.protocols.2.1.2.nupkg.sha512" - }, - "microsoft.identitymodel.protocols.openidconnect/2.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-oiB2Of9DWmmrWUiAX1MEjybrdQ0EpJq0FbtpxGuytecVaMmfIu1xzVEKrzmqxCSp25Ct+gtLVtDsdgOsgYA0TQ==", - "path": "microsoft.identitymodel.protocols.openidconnect/2.1.2", - "hashPath": "microsoft.identitymodel.protocols.openidconnect.2.1.2.nupkg.sha512" - }, - "microsoft.identitymodel.tokens/5.1.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-bmfaPlcQEtYVuu440OSzY8IxSM5dFyyDmFnZ9aLjswtkPilD/NOvCWQDV9krwNsfL/ge7B+s+omaS2xhIYL8TQ==", - "path": "microsoft.identitymodel.tokens/5.1.3", - "hashPath": "microsoft.identitymodel.tokens.5.1.3.nupkg.sha512" - }, - "microsoft.net.http.headers/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-UpyFicGRNt0qbVuYDRYTSV5j+/Ji16IPX8i8XQNlXq8OL+05gp6J62ieXXzNTbaCV0354GLSs3Sh07x98FG7Yg==", - "path": "microsoft.net.http.headers/1.1.2", - "hashPath": "microsoft.net.http.headers.1.1.2.nupkg.sha512" - }, - "microsoft.visualstudio.web.browserlink/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-jgtLrBUiswxzoItakwZElnvDpeelaBJCDnjk5Ox4PAkt0FBXpFCXwZVppLqlN/P0XtZniPdqsrCXaQNNKDCADw==", - "path": "microsoft.visualstudio.web.browserlink/1.1.2", - "hashPath": "microsoft.visualstudio.web.browserlink.1.1.2.nupkg.sha512" - }, - "microsoft.visualstudio.web.codegeneration/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-i6WsYTApeai/OhTmYwiackdX5NmVw4ivA282Fr0nx4PZZijhymtLtQfDdxoHukfn7BZ2R/r/n6D1mxl9ctOdsg==", - "path": "microsoft.visualstudio.web.codegeneration/1.1.1", - "hashPath": "microsoft.visualstudio.web.codegeneration.1.1.1.nupkg.sha512" - }, - "microsoft.visualstudio.web.codegeneration.core/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-rSuFEdLuz/ZHlq69iD0ClTx+JLsrkqr1yMrfNaeZMzkV7XpPQR/v5y/JqCQA0QHy/2ATCxegBDikReDn4BxHHg==", - "path": "microsoft.visualstudio.web.codegeneration.core/1.1.1", - "hashPath": "microsoft.visualstudio.web.codegeneration.core.1.1.1.nupkg.sha512" - }, - "microsoft.visualstudio.web.codegeneration.design/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-algsvbwWnVZv6BzMjjX1jkD32mJr/BgPq6yaQXGJhdxzuHeV4+aXRlNKMvt+3lSiVNE65cyPkAiEJouKoIYWCA==", - "path": "microsoft.visualstudio.web.codegeneration.design/1.1.1", - "hashPath": "microsoft.visualstudio.web.codegeneration.design.1.1.1.nupkg.sha512" - }, - "microsoft.visualstudio.web.codegeneration.entityframeworkcore/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-IZlEGpmG+03zddyMUx+mOQNF2M5xffqrfgth9+X3UjX8aUm1xO7DdsNXi4vWjoo/0iVwEbK0d0lFK74hNAMQcQ==", - "path": "microsoft.visualstudio.web.codegeneration.entityframeworkcore/1.1.1", - "hashPath": "microsoft.visualstudio.web.codegeneration.entityframeworkcore.1.1.1.nupkg.sha512" - }, - "microsoft.visualstudio.web.codegeneration.templating/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-B9vqcfOIUnLdsDDEozyAhnsfWOT56al5phdef1vcreIofD+I6I64yCVCTWuu6xjC4MlmJbuX85SFozAIhVmCGA==", - "path": "microsoft.visualstudio.web.codegeneration.templating/1.1.1", - "hashPath": "microsoft.visualstudio.web.codegeneration.templating.1.1.1.nupkg.sha512" - }, - "microsoft.visualstudio.web.codegeneration.utils/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-w3rSP4nt4PeMmza6b/cQUtxmZLJjqYUc40g6mnGkPOa2tQo0Ktv0ETosAWY9gsu6axq2k3URPL/7fDdGjkYqbA==", - "path": "microsoft.visualstudio.web.codegeneration.utils/1.1.1", - "hashPath": "microsoft.visualstudio.web.codegeneration.utils.1.1.1.nupkg.sha512" - }, - "microsoft.visualstudio.web.codegenerators.mvc/1.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-AiibXtei0iwulN89jt8gfh7IAP6QxIJOaUNjNq5/dE1A9lQEe6VxmJ/lmWRXDyTtgS3OYM7t88xqpGb8KXj+Aw==", - "path": "microsoft.visualstudio.web.codegenerators.mvc/1.1.1", - "hashPath": "microsoft.visualstudio.web.codegenerators.mvc.1.1.1.nupkg.sha512" - }, - "newtonsoft.json/9.0.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-U82mHQSKaIk+lpSVCbWYKNavmNH1i5xrExDEquU1i6I5pV6UMOqRnJRSlKO3cMPfcpp0RgDY+8jUXHdQ4IfXvw==", - "path": "newtonsoft.json/9.0.1", - "hashPath": "newtonsoft.json.9.0.1.nupkg.sha512" - }, - "nlog/5.0.0-beta07": { - "type": "package", - "serviceable": true, - "sha512": "sha512-TQYyCV1pE/+SiW6Slp9DWkyUfEvFgL6GxLS3VvUbVwRSV4vfIgaS5Mn4wzJ+RmkF6qWDb2t7DNr/TjRTDrKCpg==", - "path": "nlog/5.0.0-beta07", - "hashPath": "nlog.5.0.0-beta07.nupkg.sha512" - }, - "nlog.extensions.logging/1.0.0-rtm-beta5": { - "type": "package", - "serviceable": true, - "sha512": "sha512-mxNlf98H/Nq2PgQWVnAAL0K13Q1F+eKTW46qwAje2HdQJYSoKaNzPkihzRnW+4vxgrTfL3e1uBw3gVcZaEU6Xw==", - "path": "nlog.extensions.logging/1.0.0-rtm-beta5", - "hashPath": "nlog.extensions.logging.1.0.0-rtm-beta5.nupkg.sha512" - }, - "nuget.frameworks/3.5.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-mj7pCguESABXPe27wleBICqbo1h0nm1bdfQN9GSUnKOdWI2QNhE3AB0SvAWrD0PYanzG65thsbCeB/uLj+XSwg==", - "path": "nuget.frameworks/3.5.0", - "hashPath": "nuget.frameworks.3.5.0.nupkg.sha512" - }, - "remotion.linq/2.1.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-IJn0BqkvwEDpP+2qjvci7n4/a9f7DhKESLWb2/uG4xQh3rTkGTBUz69bI4IivCoKkTFAqjXxYDZw2K/npohjsw==", - "path": "remotion.linq/2.1.1", - "hashPath": "remotion.linq.2.1.1.nupkg.sha512" - }, - "runtime.native.system.data.sqlclient.sni/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-rX1bLxiHjj+ivd4bL9RwCvKM7agWHceLrAFsPQryTX0ZZ1J7x6vSz779YgMih0S4yD/GTvr7+dajBVutzJVvBg==", - "path": "runtime.native.system.data.sqlclient.sni/4.3.0", - "hashPath": "runtime.native.system.data.sqlclient.sni.4.3.0.nupkg.sha512" - }, - "runtime.win7-x64.runtime.native.system.data.sqlclient.sni/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-j42JRgYOMi6B86attv8F3eDBISh+kzoKxLsu0zaq1ioY+je64chWd8fybvk9yPzayO3Dh1czhmf5B7rbafLRQA==", - "path": "runtime.win7-x64.runtime.native.system.data.sqlclient.sni/4.3.0", - "hashPath": "runtime.win7-x64.runtime.native.system.data.sqlclient.sni.4.3.0.nupkg.sha512" - }, - "runtime.win7-x86.runtime.native.system.data.sqlclient.sni/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-4cXRTIcttvIreAoqK/5hzTtzepeggac+m5A0rzH+9zLtnFh2J0rLuGeJR4KjNLyKqPzO0kjqrs5lkRJEKX8HAA==", - "path": "runtime.win7-x86.runtime.native.system.data.sqlclient.sni/4.3.0", - "hashPath": "runtime.win7-x86.runtime.native.system.data.sqlclient.sni.4.3.0.nupkg.sha512" - }, - "swashbuckle.aspnetcore/1.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-pYppc+iPifsAYUWi+UoblnjFkUtfP9RZfj5JQaUmEgiWRz5RsCcIuKHvNCGG5AojVKfgjWC4naUPJx4fCjqvDg==", - "path": "swashbuckle.aspnetcore/1.0.0", - "hashPath": "swashbuckle.aspnetcore.1.0.0.nupkg.sha512" - }, - "swashbuckle.aspnetcore.swagger/1.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-tzZ6tXjopV6jvcHzOX7PjyYBWqof5mhJUXqxb/kPF17Z5LXxr+uglnTLlYOjWCm5BfvdxWYtU95uJgc14L1Eqw==", - "path": "swashbuckle.aspnetcore.swagger/1.0.0", - "hashPath": "swashbuckle.aspnetcore.swagger.1.0.0.nupkg.sha512" - }, - "swashbuckle.aspnetcore.swaggergen/1.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-1kuKS+4x1m85gpTOqICp5BRZB3Ir6VsegPN9hanH6xRp+tGDQNfFhVNPZ59Wrl8gM8YqIhB85xmFAkK68CqVdA==", - "path": "swashbuckle.aspnetcore.swaggergen/1.0.0", - "hashPath": "swashbuckle.aspnetcore.swaggergen.1.0.0.nupkg.sha512" - }, - "swashbuckle.aspnetcore.swaggerui/1.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-syirndQQePJXF8Dgzgjqt0AoxWVguPQy/p4siHNACBSGicxvk6AAd1ULIFE83ANJOCl2GmXuAvNAZBMXGbxK9A==", - "path": "swashbuckle.aspnetcore.swaggerui/1.0.0", - "hashPath": "swashbuckle.aspnetcore.swaggerui.1.0.0.nupkg.sha512" - }, - "system.collections.nongeneric/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-YE+SX3UVNn/i9KvEQWNdCpEtaLG/343BROU9pD+vV0wphjXOiw++rTyhEn4iagEGTY4y7uKt4m0sV9WK0MerBw==", - "path": "system.collections.nongeneric/4.3.0", - "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" - }, - "system.collections.specialized/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-UPL2gu5g5REegkZVDBSgflJ1vUqTXaH/t1EHPfTvAvWy/lsoiWUfyPdWpinqbp0CFfn4T9hTPhAmlIufxYqS1g==", - "path": "system.collections.specialized/4.3.0", - "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" - }, - "system.componentmodel.primitives/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", - "path": "system.componentmodel.primitives/4.3.0", - "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" - }, - "system.componentmodel.typeconverter/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", - "path": "system.componentmodel.typeconverter/4.3.0", - "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" - }, - "system.data.common/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-BxZDr/C8Jen00RX8MCU0sWymjSf+2wVkLh/qvjvi6BfsWbtd02IGJudfdFlg+CEYizjNr38X3i622Pi8arwSvg==", - "path": "system.data.common/4.3.0", - "hashPath": "system.data.common.4.3.0.nupkg.sha512" - }, - "system.data.sqlclient/4.3.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-FllDZf1liw5++vWf3d73tskt04trlGXb0UwEps/kvGxuKi0QnzcMLmBoXHulzhluvlLg7oIam3+mIsqcxHgj0A==", - "path": "system.data.sqlclient/4.3.1", - "hashPath": "system.data.sqlclient.4.3.1.nupkg.sha512" - }, - "system.diagnostics.contracts/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-eelRRbnm+OloiQvp9CXS0ixjNQldjjkHO4iIkR5XH2VIP8sUB/SIpa1TdUW6/+HDcQ+MlhP3pNa1u5SbzYuWGA==", - "path": "system.diagnostics.contracts/4.3.0", - "hashPath": "system.diagnostics.contracts.4.3.0.nupkg.sha512" - }, - "system.diagnostics.stacktrace/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-K10cNOYrG5WW68FwfPL/nEMkTAX3UQf/8YR0kH8lUzINkWNDkf3vIDFfACIsV8LMMLer+zCM4ZAfc1dSpjbP3Q==", - "path": "system.diagnostics.stacktrace/4.3.0", - "hashPath": "system.diagnostics.stacktrace.4.3.0.nupkg.sha512" - }, - "system.diagnostics.tracesource/4.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-6WVCczFZKXwpWpzd/iJkYnsmWTSFFiU24Xx/YdHXBcu+nFI/ehTgeqdJQFbtRPzbrO3KtRNjvkhtj4t5/WwWsA==", - "path": "system.diagnostics.tracesource/4.0.0", - "hashPath": "system.diagnostics.tracesource.4.0.0.nupkg.sha512" - }, - "system.identitymodel.tokens.jwt/5.1.3": { - "type": "package", - "serviceable": true, - "sha512": "sha512-4vQI+9vjMmcg4GJM2N9udsAc7d+Eu/yEZQgp/henwx3moZUD8PGq2uGo224UNQrVwQuI/YLlBOusZUVqCqdRHA==", - "path": "system.identitymodel.tokens.jwt/5.1.3", - "hashPath": "system.identitymodel.tokens.jwt.5.1.3.nupkg.sha512" - }, - "system.interactive.async/3.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-UEM+WmG1Oq0bNbPx/E1jaIQ83QOrPfVDUyuYBtG6D6DpB77ytv9flPterMujumpHuoRjSc0ilSB8w41fQc05dw==", - "path": "system.interactive.async/3.0.0", - "hashPath": "system.interactive.async.3.0.0.nupkg.sha512" - }, - "system.io.filesystem.accesscontrol/4.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-I80oVypfOvG0y0D8d0/0X/RIcAbJaFkTToy9sRJdVDVIAEImgMBEmSxxs8XpCP0PByWhOpxjRjcaGHdvNTbIUg==", - "path": "system.io.filesystem.accesscontrol/4.0.0", - "hashPath": "system.io.filesystem.accesscontrol.4.0.0.nupkg.sha512" - }, - "system.io.pipes/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-wpGJuACA6r8+KRckXoI6ghGTwgPRiICI6T7kgHI/m7S5eMqV/8jH37fzAUhTwIe9RwlH/j1sWwm2Q2zyXwZGHw==", - "path": "system.io.pipes/4.3.0", - "hashPath": "system.io.pipes.4.3.0.nupkg.sha512" - }, - "system.net.websockets/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-u6fFNY5q4T8KerUAVbya7bR6b7muBuSTAersyrihkcmE5QhEOiH3t5rh4il15SexbVlpXFHGuMwr/m8fDrnkQg==", - "path": "system.net.websockets/4.3.0", - "hashPath": "system.net.websockets.4.3.0.nupkg.sha512" - }, - "system.runtime.compilerservices.unsafe/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-rcnXA1U9W3QUtMSGoyoNHH6w4V5Rxa/EKXmzpORUYlDAlDB34hIQoU57ATXl8xHa83VvzRm6PcElEizgUd7U5w==", - "path": "system.runtime.compilerservices.unsafe/4.3.0", - "hashPath": "system.runtime.compilerservices.unsafe.4.3.0.nupkg.sha512" - }, - "system.runtime.serialization.primitives/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", - "path": "system.runtime.serialization.primitives/4.3.0", - "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" - }, - "system.security.accesscontrol/4.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-xsTykIpBOWK9q3XLrnvE7WoWtCQ4DKvGliAJ13uzsN8qIwMuYMEuSNXxdJsygYA+AM3dVJUjDbgPwZgOvp1gGQ==", - "path": "system.security.accesscontrol/4.0.0", - "hashPath": "system.security.accesscontrol.4.0.0.nupkg.sha512" - }, - "system.text.encoding.codepages/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-IRiEFUa5b/Gs5Egg8oqBVoywhtOeaO2KOx3j0RfcYY/raxqBuEK7NXRDgOwtYM8qbi+7S4RPXUbNt+ZxyY0/NQ==", - "path": "system.text.encoding.codepages/4.3.0", - "hashPath": "system.text.encoding.codepages.4.3.0.nupkg.sha512" - }, - "system.text.encodings.web/4.3.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-/lTEdu7keMTKBiq3lXfrr2VVq8wFx4oTFzHu3xQKt7B+PmTTQEtgxnrHZGJ7nZsB3RIY2hnZvo6vFnpWCxRUEA==", - "path": "system.text.encodings.web/4.3.1", - "hashPath": "system.text.encodings.web.4.3.1.nupkg.sha512" - }, - "system.threading.accesscontrol/4.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-s9XhOgYcI0KsoLXEs78nXhK+S/l79tJeZzBEthpYyFLPW362ksFrVkDONrGsMLCZXPZl0uwk5nSTLhAdbJuXfA==", - "path": "system.threading.accesscontrol/4.0.0", - "hashPath": "system.threading.accesscontrol.4.0.0.nupkg.sha512" - }, - "system.valuetuple/4.3.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-xzDmg26Wb2x2rFDjwziaMYQJqxhrK+b4OUC008o7CnZhUMb2p5XfwgOgAQ/WlKhqxMUSDWRUm5/lNTKdh27pJA==", - "path": "system.valuetuple/4.3.1", - "hashPath": "system.valuetuple.4.3.1.nupkg.sha512" - }, - "libuv/1.9.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-uqX2Frwf9PW8MaY7PRNY6HM5BpW1D8oj1EdqzrmbEFD5nH63Yat3aEjN/tws6Tw6Fk7LwmLBvtUh32tTeTaHiA==", - "path": "libuv/1.9.1", - "hashPath": "libuv.1.9.1.nupkg.sha512" - }, - "microsoft.codeanalysis.analyzers/1.1.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-HS3iRWZKcUw/8eZ/08GXKY2Bn7xNzQPzf8gRPHGSowX7u7XXu9i9YEaBeBNKUXWfI7qjvT2zXtLUvbN0hds8vg==", - "path": "microsoft.codeanalysis.analyzers/1.1.0", - "hashPath": "microsoft.codeanalysis.analyzers.1.1.0.nupkg.sha512" - }, - "microsoft.codeanalysis.common/1.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-V09G35cs0CT1C4Dr1IEOh8IGfnWALEVAOO5JXsqagxXwmYR012TlorQ+vx2eXxfZRKs3gAS/r92gN9kRBLba5A==", - "path": "microsoft.codeanalysis.common/1.3.0", - "hashPath": "microsoft.codeanalysis.common.1.3.0.nupkg.sha512" - }, - "microsoft.codeanalysis.csharp/1.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-BgWDIAbSFsHuGeLSn/rljLi51nXqkSo4DZ0qEIrHyPVasrhxEVq7aV8KKZ3HEfSFB+GIhBmOogE+mlOLYg19eg==", - "path": "microsoft.codeanalysis.csharp/1.3.0", - "hashPath": "microsoft.codeanalysis.csharp.1.3.0.nupkg.sha512" - }, - "microsoft.codeanalysis.visualbasic/1.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Sf3k8PkTkWqBmXnnblJbvb7ewO6mJzX6WO2t7m04BmOY5qBq6yhhyXnn/BMM+QCec3Arw3X35Zd8f9eBql0qgg==", - "path": "microsoft.codeanalysis.visualbasic/1.3.0", - "hashPath": "microsoft.codeanalysis.visualbasic.1.3.0.nupkg.sha512" - }, - "microsoft.csharp/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA==", - "path": "microsoft.csharp/4.3.0", - "hashPath": "microsoft.csharp.4.3.0.nupkg.sha512" - }, - "microsoft.diasymreader.native/1.4.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-oi9LCkKzSm7WgI0LsODDQUQdzldNdv9BU/QDoW9QMu+uN4baJXANkTWrjc2+aTqeftyhPXF1fn/m9jPo7mJ6FA==", - "path": "microsoft.diasymreader.native/1.4.1", - "hashPath": "microsoft.diasymreader.native.1.4.1.nupkg.sha512" - }, - "microsoft.netcore.app/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-TUPK1xhef7WcbsIkhfZOz6J7DrG5aebjVRBswPfHe90eDhfnlWHaLiI1OtMB2O78bf5d37WO6ge+9nel2keKkA==", - "path": "microsoft.netcore.app/1.1.2", - "hashPath": "microsoft.netcore.app.1.1.2.nupkg.sha512" - }, - "microsoft.netcore.dotnethost/1.1.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-1xk/a9uXjJWDQqXw8l4067aoNwUfugq4UVQQinlIM2W4posm0+wcW+bi3uKuyufsjG6KBhlCqKuFBqa5DXO6ug==", - "path": "microsoft.netcore.dotnethost/1.1.0", - "hashPath": "microsoft.netcore.dotnethost.1.1.0.nupkg.sha512" - }, - "microsoft.netcore.dotnethostpolicy/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-fD2UWfXXY+FgPWVqvpNo2/d7b/LHYl1/aepVimYYkVsuF4CczP8hgCJIlKiUbWF/d98xCMtz7bbuv6LkGfdfeQ==", - "path": "microsoft.netcore.dotnethostpolicy/1.1.2", - "hashPath": "microsoft.netcore.dotnethostpolicy.1.1.2.nupkg.sha512" - }, - "microsoft.netcore.dotnethostresolver/1.1.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-xf7RRVJ4M1w1Hg9TTzTH4g+zFqGtu6uXBjpcyy+o5UYrRj44dtJkmlnc1OnoKQFU0pZ8i9C8eNbSeqq/p6n19w==", - "path": "microsoft.netcore.dotnethostresolver/1.1.0", - "hashPath": "microsoft.netcore.dotnethostresolver.1.1.0.nupkg.sha512" - }, - "microsoft.netcore.jit/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-mgCxxN+3/0tNuF29pUCbjS3ag4DDmgxwYQXvGW4wyD5N7bAUysxOvMw7Fx/eQZKoCh5cH5LQ0w/5/o6vQmMhRQ==", - "path": "microsoft.netcore.jit/1.1.2", - "hashPath": "microsoft.netcore.jit.1.1.2.nupkg.sha512" - }, - "microsoft.netcore.platforms/1.1.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==", - "path": "microsoft.netcore.platforms/1.1.0", - "hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512" - }, - "microsoft.netcore.runtime.coreclr/1.1.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-3O8EaWa5E+xDmNqVqmbrfxy6x+QQ87XPXv47sek1jkRrFac7j+ObsH0URWJRHJt/5nJpvEN7sb2KG0o/AM9nvg==", - "path": "microsoft.netcore.runtime.coreclr/1.1.2", - "hashPath": "microsoft.netcore.runtime.coreclr.1.1.2.nupkg.sha512" - }, - "microsoft.netcore.targets/1.1.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==", - "path": "microsoft.netcore.targets/1.1.0", - "hashPath": "microsoft.netcore.targets.1.1.0.nupkg.sha512" - }, - "microsoft.netcore.windows.apisets/1.0.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-SaToCvvsGMxTgtLv/BrFQ5IFMPRE1zpWbnqbpwykJa8W5XiX82CXI6K2o7yf5xS7EP6t/JzFLV0SIDuWpvBZVw==", - "path": "microsoft.netcore.windows.apisets/1.0.1", - "hashPath": "microsoft.netcore.windows.apisets.1.0.1.nupkg.sha512" - }, - "microsoft.visualbasic/10.1.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-jgBfelga8QHZDTtUBtLNgcDPuXzaplCeXLqQcf5qB4jeVdPpX1AtnZnGeHbbi2tmp+P96hgI+KhXbUN567K60Q==", - "path": "microsoft.visualbasic/10.1.0", - "hashPath": "microsoft.visualbasic.10.1.0.nupkg.sha512" - }, - "microsoft.win32.primitives/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", - "path": "microsoft.win32.primitives/4.3.0", - "hashPath": "microsoft.win32.primitives.4.3.0.nupkg.sha512" - }, - "microsoft.win32.registry/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==", - "path": "microsoft.win32.registry/4.3.0", - "hashPath": "microsoft.win32.registry.4.3.0.nupkg.sha512" - }, - "netstandard.library/1.6.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-WcSp3+vP+yHNgS8EV5J7pZ9IRpeDuARBPN28by8zqff1wJQXm26PVU8L3/fYLBJVU7BtDyqNVWq2KlCVvSSR4A==", - "path": "netstandard.library/1.6.1", - "hashPath": "netstandard.library.1.6.1.nupkg.sha512" - }, - "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-oDfS0Alq+mluluapkR7A3rPd9bieNhwNzrJCPC2VEfJ2kzSm4tHuGObp+Ybk7l9jIyvM3K7SNNPtkphoGFA9jw==", - "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.1", - "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.1.nupkg.sha512" - }, - "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-0dxcIxhroiZzcekjl4MmbubRN4oNx5XuegS09A1foTs4c9TS8EV5AEZJGkN/WiPKIF7RnRk3b8mRflnv2SQp5Q==", - "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.1", - "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.1.nupkg.sha512" - }, - "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-0k5qPXl0zs6yzc6IQYPbcQlrTdLEP2Mcs9AGcrMh8jq7pOfzL9B3xwc/e/EJPVITju3YsT+BNOI5voeOKY/KuA==", - "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.1", - "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.1.nupkg.sha512" - }, - "runtime.native.system/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", - "path": "runtime.native.system/4.3.0", - "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" - }, - "runtime.native.system.io.compression/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-INBPonS5QPEgn7naufQFXJEp3zX6L4bwHgJ/ZH78aBTpeNfQMtf7C6VrAFhlq2xxWBveIOWyFzQjJ8XzHMhdOQ==", - "path": "runtime.native.system.io.compression/4.3.0", - "hashPath": "runtime.native.system.io.compression.4.3.0.nupkg.sha512" - }, - "runtime.native.system.net.http/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", - "path": "runtime.native.system.net.http/4.3.0", - "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" - }, - "runtime.native.system.net.security/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-M2nN92ePS8BgQ2oi6Jj3PlTUzadYSIWLdZrHY1n1ZcW9o4wAQQ6W+aQ2lfq1ysZQfVCgDwY58alUdowrzezztg==", - "path": "runtime.native.system.net.security/4.3.0", - "hashPath": "runtime.native.system.net.security.4.3.0.nupkg.sha512" - }, - "runtime.native.system.security.cryptography.apple/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", - "path": "runtime.native.system.security.cryptography.apple/4.3.0", - "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" - }, - "runtime.native.system.security.cryptography.openssl/4.3.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-ZFr1MDwzRCYWA883RSjxB4exm8bHlqQjI+yRdYd7zCvFAh2t1107U0ONRgn1zf5Bte2kowThZHE9DVdvuKlBsw==", - "path": "runtime.native.system.security.cryptography.openssl/4.3.1", - "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.1.nupkg.sha512" - }, - "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-aNIww1R7bC0tk/2u4Gtrom6afjlJlGsFm7mko/ymrbmdYIyso5cPBXjGaj2qIHup8p53LTvX4ED9mxMaK4guLQ==", - "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.1", - "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.1.nupkg.sha512" - }, - "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-ipj8GE8R8qgVm3ta13cTVQRR7LVj11x7SbC4Cpu5rgAEwoXcujwqHcWOhb+8KPMPNLTXWdZcwmv7d7HLayAF3w==", - "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.1", - "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.1.nupkg.sha512" - }, - "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", - "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", - "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" - }, - "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-l8EbzaU7q/YF/JArw7wzbKw7Bd3vxL4WUu9X4WGXfJYRIOe45i5wW+XbAVSkfghucM/eYKFb6/hNio7+N0AIkg==", - "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.1", - "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.1.nupkg.sha512" - }, - "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-4S+URvA5tdIA8DxsYe/+Neffgzbfl4WaZK6I1nLEzqRxfSuTqjVySBagCQSCnGkJsSMrjbZwtRu8K1I1pbbSJg==", - "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.1", - "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.1.nupkg.sha512" - }, - "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-G1OTN/JU9rdQz9fj1eLHOLs7+8lFp7bp+H89h8AEV/Wa4kVZVwoi6DqnjEjJfFWjYZvGPDi9o95VWjeKG5gLkg==", - "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.1", - "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.1.nupkg.sha512" - }, - "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-rbS6BNuxMvqAT0Sa4AlvHlHyWT4+1vtZHO9+R2A0udgOTIgIWu2+mKJVDO4AcHjCVVqB6WqSGcAQLx3QoXBy4Q==", - "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.1", - "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.1.nupkg.sha512" - }, - "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-SjraAtZSVwYLpU+pFfSoflen6k9jZ8p7sojFfyXUKprFc7iSN+jjl0qUT1maZBQHv8bAX0nrUaQhZnWsLY8v9w==", - "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.1", - "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.1.nupkg.sha512" - }, - "system.appcontext/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-fKC+rmaLfeIzUhagxY17Q9siv/sPrjjKcfNg1Ic8IlQkZLipo8ljcaZQu4VtI4Jqbzjc2VTjzGLF6WmsRXAEgA==", - "path": "system.appcontext/4.3.0", - "hashPath": "system.appcontext.4.3.0.nupkg.sha512" - }, - "system.buffers/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-ratu44uTIHgeBeI0dE8DWvmXVBSo4u7ozRZZHOMmK/JPpYyo0dAfgSiHlpiObMQ5lEtEyIXA40sKRYg5J6A8uQ==", - "path": "system.buffers/4.3.0", - "hashPath": "system.buffers.4.3.0.nupkg.sha512" - }, - "system.collections/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", - "path": "system.collections/4.3.0", - "hashPath": "system.collections.4.3.0.nupkg.sha512" - }, - "system.collections.concurrent/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", - "path": "system.collections.concurrent/4.3.0", - "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" - }, - "system.collections.immutable/1.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-zukBRPUuNxwy9m4TGWLxKAnoiMc9+B+8VXeXVyPiBPvOd7yLgAlZ1DlsRWJjMx4VsvhhF2+6q6kO2GRbPja6hA==", - "path": "system.collections.immutable/1.3.0", - "hashPath": "system.collections.immutable.1.3.0.nupkg.sha512" - }, - "system.componentmodel/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", - "path": "system.componentmodel/4.3.0", - "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" - }, - "system.componentmodel.annotations/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-SY2RLItHt43rd8J9D8M8e8NM4m+9WLN2uUd9G0n1I4hj/7w+v3pzK6ZBjexlG1/2xvLKQsqir3UGVSyBTXMLWA==", - "path": "system.componentmodel.annotations/4.3.0", - "hashPath": "system.componentmodel.annotations.4.3.0.nupkg.sha512" - }, - "system.console/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-DHDrIxiqk1h03m6khKWV2X8p/uvN79rgSqpilL6uzpmSfxfU5ng8VcPtW4qsDsQDHiTv6IPV9TmD5M/vElPNLg==", - "path": "system.console/4.3.0", - "hashPath": "system.console.4.3.0.nupkg.sha512" - }, - "system.diagnostics.debug/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", - "path": "system.diagnostics.debug/4.3.0", - "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" - }, - "system.diagnostics.diagnosticsource/4.3.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-j72A3mwamUXPgDIU1TWyzea7yqz59+iO2cmXuyzvcfuszWGq9JRbWify1k33lLQophaXOIyhPkEevfP0k4M3wg==", - "path": "system.diagnostics.diagnosticsource/4.3.1", - "hashPath": "system.diagnostics.diagnosticsource.4.3.1.nupkg.sha512" - }, - "system.diagnostics.fileversioninfo/4.0.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-qjF74OTAU+mRhLaL4YSfiWy3vj6T3AOz8AW37l5zCwfbBfj0k7E94XnEsRaf2TnhE/7QaV6Hvqakoy2LoV8MVg==", - "path": "system.diagnostics.fileversioninfo/4.0.0", - "hashPath": "system.diagnostics.fileversioninfo.4.0.0.nupkg.sha512" - }, - "system.diagnostics.process/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==", - "path": "system.diagnostics.process/4.3.0", - "hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512" - }, - "system.diagnostics.tools/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", - "path": "system.diagnostics.tools/4.3.0", - "hashPath": "system.diagnostics.tools.4.3.0.nupkg.sha512" - }, - "system.diagnostics.tracing/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", - "path": "system.diagnostics.tracing/4.3.0", - "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" - }, - "system.dynamic.runtime/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", - "path": "system.dynamic.runtime/4.3.0", - "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" - }, - "system.globalization/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", - "path": "system.globalization/4.3.0", - "hashPath": "system.globalization.4.3.0.nupkg.sha512" - }, - "system.globalization.calendars/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", - "path": "system.globalization.calendars/4.3.0", - "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" - }, - "system.globalization.extensions/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", - "path": "system.globalization.extensions/4.3.0", - "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" - }, - "system.io/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", - "path": "system.io/4.3.0", - "hashPath": "system.io.4.3.0.nupkg.sha512" - }, - "system.io.compression/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-YHndyoiV90iu4iKG115ibkhrG+S3jBm8Ap9OwoUAzO5oPDAWcr0SFwQFm0HjM8WkEZWo0zvLTyLmbvTkW1bXgg==", - "path": "system.io.compression/4.3.0", - "hashPath": "system.io.compression.4.3.0.nupkg.sha512" - }, - "system.io.compression.zipfile/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-G4HwjEsgIwy3JFBduZ9quBkAu+eUwjIdJleuNSgmUojbH6O3mlvEIme+GHx/cLlTAPcrnnL7GqvB9pTlWRfhOg==", - "path": "system.io.compression.zipfile/4.3.0", - "hashPath": "system.io.compression.zipfile.4.3.0.nupkg.sha512" - }, - "system.io.filesystem/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", - "path": "system.io.filesystem/4.3.0", - "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" - }, - "system.io.filesystem.primitives/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", - "path": "system.io.filesystem.primitives/4.3.0", - "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" - }, - "system.io.filesystem.watcher/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-37IDFU2w6LJ4FrohcVlV1EXviUmAOJIbejVgOUtNaPQyeZW2D/0QSkH8ykehoOd19bWfxp3RRd0xj+yRRIqLhw==", - "path": "system.io.filesystem.watcher/4.3.0", - "hashPath": "system.io.filesystem.watcher.4.3.0.nupkg.sha512" - }, - "system.io.memorymappedfiles/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-mz2JJFxCQLdMzXVOPyVibDKDKFZey66YHgQy8M1/vUCQzMSrbiXhpsyV04vSlBeqQUdM7wTL2WG+X3GZALKsIQ==", - "path": "system.io.memorymappedfiles/4.3.0", - "hashPath": "system.io.memorymappedfiles.4.3.0.nupkg.sha512" - }, - "system.io.unmanagedmemorystream/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-tS89nK7pw8ebkkEfWujA05+ZReHKzz39W+bcX1okVR0GJCJuzPyfYfQZyiLSrjp121BB5J4uewZQiUTKri2pSQ==", - "path": "system.io.unmanagedmemorystream/4.3.0", - "hashPath": "system.io.unmanagedmemorystream.4.3.0.nupkg.sha512" - }, - "system.linq/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", - "path": "system.linq/4.3.0", - "hashPath": "system.linq.4.3.0.nupkg.sha512" - }, - "system.linq.expressions/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", - "path": "system.linq.expressions/4.3.0", - "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" - }, - "system.linq.parallel/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-td7x21K8LalpjTWCzW/nQboQIFbq9i0r+PCyBBCdLWWnm4NBcdN18vpz/G9hCpUaCIfRL+ZxJNVTywlNlB1aLQ==", - "path": "system.linq.parallel/4.3.0", - "hashPath": "system.linq.parallel.4.3.0.nupkg.sha512" - }, - "system.linq.queryable/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-In1Bmmvl/j52yPu3xgakQSI0YIckPUr870w4K5+Lak3JCCa8hl+my65lABOuKfYs4ugmZy25ScFerC4nz8+b6g==", - "path": "system.linq.queryable/4.3.0", - "hashPath": "system.linq.queryable.4.3.0.nupkg.sha512" - }, - "system.net.http/4.3.2": { - "type": "package", - "serviceable": true, - "sha512": "sha512-y7hv0o0weI0j0mvEcBOdt1F3CAADiWlcw3e54m8TfYiRmBPDIsHElx8QUPDlY4x6yWXKPGN0Z2TuXCTPgkm5WQ==", - "path": "system.net.http/4.3.2", - "hashPath": "system.net.http.4.3.2.nupkg.sha512" - }, - "system.net.nameresolution/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-AFYl08R7MrsrEjqpQWTZWBadqXyTzNDaWpMqyxhb0d6sGhV6xMDKueuBXlLL30gz+DIRY6MpdgnHWlCh5wmq9w==", - "path": "system.net.nameresolution/4.3.0", - "hashPath": "system.net.nameresolution.4.3.0.nupkg.sha512" - }, - "system.net.primitives/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-qOu+hDwFwoZPbzPvwut2qATe3ygjeQBDQj91xlsaqGFQUI5i4ZnZb8yyQuLGpDGivEPIt8EJkd1BVzVoP31FXA==", - "path": "system.net.primitives/4.3.0", - "hashPath": "system.net.primitives.4.3.0.nupkg.sha512" - }, - "system.net.requests/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-OZNUuAs0kDXUzm7U5NZ1ojVta5YFZmgT2yxBqsQ7Eseq5Ahz88LInGRuNLJ/NP2F8W1q7tse1pKDthj3reF5QA==", - "path": "system.net.requests/4.3.0", - "hashPath": "system.net.requests.4.3.0.nupkg.sha512" - }, - "system.net.security/4.3.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-qYnDntmrrHXUAhA+v2Kve8onMjJ2ZryQvx7kjGhW88c0IgA9B+q2M8b3l76HFBeotufDbAJfOvLEP32PS4XIKA==", - "path": "system.net.security/4.3.1", - "hashPath": "system.net.security.4.3.1.nupkg.sha512" - }, - "system.net.sockets/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-m6icV6TqQOAdgt5N/9I5KNpjom/5NFtkmGseEH+AK/hny8XrytLH3+b5M8zL/Ycg3fhIocFpUMyl/wpFnVRvdw==", - "path": "system.net.sockets/4.3.0", - "hashPath": "system.net.sockets.4.3.0.nupkg.sha512" - }, - "system.net.webheadercollection/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-XZrXYG3c7QV/GpWeoaRC02rM6LH2JJetfVYskf35wdC/w2fFDFMphec4gmVH2dkll6abtW14u9Rt96pxd9YH2A==", - "path": "system.net.webheadercollection/4.3.0", - "hashPath": "system.net.webheadercollection.4.3.0.nupkg.sha512" - }, - "system.numerics.vectors/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-uAIqmwiQPPXdCz59MQcyHwsH2MzIv24VGCS54kP/1GzTRTuU3hazmiPnGUTlKFia4B1DnbLWjTHoGyTI5BMCTQ==", - "path": "system.numerics.vectors/4.3.0", - "hashPath": "system.numerics.vectors.4.3.0.nupkg.sha512" - }, - "system.objectmodel/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", - "path": "system.objectmodel/4.3.0", - "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" - }, - "system.reflection/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", - "path": "system.reflection/4.3.0", - "hashPath": "system.reflection.4.3.0.nupkg.sha512" - }, - "system.reflection.dispatchproxy/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-vFln4g7zbLRyJbioExbMaW4BGuE2urDE2IKQk02x1y1uhQWntD+4rcYA4xQGJ19PlMdYPMWExHVQj3zKDODBFw==", - "path": "system.reflection.dispatchproxy/4.3.0", - "hashPath": "system.reflection.dispatchproxy.4.3.0.nupkg.sha512" - }, - "system.reflection.emit/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", - "path": "system.reflection.emit/4.3.0", - "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" - }, - "system.reflection.emit.ilgeneration/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", - "path": "system.reflection.emit.ilgeneration/4.3.0", - "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" - }, - "system.reflection.emit.lightweight/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", - "path": "system.reflection.emit.lightweight/4.3.0", - "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" - }, - "system.reflection.extensions/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", - "path": "system.reflection.extensions/4.3.0", - "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" - }, - "system.reflection.metadata/1.4.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-tc2ZyJgweHCLci5oQGuhQn9TD0Ii9DReXkHtZm3aAGp8xe40rpRjiTbMXOtZU+fr0BOQ46goE9+qIqRGjR9wGg==", - "path": "system.reflection.metadata/1.4.1", - "hashPath": "system.reflection.metadata.1.4.1.nupkg.sha512" - }, - "system.reflection.primitives/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", - "path": "system.reflection.primitives/4.3.0", - "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" - }, - "system.reflection.typeextensions/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", - "path": "system.reflection.typeextensions/4.3.0", - "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" - }, - "system.resources.reader/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-AeSwdrdgsRnGRJDofYEJPlotJm6gDDg6WJ1/1lX2Yq8bPwicba7lanPi7adK0SE58zgN5PcGg/h0tuZS+IRAdw==", - "path": "system.resources.reader/4.3.0", - "hashPath": "system.resources.reader.4.3.0.nupkg.sha512" - }, - "system.resources.resourcemanager/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", - "path": "system.resources.resourcemanager/4.3.0", - "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" - }, - "system.runtime/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", - "path": "system.runtime/4.3.0", - "hashPath": "system.runtime.4.3.0.nupkg.sha512" - }, - "system.runtime.extensions/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", - "path": "system.runtime.extensions/4.3.0", - "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" - }, - "system.runtime.handles/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", - "path": "system.runtime.handles/4.3.0", - "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" - }, - "system.runtime.interopservices/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", - "path": "system.runtime.interopservices/4.3.0", - "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" - }, - "system.runtime.interopservices.runtimeinformation/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-cbz4YJMqRDR7oLeMRbdYv7mYzc++17lNhScCX0goO2XpGWdvAt60CGN+FHdePUEHCe/Jy9jUlvNAiNdM+7jsOw==", - "path": "system.runtime.interopservices.runtimeinformation/4.3.0", - "hashPath": "system.runtime.interopservices.runtimeinformation.4.3.0.nupkg.sha512" - }, - "system.runtime.loader/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-DHMaRn8D8YCK2GG2pw+UzNxn/OHVfaWx7OTLBD/hPegHZZgcZh3H6seWegrC4BYwsfuGrywIuT+MQs+rPqRLTQ==", - "path": "system.runtime.loader/4.3.0", - "hashPath": "system.runtime.loader.4.3.0.nupkg.sha512" - }, - "system.runtime.numerics/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", - "path": "system.runtime.numerics/4.3.0", - "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" - }, - "system.security.claims/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-P/+BR/2lnc4PNDHt/TPBAWHVMLMRHsyYZbU1NphW4HIWzCggz8mJbTQQ3MKljFE7LS3WagmVFuBgoLcFzYXlkA==", - "path": "system.security.claims/4.3.0", - "hashPath": "system.security.claims.4.3.0.nupkg.sha512" - }, - "system.security.cryptography.algorithms/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", - "path": "system.security.cryptography.algorithms/4.3.0", - "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" - }, - "system.security.cryptography.cng/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", - "path": "system.security.cryptography.cng/4.3.0", - "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" - }, - "system.security.cryptography.csp/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", - "path": "system.security.cryptography.csp/4.3.0", - "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" - }, - "system.security.cryptography.encoding/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", - "path": "system.security.cryptography.encoding/4.3.0", - "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" - }, - "system.security.cryptography.openssl/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", - "path": "system.security.cryptography.openssl/4.3.0", - "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" - }, - "system.security.cryptography.primitives/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", - "path": "system.security.cryptography.primitives/4.3.0", - "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" - }, - "system.security.cryptography.x509certificates/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", - "path": "system.security.cryptography.x509certificates/4.3.0", - "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" - }, - "system.security.principal/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-I1tkfQlAoMM2URscUtpcRo/hX0jinXx6a/KUtEQoz3owaYwl3qwsO8cbzYVVnjxrzxjHo3nJC+62uolgeGIS9A==", - "path": "system.security.principal/4.3.0", - "hashPath": "system.security.principal.4.3.0.nupkg.sha512" - }, - "system.security.principal.windows/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-HVL1rvqYtnRCxFsYag/2le/ZfKLK4yMw79+s6FmKXbSCNN0JeAhrYxnRAHFoWRa0dEojsDcbBSpH3l22QxAVyw==", - "path": "system.security.principal.windows/4.3.0", - "hashPath": "system.security.principal.windows.4.3.0.nupkg.sha512" - }, - "system.text.encoding/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", - "path": "system.text.encoding/4.3.0", - "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" - }, - "system.text.encoding.extensions/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", - "path": "system.text.encoding.extensions/4.3.0", - "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" - }, - "system.text.regularexpressions/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", - "path": "system.text.regularexpressions/4.3.0", - "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" - }, - "system.threading/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", - "path": "system.threading/4.3.0", - "hashPath": "system.threading.4.3.0.nupkg.sha512" - }, - "system.threading.overlapped/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-m3HQ2dPiX/DSTpf+yJt8B0c+SRvzfqAJKx+QDWi+VLhz8svLT23MVjEOHPF/KiSLeArKU/iHescrbLd3yVgyNg==", - "path": "system.threading.overlapped/4.3.0", - "hashPath": "system.threading.overlapped.4.3.0.nupkg.sha512" - }, - "system.threading.tasks/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", - "path": "system.threading.tasks/4.3.0", - "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" - }, - "system.threading.tasks.dataflow/4.7.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-wcKLDI8tN5KpcMcTQwXfcLHrFdfINIxDBOZS3rE8QqOds/0fRhCkR+IEfQokxT7s/Yluqk+LG/ZqZdQmA/xgCw==", - "path": "system.threading.tasks.dataflow/4.7.0", - "hashPath": "system.threading.tasks.dataflow.4.7.0.nupkg.sha512" - }, - "system.threading.tasks.extensions/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-npvJkVKl5rKXrtl1Kkm6OhOUaYGEiF9wFbppFRWSMoApKzt2PiPHT2Bb8a5sAWxprvdOAtvaARS9QYMznEUtug==", - "path": "system.threading.tasks.extensions/4.3.0", - "hashPath": "system.threading.tasks.extensions.4.3.0.nupkg.sha512" - }, - "system.threading.tasks.parallel/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-cbjBNZHf/vQCfcdhzx7knsiygoCKgxL8mZOeocXZn5gWhCdzHIq6bYNKWX0LAJCWYP7bds4yBK8p06YkP0oa0g==", - "path": "system.threading.tasks.parallel/4.3.0", - "hashPath": "system.threading.tasks.parallel.4.3.0.nupkg.sha512" - }, - "system.threading.thread/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==", - "path": "system.threading.thread/4.3.0", - "hashPath": "system.threading.thread.4.3.0.nupkg.sha512" - }, - "system.threading.threadpool/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", - "path": "system.threading.threadpool/4.3.0", - "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" - }, - "system.threading.timer/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-Z6YfyYTCg7lOZjJzBjONJTFKGN9/NIYKSxhU5GRd+DTwHSZyvWp1xuI5aR+dLg+ayyC5Xv57KiY4oJ0tMO89fQ==", - "path": "system.threading.timer/4.3.0", - "hashPath": "system.threading.timer.4.3.0.nupkg.sha512" - }, - "system.xml.readerwriter/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", - "path": "system.xml.readerwriter/4.3.0", - "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" - }, - "system.xml.xdocument/4.3.0": { - "type": "package", - "serviceable": true, - "sha512": "sha512-5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", - "path": "system.xml.xdocument/4.3.0", - "hashPath": "system.xml.xdocument.4.3.0.nupkg.sha512" - }, - "system.xml.xmldocument/4.0.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-2eZu6IP+etFVBBFUFzw2w6J21DqIN5eL9Y8r8JfJWUmV28Z5P0SNU01oCisVHQgHsDhHPnmq2s1hJrJCFZWloQ==", - "path": "system.xml.xmldocument/4.0.1", - "hashPath": "system.xml.xmldocument.4.0.1.nupkg.sha512" - }, - "system.xml.xpath/4.0.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-UWd1H+1IJ9Wlq5nognZ/XJdyj8qPE4XufBUkAW59ijsCPjZkZe0MUzKKJFBr+ZWBe5Wq1u1d5f2CYgE93uH7DA==", - "path": "system.xml.xpath/4.0.1", - "hashPath": "system.xml.xpath.4.0.1.nupkg.sha512" - }, - "system.xml.xpath.xdocument/4.0.1": { - "type": "package", - "serviceable": true, - "sha512": "sha512-FLhdYJx4331oGovQypQ8JIw2kEmNzCsjVOVYY/16kZTUoquZG85oVn7yUhBE2OZt1yGPSXAL0HTEfzjlbNpM7Q==", - "path": "system.xml.xpath.xdocument/4.0.1", - "hashPath": "system.xml.xpath.xdocument.4.0.1.nupkg.sha512" - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.Tests/Issue807/input/WebApplication1.dll b/src/NSwag.Integration.Tests/Issue807/input/WebApplication1.dll deleted file mode 100644 index 2de4ea5ff6..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/WebApplication1.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/WebApplication1.pdb b/src/NSwag.Integration.Tests/Issue807/input/WebApplication1.pdb deleted file mode 100644 index 97ae25aa22..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/WebApplication1.pdb and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/WebApplication1.runtimeconfig.json b/src/NSwag.Integration.Tests/Issue807/input/WebApplication1.runtimeconfig.json deleted file mode 100644 index e0731364f8..0000000000 --- a/src/NSwag.Integration.Tests/Issue807/input/WebApplication1.runtimeconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "runtimeOptions": { - "framework": { - "name": "Microsoft.NETCore.App", - "version": "1.1.2" - }, - "configProperties": { - "System.GC.Server": true - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.Tests/Issue807/input/appsettings.Development.json b/src/NSwag.Integration.Tests/Issue807/input/appsettings.Development.json deleted file mode 100644 index fa8ce71a97..0000000000 --- a/src/NSwag.Integration.Tests/Issue807/input/appsettings.Development.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/src/NSwag.Integration.Tests/Issue807/input/appsettings.json b/src/NSwag.Integration.Tests/Issue807/input/appsettings.json deleted file mode 100644 index 5fff67bacc..0000000000 --- a/src/NSwag.Integration.Tests/Issue807/input/appsettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Warning" - } - } -} diff --git a/src/NSwag.Integration.Tests/Issue807/input/dotnet-aspnet-codegenerator-design.dll b/src/NSwag.Integration.Tests/Issue807/input/dotnet-aspnet-codegenerator-design.dll deleted file mode 100644 index dcc9230d32..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/dotnet-aspnet-codegenerator-design.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.CSharp.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.CSharp.dll deleted file mode 100644 index 3e2c049184..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.CSharp.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.CodeAnalysis.CSharp.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.CodeAnalysis.CSharp.dll deleted file mode 100644 index d9ac0e277e..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.CodeAnalysis.CSharp.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.CodeAnalysis.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.CodeAnalysis.dll deleted file mode 100644 index 6e4775e5d2..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.CodeAnalysis.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.VisualBasic.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.VisualBasic.dll deleted file mode 100644 index b2d174c7af..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.VisualBasic.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.Win32.Primitives.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.Win32.Primitives.dll deleted file mode 100644 index 67a45a7a6d..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.Win32.Primitives.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.Win32.Registry.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.Win32.Registry.dll deleted file mode 100644 index 4fc8eb4168..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/Microsoft.Win32.Registry.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.AppContext.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.AppContext.dll deleted file mode 100644 index 6b969f5a93..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.AppContext.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Buffers.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Buffers.dll deleted file mode 100644 index c5c44b766d..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Buffers.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Collections.Concurrent.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Collections.Concurrent.dll deleted file mode 100644 index eb6295c0ac..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Collections.Concurrent.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Collections.Immutable.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Collections.Immutable.dll deleted file mode 100644 index 949bdd0c21..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Collections.Immutable.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Collections.NonGeneric.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Collections.NonGeneric.dll deleted file mode 100644 index 796fd558b0..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Collections.NonGeneric.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Collections.Specialized.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Collections.Specialized.dll deleted file mode 100644 index a229f7e98b..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Collections.Specialized.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Collections.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Collections.dll deleted file mode 100644 index 2c813e1c99..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Collections.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.ComponentModel.Annotations.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.ComponentModel.Annotations.dll deleted file mode 100644 index c7ef4f6598..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.ComponentModel.Annotations.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.ComponentModel.Primitives.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.ComponentModel.Primitives.dll deleted file mode 100644 index 577673c501..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.ComponentModel.Primitives.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.ComponentModel.TypeConverter.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.ComponentModel.TypeConverter.dll deleted file mode 100644 index 8e54561010..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.ComponentModel.TypeConverter.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.ComponentModel.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.ComponentModel.dll deleted file mode 100644 index 9a7fc98955..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.ComponentModel.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Console.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Console.dll deleted file mode 100644 index e3e40eca1b..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Console.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Data.Common.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Data.Common.dll deleted file mode 100644 index 17ffba61e0..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Data.Common.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Data.SqlClient.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Data.SqlClient.dll deleted file mode 100644 index f895ab283a..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Data.SqlClient.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.Contracts.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.Contracts.dll deleted file mode 100644 index 6b4b08d69f..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.Contracts.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.Debug.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.Debug.dll deleted file mode 100644 index 49c21c572c..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.Debug.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.DiagnosticSource.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.DiagnosticSource.dll deleted file mode 100644 index 50b6e409cb..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.DiagnosticSource.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.Process.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.Process.dll deleted file mode 100644 index 8e1556cb3b..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.Process.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.StackTrace.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.StackTrace.dll deleted file mode 100644 index a48d7a1cb0..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.StackTrace.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.Tools.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.Tools.dll deleted file mode 100644 index 220b470bcf..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.Tools.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.TraceSource.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.TraceSource.dll deleted file mode 100644 index 5eece96801..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.TraceSource.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.Tracing.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.Tracing.dll deleted file mode 100644 index 9ce8e769db..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Diagnostics.Tracing.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Dynamic.Runtime.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Dynamic.Runtime.dll deleted file mode 100644 index 9dd8e2dd11..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Dynamic.Runtime.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Globalization.Calendars.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Globalization.Calendars.dll deleted file mode 100644 index 1c63095f0c..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Globalization.Calendars.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Globalization.Extensions.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Globalization.Extensions.dll deleted file mode 100644 index 53710c9e0a..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Globalization.Extensions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Globalization.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Globalization.dll deleted file mode 100644 index cd930ad90b..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Globalization.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.Compression.ZipFile.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.Compression.ZipFile.dll deleted file mode 100644 index ea2aa7f3f7..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.Compression.ZipFile.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.Compression.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.Compression.dll deleted file mode 100644 index 6de132f297..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.Compression.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.FileSystem.AccessControl.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.FileSystem.AccessControl.dll deleted file mode 100644 index 0054de7b6c..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.FileSystem.AccessControl.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.FileSystem.Primitives.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.FileSystem.Primitives.dll deleted file mode 100644 index 2eed71c5f2..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.FileSystem.Primitives.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.FileSystem.Watcher.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.FileSystem.Watcher.dll deleted file mode 100644 index a7859bf24b..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.FileSystem.Watcher.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.FileSystem.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.FileSystem.dll deleted file mode 100644 index f013064f4a..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.FileSystem.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.MemoryMappedFiles.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.MemoryMappedFiles.dll deleted file mode 100644 index 4fd16ee5de..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.MemoryMappedFiles.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.UnmanagedMemoryStream.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.UnmanagedMemoryStream.dll deleted file mode 100644 index 6f8bb10714..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.UnmanagedMemoryStream.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.dll deleted file mode 100644 index ddd816f645..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.IO.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Linq.Expressions.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Linq.Expressions.dll deleted file mode 100644 index fc73223d40..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Linq.Expressions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Linq.Parallel.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Linq.Parallel.dll deleted file mode 100644 index bc7a8581dd..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Linq.Parallel.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Linq.Queryable.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Linq.Queryable.dll deleted file mode 100644 index 5532906ec8..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Linq.Queryable.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Linq.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Linq.dll deleted file mode 100644 index d0f1978b27..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Linq.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.Http.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.Http.dll deleted file mode 100644 index d4696872cb..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.Http.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.NameResolution.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.NameResolution.dll deleted file mode 100644 index 06110a9a74..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.NameResolution.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.Primitives.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.Primitives.dll deleted file mode 100644 index 9cd8f7cc05..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.Primitives.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.Requests.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.Requests.dll deleted file mode 100644 index 4b822cb7be..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.Requests.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.Security.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.Security.dll deleted file mode 100644 index 092c8a0c41..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.Security.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.Sockets.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.Sockets.dll deleted file mode 100644 index 7a4a7fec88..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.Sockets.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.WebHeaderCollection.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.WebHeaderCollection.dll deleted file mode 100644 index a2abf4ea24..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.WebHeaderCollection.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.WebSockets.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.WebSockets.dll deleted file mode 100644 index f19142ad27..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Net.WebSockets.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Numerics.Vectors.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Numerics.Vectors.dll deleted file mode 100644 index af46b4b72d..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Numerics.Vectors.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.ObjectModel.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.ObjectModel.dll deleted file mode 100644 index fb557af845..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.ObjectModel.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.DispatchProxy.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.DispatchProxy.dll deleted file mode 100644 index 217659f488..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.DispatchProxy.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Emit.ILGeneration.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Emit.ILGeneration.dll deleted file mode 100644 index 5726906414..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Emit.ILGeneration.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Emit.Lightweight.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Emit.Lightweight.dll deleted file mode 100644 index 5a50a63914..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Emit.Lightweight.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Emit.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Emit.dll deleted file mode 100644 index 8c65fc17a3..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Emit.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Extensions.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Extensions.dll deleted file mode 100644 index b3b3351f8b..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Extensions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Metadata.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Metadata.dll deleted file mode 100644 index 48f9b153ac..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Metadata.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Primitives.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Primitives.dll deleted file mode 100644 index e244105c44..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.Primitives.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.TypeExtensions.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.TypeExtensions.dll deleted file mode 100644 index 0576ded8bd..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.TypeExtensions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.dll deleted file mode 100644 index f10e99c815..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Reflection.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Resources.Reader.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Resources.Reader.dll deleted file mode 100644 index 45915440ef..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Resources.Reader.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Resources.ResourceManager.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Resources.ResourceManager.dll deleted file mode 100644 index 5303b0771d..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Resources.ResourceManager.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.Extensions.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.Extensions.dll deleted file mode 100644 index e418493d70..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.Extensions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.Handles.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.Handles.dll deleted file mode 100644 index a574dfa726..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.Handles.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.InteropServices.RuntimeInformation.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.InteropServices.RuntimeInformation.dll deleted file mode 100644 index 899e975e00..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.InteropServices.RuntimeInformation.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.InteropServices.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.InteropServices.dll deleted file mode 100644 index 469bd68358..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.InteropServices.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.Loader.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.Loader.dll deleted file mode 100644 index 01eb74b90e..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.Loader.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.Numerics.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.Numerics.dll deleted file mode 100644 index b33ce464fc..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.Numerics.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.Serialization.Primitives.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.Serialization.Primitives.dll deleted file mode 100644 index bd80d37a24..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.Serialization.Primitives.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.dll deleted file mode 100644 index ff824191c2..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Runtime.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.AccessControl.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.AccessControl.dll deleted file mode 100644 index f29e71eebc..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.AccessControl.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Claims.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Claims.dll deleted file mode 100644 index 5f57e4c1ab..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Claims.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Cryptography.Algorithms.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Cryptography.Algorithms.dll deleted file mode 100644 index 211fa1d212..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Cryptography.Algorithms.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Cryptography.Encoding.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Cryptography.Encoding.dll deleted file mode 100644 index 3675d0d177..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Cryptography.Encoding.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Cryptography.Primitives.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Cryptography.Primitives.dll deleted file mode 100644 index 5e6c0ba201..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Cryptography.Primitives.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Cryptography.X509Certificates.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Cryptography.X509Certificates.dll deleted file mode 100644 index 8370987038..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Cryptography.X509Certificates.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Principal.Windows.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Principal.Windows.dll deleted file mode 100644 index bc74a88b2d..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Principal.Windows.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Principal.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Principal.dll deleted file mode 100644 index f4dcb51ed0..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Security.Principal.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Text.Encoding.Extensions.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Text.Encoding.Extensions.dll deleted file mode 100644 index e4b5563a20..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Text.Encoding.Extensions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Text.Encoding.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Text.Encoding.dll deleted file mode 100644 index 33b5adcef0..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Text.Encoding.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Text.RegularExpressions.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Text.RegularExpressions.dll deleted file mode 100644 index d5f9f3b971..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Text.RegularExpressions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.AccessControl.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.AccessControl.dll deleted file mode 100644 index 312871b480..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.AccessControl.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Tasks.Dataflow.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Tasks.Dataflow.dll deleted file mode 100644 index 488de3e268..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Tasks.Dataflow.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Tasks.Extensions.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Tasks.Extensions.dll deleted file mode 100644 index a1234ce81a..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Tasks.Extensions.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Tasks.Parallel.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Tasks.Parallel.dll deleted file mode 100644 index e4522051c5..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Tasks.Parallel.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Tasks.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Tasks.dll deleted file mode 100644 index aaad49960b..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Tasks.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Thread.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Thread.dll deleted file mode 100644 index 0887ba67eb..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Thread.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.ThreadPool.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.ThreadPool.dll deleted file mode 100644 index 25a6000da0..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.ThreadPool.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Timer.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Timer.dll deleted file mode 100644 index 577eaeda70..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.Timer.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.dll deleted file mode 100644 index c77b70bc08..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Threading.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Xml.ReaderWriter.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Xml.ReaderWriter.dll deleted file mode 100644 index 1987219623..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Xml.ReaderWriter.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Xml.XDocument.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Xml.XDocument.dll deleted file mode 100644 index 980ab805b7..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Xml.XDocument.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Xml.XPath.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Xml.XPath.dll deleted file mode 100644 index 570d346617..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Xml.XPath.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Xml.XmlDocument.dll b/src/NSwag.Integration.Tests/Issue807/input/refs/System.Xml.XmlDocument.dll deleted file mode 100644 index 34fcb6d597..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/refs/System.Xml.XmlDocument.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.Data.SqlClient.dll b/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.Data.SqlClient.dll deleted file mode 100644 index 9b5aacffad..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.Data.SqlClient.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.Diagnostics.TraceSource.dll b/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.Diagnostics.TraceSource.dll deleted file mode 100644 index ab39b18aae..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.Diagnostics.TraceSource.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.IO.FileSystem.AccessControl.dll b/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.IO.FileSystem.AccessControl.dll deleted file mode 100644 index 490f567fe9..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.IO.FileSystem.AccessControl.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.IO.Pipes.dll b/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.IO.Pipes.dll deleted file mode 100644 index a1182239de..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.IO.Pipes.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.Security.AccessControl.dll b/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.Security.AccessControl.dll deleted file mode 100644 index 6f07f0fbb5..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.Security.AccessControl.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.Text.Encoding.CodePages.dll b/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.Text.Encoding.CodePages.dll deleted file mode 100644 index dd6b24ce28..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.Text.Encoding.CodePages.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.Threading.AccessControl.dll b/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.Threading.AccessControl.dll deleted file mode 100644 index 948f6f02b6..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/runtimes/unix/lib/netstandard1.3/System.Threading.AccessControl.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.Data.SqlClient.dll b/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.Data.SqlClient.dll deleted file mode 100644 index 5b0287049e..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.Data.SqlClient.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.Diagnostics.TraceSource.dll b/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.Diagnostics.TraceSource.dll deleted file mode 100644 index 101733ad19..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.Diagnostics.TraceSource.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.IO.FileSystem.AccessControl.dll b/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.IO.FileSystem.AccessControl.dll deleted file mode 100644 index 06773a6264..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.IO.FileSystem.AccessControl.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.IO.Pipes.dll b/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.IO.Pipes.dll deleted file mode 100644 index 775efbb408..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.IO.Pipes.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.Security.AccessControl.dll b/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.Security.AccessControl.dll deleted file mode 100644 index 87a820e9ef..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.Security.AccessControl.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.Text.Encoding.CodePages.dll b/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.Text.Encoding.CodePages.dll deleted file mode 100644 index 0f2f447448..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.Text.Encoding.CodePages.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.Threading.AccessControl.dll b/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.Threading.AccessControl.dll deleted file mode 100644 index ca1dc794a7..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win/lib/netstandard1.3/System.Threading.AccessControl.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win7-x64/native/sni.dll b/src/NSwag.Integration.Tests/Issue807/input/runtimes/win7-x64/native/sni.dll deleted file mode 100644 index 25027a94b5..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win7-x64/native/sni.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win7-x86/native/sni.dll b/src/NSwag.Integration.Tests/Issue807/input/runtimes/win7-x86/native/sni.dll deleted file mode 100644 index d48248b283..0000000000 Binary files a/src/NSwag.Integration.Tests/Issue807/input/runtimes/win7-x86/native/sni.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/Issue807/input/web.config b/src/NSwag.Integration.Tests/Issue807/input/web.config deleted file mode 100644 index 23782d2240..0000000000 --- a/src/NSwag.Integration.Tests/Issue807/input/web.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Integration.Tests/Issue807/nswag.json b/src/NSwag.Integration.Tests/Issue807/nswag.json deleted file mode 100644 index 0a6cde671d..0000000000 --- a/src/NSwag.Integration.Tests/Issue807/nswag.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "swaggerGenerator": { - "webApiToSwagger": { - "assemblyPaths": [ - "input/WebApplication1.dll" - ], - "assemblyConfig": "", - "referencePaths": [], - "isAspNetCore": false, - "controllerNames": [], - "defaultUrlTemplate": "api/{controller}/{id?}", - "defaultPropertyNameHandling": "Default", - "defaultEnumHandling": "Integer", - "flattenInheritanceHierarchy": false, - "generateKnownTypes": true, - "generateXmlObjects": false, - "addMissingPathParameters": false, - "infoTitle": "Web API Swagger specification", - "infoVersion": "1.0.0", - "output": "output/swagger.json" - } - }, - "codeGenerators": {} -} \ No newline at end of file diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NConsole.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NConsole.dll deleted file mode 100644 index 2db1c50d44..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NConsole.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NJsonSchema.CodeGeneration.CSharp.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NJsonSchema.CodeGeneration.CSharp.dll deleted file mode 100644 index d5dedb4c9e..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NJsonSchema.CodeGeneration.CSharp.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NJsonSchema.CodeGeneration.TypeScript.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NJsonSchema.CodeGeneration.TypeScript.dll deleted file mode 100644 index 9fa09e3822..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NJsonSchema.CodeGeneration.TypeScript.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NJsonSchema.CodeGeneration.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NJsonSchema.CodeGeneration.dll deleted file mode 100644 index c47a073652..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NJsonSchema.CodeGeneration.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NJsonSchema.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NJsonSchema.dll deleted file mode 100644 index 83114aba9a..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NJsonSchema.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Annotations.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Annotations.dll deleted file mode 100644 index 7c0ee988e4..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Annotations.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Annotations.pdb b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Annotations.pdb deleted file mode 100644 index 0301648204..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Annotations.pdb and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Annotations.xml b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Annotations.xml deleted file mode 100644 index c3b3ab32b7..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Annotations.xml +++ /dev/null @@ -1,166 +0,0 @@ - - - - NSwag.Annotations - - - - A converter to correctly serialize exception objects. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - If set to true the serializer hides stack trace (i.e. sets the StackTrace to 'HIDDEN'). - The namespaces to search for exception types. - - - Gets a value indicating whether this can write JSON. - - - Writes the JSON representation of the object. - The to write to. - The value. - The calling serializer. - - - Determines whether this instance can convert the specified object type. - Type of the object. - true if this instance can convert the specified object type; otherwise, false. - - - Reads the JSON representation of the object. - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - Specifies the result type of a HTTP operation to correctly generate a Swagger definition. - Use , this attribute will be obsolete soon. - - - Initializes a new instance of the class. - The JSON result type of the MVC or Web API action method. - - - Initializes a new instance of the class. - The HTTP status code for which the result type applies. - The JSON result type of the MVC or Web API action method. - - - Initializes a new instance of the class. - The HTTP status code for which the result type applies. - The JSON result type of the MVC or Web API action method. - - - Initializes a new instance of the class. - The HTTP status code for which the result type applies. - The JSON result type of the MVC or Web API action method. - - - Gets or sets the HTTP status code for which the result type applies. - - - Gets or sets the JSON result type of the MVC or Web API action method. - - - Gets or sets the description of the response. - - - Specifies that a default response (HTTP 200/204) should be generated from the return type of the operation method - (not needed if no response type attributes are available). - - - Excludes an action method from the generated Swagger specification. - - - Specifies the operation . - - - Initializes a new instance of the class. - The operation ID. - - - Gets or sets the operation ID. - - - Registers an operation processor for the given method or class. - - - - Initializes a new instance of the class. - The type. - - - Gets or sets the type of the operation processor (must implement IOperationProcessor). - - - Specifies the result type of a HTTP operation to correctly generate a Swagger definition. - - - Initializes a new instance of the class. - The JSON result type of the MVC or Web API action method. - - - Initializes a new instance of the class. - The HTTP status code for which the result type applies. - The JSON result type of the MVC or Web API action method. - - - Initializes a new instance of the class. - The HTTP status code for which the result type applies. - The JSON result type of the MVC or Web API action method. - - - Initializes a new instance of the class. - The HTTP status code for which the result type applies. - The JSON result type of the MVC or Web API action method. - - - Gets the HTTP status code. - - - Gets or sets the response description. - - - Gets or sets the response type. - - - Specifies the tags for an operation. - - - Initializes a new instance of the class. - - - Gets or sets the name. - - - Gets or sets the description. - - - Gets or sets the external documentation description. - - - Gets or sets the external documentation URL. - - - Gets or sets a value indicating whether the tags should be added to document's 'tags' property (only needed on operation methods, default: false). - - - Specifies the tags for an operation or a document. - - - Initializes a new instance of the class. - The tags. - - - Gets the tags. - - - Gets or sets a value indicating whether the tags should be added to document's 'tags' property (only needed on operation methods, default: false). - - - diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.AssemblyLoader.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.AssemblyLoader.dll deleted file mode 100644 index 1141671e1b..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.AssemblyLoader.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.AssemblyLoader.dll.config b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.AssemblyLoader.dll.config deleted file mode 100644 index d3dbfef4b1..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.AssemblyLoader.dll.config +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.AssemblyLoader.pdb b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.AssemblyLoader.pdb deleted file mode 100644 index 496fbcd821..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.AssemblyLoader.pdb and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.AssemblyLoader.xml b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.AssemblyLoader.xml deleted file mode 100644 index aaeb722ea0..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.AssemblyLoader.xml +++ /dev/null @@ -1,144 +0,0 @@ - - - - NSwag.AssemblyLoader - - - - is . - - - - - - - Creates a new generator instance. - The generator. - - - Creates a new document. - - - Creates a new document in the given path. - The file path. - The task. - - - Executes a document. - - - Loads an existing NSwagDocument. - The file path. - The document. - - - - - - - Creates a new generator instance. - The generator. - - - The NSwagDocument implementation. - - - - Initializes a new instance of the class. - - - Creates a new NSwagDocument. - The document. - - - Loads an existing NSwagDocument. - The file path. - The document. - - - Converts to absolute path. - The path to convert. - - - - Converts a path to an relative path. - The path to convert. - The relative path. - - - Generates a from a Web API controller or type which is located in a .NET assembly. - - - Initializes a new instance of the class. - The settings. - - - Gets the available controller classes from the given assembly. - The controller classes. - - - Generates the Swagger definition for the given classes without operations (used for class generation). - The class names. - The Swagger definition. - - - Generates a from a Web API controller or type which is located in a .NET assembly. - - - Initializes a new instance of the class. - The generator settings. - - - Gets the available controller classes from the given assembly. - The controller classes. - The assembly could not be found. - The assembly config file could not be found.. - No assembly paths have been provided. - - - Generates the Swagger definition for all controllers in the assembly. - The controller class names. - No assembly paths have been provided. - The Swagger definition. - - - No assembly paths have been provided. - - - No assembly paths have been provided. - - - Provides file path utility methods. - - - Expands the given wildcards (** or *) in the path. - The file path with wildcards. - All expanded file paths. - - - Expands the given wildcards (** or *) in the paths. - The files path with wildcards. - All expanded file paths. - - - Finds the wildcard matches. - The selector. - The items. - The delimiter. - The matches. - - - Converts a relative path to an absolute path. - The relative path. - The current directory. - The absolute path. - - - Converts an absolute path to a relative path if possible. - The absolute path. - The current directory. - The relative path. - The path of the two files doesn't have any common base. - - - diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.CSharp.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.CSharp.dll deleted file mode 100644 index 5e741caab2..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.CSharp.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.CSharp.pdb b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.CSharp.pdb deleted file mode 100644 index ac43ef8d8a..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.CSharp.pdb and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.CSharp.xml b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.CSharp.xml deleted file mode 100644 index 497735ea18..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.CSharp.xml +++ /dev/null @@ -1,931 +0,0 @@ - - - - NSwag.CodeGeneration.CSharp - - - - The CSharp client template model. - - - Initializes a new instance of the class. - Name of the controller. - The class name of the controller. - The operations. - The exception schema. - The Swagger document. - The settings. - - - Gets or sets a value indicating whether to generate client contracts (i.e. client interfaces). - - - Gets or sets a value indicating whether to generate implementation classes. - - - Gets the class name. - - - Gets the base class name. - - - Gets a value indicating whether the client has a base class. - - - Gets a value indicating whether the client has configuration class. - - - Gets the configuration class name. - - - Gets a value indicating whether the client has a base type. - - - Gets or sets a value indicating whether an HttpClient instance is injected. - - - Gets or sets a value indicating whether to dispose the HttpClient (injected HttpClient is never disposed, default: true). - - - Gets a value indicating whether to use a HTTP client creation method. - - - Gets the type of the HttpClient that will be used in the calls from a client to a service. - - - Gets a value indicating whether to use a HTTP request message creation method. - - - Gets a value indicating whether to generate client interfaces. - - - Gets the service base URL. - - - Gets a value indicating whether the client has operations. - - - Gets the exception class name. - - - Gets a value indicating whether to generate optional parameters. - - - Gets or sets a value indicating whether to use and expose the base URL (default: true). - - - Gets or sets a value indicating whether to generate synchronous methods (not recommended, default: false). - - - Gets or sets the client class access modifier. - - - Gets the operations. - - - Gets or sets a value indicating whether DTO exceptions are wrapped in a SwaggerException instance. - - - Gets the JSON serializer parameter code. - - - The CSharp controller template model. - - - Initializes a new instance of the class. - Name of the controller. - The operations. - The document. - The settings. - - - Gets or sets the class name. - - - Gets a value indicating whether the controller has a base class. - - - Gets the base class. - - - Gets or sets the service base URL. - - - Gets or sets a value indicating whether the controller has operations. - - - Gets or sets the operations. - - - Gets or sets a value indicating whether the controller has a base path. - - - Gets or sets the base path. - - - Gets a value indicating whether to generate optional parameters. - - - The CSharp exception description model. - - - Initializes a new instance of the class. - The type. - The description. - Name of the controller. - The settings. - - - Gets or sets the name of the type. - - - Gets or sets the description. - - - The CSharp file template model. - - - Initializes a new instance of the class. - The client code. - Type of the output. - The Swagger document. - The settings. - The client generator base. - The resolver. - - - Gets the namespace. - - - Gets the all the namespace usages. - - - Gets a value indicating whether to generate contract code. - - - Gets a value indicating whether to generate implementation code. - - - Gets or sets a value indicating whether to generate client types. - - - Gets the clients code. - - - Gets the classes code. - - - Gets a value indicating whether the generated code requires a JSON exception converter. - - - Gets the JsonExceptionConverter code. - - - Gets a value indicating whether the generated code requires the FileParameter type. - - - Gets a value indicating whether [generate file response class]. - - - Gets or sets a value indicating whether to generate exception classes (default: true). - - - Gets or sets a value indicating whether to wrap success responses to allow full response access. - - - Gets or sets a value indicating whether to generate the response class (only applied when WrapResponses == true, default: true). - - - Gets the response class names. - - - Gets the exception class names. - - - The CSharp operation model. - - - Initializes a new instance of the class. - The operation. - The settings. - The generator. - The resolver. - - - Gets the method's access modifier. - - - Gets the actual name of the operation (language specific). - - - Gets a value indicating whether this operation is rendered as interface method. - - - Gets a value indicating whether the operation has a result type. - - - Gets or sets the type of the result. - - - Gets or sets the type of the exception. - - - Gets or sets the exception descriptions. - - - Gets the name of the parameter variable. - The parameter. - All parameters. - The parameter variable name. - - - Resolves the type of the parameter. - The parameter. - The parameter type name. - - - Creates the response model. - The status code. - The response. - The exception schema. - The generator. - The settings. - - - - The CSharp parameter model. - - - Initializes a new instance of the class. - Name of the parameter. - Name of the variable. - The type name. - The parameter. - All parameters. - The settings. - The client generator base. - - - The CSharp response model. - - - Initializes a new instance of the class. - The status code. - The response. - Specifies whether this is the success response. - The exception schema. - The client generator. - The settings. - - - Base class for the CSharp models - - - Initializes a new instance of the class. - Name of the controller. - The settings. - - - Gets a value indicating whether to wrap success responses to allow full response access. - - - Gets the response class name. - - - Generates the CSharp service client code. - - - Initializes a new instance of the class. - The Swagger document. - The settings. - is . - - - Initializes a new instance of the class. - The Swagger document. - The settings. - The resolver. - is . - - - Gets or sets the generator settings. - - - Gets the base settings. - - - Generates the file. - The file contents. - - - Generates the the whole file containing all needed types. - The output type. - The code - - - Generates the client class. - Name of the controller. - Name of the controller class. - The operations. - Type of the output. - The code. - - - Creates an operation model. - The operation. - The settings. - The operation model. - - - Settings for the . - - - Initializes a new instance of the class. - - - Gets or sets the full name of the base class. - - - Gets or sets the full name of the configuration class ( must be set). - - - Gets or sets a value indicating whether to generate exception classes (default: true). - - - Gets or sets the name of the exception class (supports the '{controller}' placeholder, default 'SwaggerException'). - - - Gets or sets a value indicating whether an HttpClient instance is injected into the client. - - - Gets or sets a value indicating whether to dispose the HttpClient (injected HttpClient is never disposed, default: true). - - - Gets or sets the list of methods with a protected access modifier ("classname.methodname"). - - - Gets or sets a value indicating whether to call CreateHttpClientAsync on the base class to create a new HttpClient instance (cannot be used when the HttpClient is injected). - - - Gets or sets a value indicating whether to call CreateHttpRequestMessageAsync on the base class to create a new HttpRequestMethod. - - - Gets or sets a value indicating whether DTO exceptions are wrapped in a SwaggerException instance (default: true). - - - Gets or sets the client class access modifier (default: public). - - - Gets or sets a value indicating whether to use and expose the base URL (default: true). - - - Gets or sets a value indicating whether to generate synchronous methods (not recommended, default: false). - - - - Gets or sets the HttpClient type which will be used in the generation of the client code. By default the System.Net.Http.HttpClient - will be used, but this can be overridden. Just keep in mind that the type you specify has the same default HttpClient method signatures. - - - - The CSharp generator base class. - - - Initializes a new instance of the class. - The document. - The settings. - The resolver. - - - Generates the file. - The client code. - The client classes. - Type of the output. - The code. - - - Gets the type. - The schema. - if set to true [is nullable]. - The type name hint. - The type name. - - - Settings for the . - - - Initializes a new instance of the class. - - - Gets or sets the CSharp generator settings. - - - Gets or sets the additional namespace usages. - - - Gets the code generator settings. - - - Gets or sets a value indicating whether to wrap success responses to allow full response access (experimental). - - - Gets or sets a value indicating whether to generate the response classes (only needed when WrapResponses == true, default: true). - - - Gets or sets the name of the response class (supports the '{controller}' placeholder). - - - A resolver which returns Exception without generating the class (uses System.Exception instead of own class). - - - Gets the exception schema. - - - Initializes a new instance of the class. - The generator settings. - The exception type schema. - The document - - - Creates a new resolver, adds the given schema definitions and registers an exception schema if available. - The settings. - The document - - - Resolves and possibly generates the specified schema. - The schema. - Specifies whether the given type usage is nullable. - The type name hint to use when generating the type and the type name is missing. - The type name. - - - Generates the CSharp service client code. - - - Initializes a new instance of the class. - The Swagger document. - The settings. - is . - - - Initializes a new instance of the class. - The Swagger document. - The settings. - The resolver. - is . - - - Gets or sets the generator settings. - - - Gets the base settings. - - - Generates the file. - The file contents. - - - Generates the client class. - Name of the controller. - Name of the controller class. - The operations. - Type of the output. - The code. - - - Creates an operation model. - The operation. - The settings. - The operation model. - - - Settings for the . - - - Initializes a new instance of the class. - - - Gets or sets the full name of the base class. - - - - Class to produce the template output - - - - - Create the template output - - - - - Base class for this transformation - - - - - The string builder that generation-time code is using to assemble generated output - - - - - The error collection for the generation process - - - - - A list of the lengths of each indent that was added with PushIndent - - - - - Gets the current indent we use when adding lines to the output - - - - - Current transformation session - - - - - Write text directly into the generated output - - - - - Write text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Raise an error - - - - - Raise a warning - - - - - Increase the indent - - - - - Remove the last indent that was added with PushIndent - - - - - Remove any indentation - - - - - Utility class to produce culture-oriented representation of an object as a string. - - - - - Gets or sets format provider to be used by ToStringWithCulture method. - - - - - This is called from the compile/run appdomain to convert objects within an expression block to a string - - - - - Helper to produce culture-oriented representation of an object as a string - - - - - Class to produce the template output - - - - - Create the template output - - - - - Base class for this transformation - - - - - The string builder that generation-time code is using to assemble generated output - - - - - The error collection for the generation process - - - - - A list of the lengths of each indent that was added with PushIndent - - - - - Gets the current indent we use when adding lines to the output - - - - - Current transformation session - - - - - Write text directly into the generated output - - - - - Write text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Raise an error - - - - - Raise a warning - - - - - Increase the indent - - - - - Remove the last indent that was added with PushIndent - - - - - Remove any indentation - - - - - Utility class to produce culture-oriented representation of an object as a string. - - - - - Gets or sets format provider to be used by ToStringWithCulture method. - - - - - This is called from the compile/run appdomain to convert objects within an expression block to a string - - - - - Helper to produce culture-oriented representation of an object as a string - - - - - Class to produce the template output - - - - - Create the template output - - - - - Base class for this transformation - - - - - The string builder that generation-time code is using to assemble generated output - - - - - The error collection for the generation process - - - - - A list of the lengths of each indent that was added with PushIndent - - - - - Gets the current indent we use when adding lines to the output - - - - - Current transformation session - - - - - Write text directly into the generated output - - - - - Write text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Raise an error - - - - - Raise a warning - - - - - Increase the indent - - - - - Remove the last indent that was added with PushIndent - - - - - Remove any indentation - - - - - Utility class to produce culture-oriented representation of an object as a string. - - - - - Gets or sets format provider to be used by ToStringWithCulture method. - - - - - This is called from the compile/run appdomain to convert objects within an expression block to a string - - - - - Helper to produce culture-oriented representation of an object as a string - - - - - Class to produce the template output - - - - - Create the template output - - - - - Base class for this transformation - - - - - The string builder that generation-time code is using to assemble generated output - - - - - The error collection for the generation process - - - - - A list of the lengths of each indent that was added with PushIndent - - - - - Gets the current indent we use when adding lines to the output - - - - - Current transformation session - - - - - Write text directly into the generated output - - - - - Write text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Raise an error - - - - - Raise a warning - - - - - Increase the indent - - - - - Remove the last indent that was added with PushIndent - - - - - Remove any indentation - - - - - Utility class to produce culture-oriented representation of an object as a string. - - - - - Gets or sets format provider to be used by ToStringWithCulture method. - - - - - This is called from the compile/run appdomain to convert objects within an expression block to a string - - - - - Helper to produce culture-oriented representation of an object as a string - - - - diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.TypeScript.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.TypeScript.dll deleted file mode 100644 index 7d8be466bf..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.TypeScript.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.TypeScript.pdb b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.TypeScript.pdb deleted file mode 100644 index 3fa8bda5cf..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.TypeScript.pdb and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.TypeScript.xml b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.TypeScript.xml deleted file mode 100644 index 108774b2e8..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.TypeScript.xml +++ /dev/null @@ -1,1487 +0,0 @@ - - - - NSwag.CodeGeneration.TypeScript - - - - The TypeScript client template model. - - - Initializes a new instance of the class. - Name of the controller. - The operations. - The extension code. - The Swagger document. - The settings. - - - Gets the class name. - - - Gets the client base class. - - - Gets a value indicating whether the client class has a base class. - - - Gets the configuration class name. - - - Gets a value indicating whether the client class has a base class. - - - Gets or sets a value indicating whether to call 'transformOptions' on the base class or extension class. - - - Gets or sets a value indicating whether to call 'transformResult' on the base class or extension class. - - - Gets a value indicating whether to generate optional parameters. - - - Gets a value indicating whether the client is extended with an extension class. - - - Gets the extension body code. - - - Gets or sets a value indicating whether the extension code has a constructor and no constructor has to be generated. - - - Gets a value indicating whether the client has operations. - - - Gets the operations. - - - Gets a value indicating whether the client uses KnockoutJS. - - - Gets the service base URL. - - - Gets a value indicating whether to generate client interfaces. - - - Gets the promise type. - - - Gets the promise constructor code. - - - Gets or sets a value indicating whether to use Aurelia HTTP injection. - - - Gets a value indicating whether the target TypeScript version supports strict null checks. - - - Gets or sets the token name for injecting the API base URL string (used in the Angular2 template). - - - Gets or sets a value indicating whether DTO exceptions are wrapped in a SwaggerException instance. - - - The TypeScript file template model. - - - Initializes a new instance of the class. - The client code. - The client classes. - The Swagger document. - The extension code. - The settings. - The resolver. - - - Gets a value indicating whether to generate client classes. - - - Gets a value indicating whether the generated code is for Angular 2. - - - Gets a value indicating whether the generated code is for Aurelia. - - - Gets a value indicating whether the generated code is for Angular. - - - Gets a value indicating whether the generated code is for Knockout. - - - Gets a value indicating whether to render for JQuery. - - - Gets or sets a value indicating whether DTO exceptions are wrapped in a SwaggerException instance. - - - Gets a value indicating whether MomentJS is required. - - - Gets a value indicating whether DayJS is required. - - - Gets a value indicating whether required types should be imported. - - - Gets a value indicating whether to call 'transformOptions' on the base class or extension class. - - - Gets the clients code. - - - Gets the types code. - - - Gets or sets the extension code imports. - - - Gets or sets the extension code to insert at the beginning. - - - Gets or sets the extension code to insert at the end. - - - Gets a value indicating whether the file has module name. - - - Gets the name of the module. - - - Gets a value indicating whether the file has a namespace. - - - Gets the namespace. - - - Gets a value indicating whether the FileParameter interface should be rendered. - - - Gets a value indicating whether the SwaggerException class is required. - - - Table containing list of the generated classes. - - - Gets or sets the token name for injecting the API base URL string (used in the Angular2 template). - - - Gets a value indicating whether to handle references. - - - Gets the reference handling code. - - - The TypeScript operation model. - - - Initializes a new instance of the class. - The operation. - The settings. - The generator. - The resolver. - - - Gets the actual name of the operation (language specific). - - - Gets the actual name of the operation (language specific). - - - Gets or sets the type of the result. - - - Gets a value indicating whether the operation requires mappings for DTO generation. - - - Gets a value indicating whether the target TypeScript version supports strict null checks. - - - Gets a value indicating whether to handle references. - - - Gets a value indicating whether the template can request blobs. - - - Gets a value indicating whether to use blobs with Angular. - - - Gets a value indicating whether to use blobs with AngularJS. - - - Gets or sets the type of the exception. - - - Gets the method's access modifier. - - - Gets a value indicating whether to render for AngularJS. - - - Gets a value indicating whether to render for Angular2. - - - Gets a value indicating whether to render for JQuery. - - - Gets a value indicating whether to render for Fetch or Aurelia - - - Resolves the type of the parameter. - The parameter. - The parameter type name. - - - Creates the response model. - The status code. - The response. - The exception schema. - The generator. - The settings. - - - - The TypeScript parameter model. - - - Initializes a new instance of the class. - Name of the parameter. - Name of the variable. - The type name. - The parameter. - All parameters. - The settings. - The client generator base. - - - The TypeScript response model. - - - Initializes a new instance of the class. - The status code. - The response. - if set to true [is success response]. - The exception schema. - The generator. - The settings. - - - Gets or sets the data conversion code. - - - Gets or sets a value indicating whether to use a DTO class. - - - The promise type. - - - The standard promise implementation (polyfill may be required). - - - Promise from the Q promises library. - - - Generates the CSharp service client code. - - - Initializes a new instance of the class. - The Swagger document. - The settings. - is . - - - Initializes a new instance of the class. - The Swagger document. - The settings. - The resolver. - is . - - - Gets or sets the generator settings. - - - Generates the file. - The file contents. - - - Gets the base settings. - - - Gets the type. - The schema. - if set to true [is nullable]. - The type name hint. - The type name. - - - Generates the file. - The client code. - The client classes. - Type of the output. - The code. - - - Generates the client class. - Name of the controller. - Name of the controller class. - The operations. - Type of the output. - The code. - - - Creates an operation model. - - The settings. - The operation model. - - - Settings for the . - - - Initializes a new instance of the class. - - - Gets or sets the TypeScript generator settings. - - - Gets the code generator settings. - - - Gets or sets the output template. - - - Gets or sets the promise type. - - - Gets or sets a value indicating whether DTO exceptions are wrapped in a SwaggerException instance (default: false). - - - Gets or sets the client base class. - - - Gets or sets the full name of the configuration class ( must be set). - - - Gets or sets a value indicating whether to call 'transformOptions' on the base class or extension class. - - - Gets or sets a value indicating whether to call 'transformResult' on the base class or extension class. - - - Gets or sets the token name for injecting the API base URL string (used in the Angular2 template, default: ''). - - - Gets or sets the list of methods with a protected access modifier ("classname.methodname"). - - - Gets or sets a value indicating whether required types should be imported (default: true). - - - - Class to produce the template output - - - - - Create the template output - - - - - Base class for this transformation - - - - - The string builder that generation-time code is using to assemble generated output - - - - - The error collection for the generation process - - - - - A list of the lengths of each indent that was added with PushIndent - - - - - Gets the current indent we use when adding lines to the output - - - - - Current transformation session - - - - - Write text directly into the generated output - - - - - Write text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Raise an error - - - - - Raise a warning - - - - - Increase the indent - - - - - Remove the last indent that was added with PushIndent - - - - - Remove any indentation - - - - - Utility class to produce culture-oriented representation of an object as a string. - - - - - Gets or sets format provider to be used by ToStringWithCulture method. - - - - - This is called from the compile/run appdomain to convert objects within an expression block to a string - - - - - Helper to produce culture-oriented representation of an object as a string - - - - - Class to produce the template output - - - - - Create the template output - - - - - Base class for this transformation - - - - - The string builder that generation-time code is using to assemble generated output - - - - - The error collection for the generation process - - - - - A list of the lengths of each indent that was added with PushIndent - - - - - Gets the current indent we use when adding lines to the output - - - - - Current transformation session - - - - - Write text directly into the generated output - - - - - Write text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Raise an error - - - - - Raise a warning - - - - - Increase the indent - - - - - Remove the last indent that was added with PushIndent - - - - - Remove any indentation - - - - - Utility class to produce culture-oriented representation of an object as a string. - - - - - Gets or sets format provider to be used by ToStringWithCulture method. - - - - - This is called from the compile/run appdomain to convert objects within an expression block to a string - - - - - Helper to produce culture-oriented representation of an object as a string - - - - - Class to produce the template output - - - - - Create the template output - - - - - Base class for this transformation - - - - - The string builder that generation-time code is using to assemble generated output - - - - - The error collection for the generation process - - - - - A list of the lengths of each indent that was added with PushIndent - - - - - Gets the current indent we use when adding lines to the output - - - - - Current transformation session - - - - - Write text directly into the generated output - - - - - Write text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Raise an error - - - - - Raise a warning - - - - - Increase the indent - - - - - Remove the last indent that was added with PushIndent - - - - - Remove any indentation - - - - - Utility class to produce culture-oriented representation of an object as a string. - - - - - Gets or sets format provider to be used by ToStringWithCulture method. - - - - - This is called from the compile/run appdomain to convert objects within an expression block to a string - - - - - Helper to produce culture-oriented representation of an object as a string - - - - - Class to produce the template output - - - - - Create the template output - - - - - Base class for this transformation - - - - - The string builder that generation-time code is using to assemble generated output - - - - - The error collection for the generation process - - - - - A list of the lengths of each indent that was added with PushIndent - - - - - Gets the current indent we use when adding lines to the output - - - - - Current transformation session - - - - - Write text directly into the generated output - - - - - Write text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Raise an error - - - - - Raise a warning - - - - - Increase the indent - - - - - Remove the last indent that was added with PushIndent - - - - - Remove any indentation - - - - - Utility class to produce culture-oriented representation of an object as a string. - - - - - Gets or sets format provider to be used by ToStringWithCulture method. - - - - - This is called from the compile/run appdomain to convert objects within an expression block to a string - - - - - Helper to produce culture-oriented representation of an object as a string - - - - - Class to produce the template output - - - - - Create the template output - - - - - Base class for this transformation - - - - - The string builder that generation-time code is using to assemble generated output - - - - - The error collection for the generation process - - - - - A list of the lengths of each indent that was added with PushIndent - - - - - Gets the current indent we use when adding lines to the output - - - - - Current transformation session - - - - - Write text directly into the generated output - - - - - Write text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Raise an error - - - - - Raise a warning - - - - - Increase the indent - - - - - Remove the last indent that was added with PushIndent - - - - - Remove any indentation - - - - - Utility class to produce culture-oriented representation of an object as a string. - - - - - Gets or sets format provider to be used by ToStringWithCulture method. - - - - - This is called from the compile/run appdomain to convert objects within an expression block to a string - - - - - Helper to produce culture-oriented representation of an object as a string - - - - - Class to produce the template output - - - - - Create the template output - - - - - Base class for this transformation - - - - - The string builder that generation-time code is using to assemble generated output - - - - - The error collection for the generation process - - - - - A list of the lengths of each indent that was added with PushIndent - - - - - Gets the current indent we use when adding lines to the output - - - - - Current transformation session - - - - - Write text directly into the generated output - - - - - Write text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Raise an error - - - - - Raise a warning - - - - - Increase the indent - - - - - Remove the last indent that was added with PushIndent - - - - - Remove any indentation - - - - - Utility class to produce culture-oriented representation of an object as a string. - - - - - Gets or sets format provider to be used by ToStringWithCulture method. - - - - - This is called from the compile/run appdomain to convert objects within an expression block to a string - - - - - Helper to produce culture-oriented representation of an object as a string - - - - - Class to produce the template output - - - - - Create the template output - - - - - Base class for this transformation - - - - - The string builder that generation-time code is using to assemble generated output - - - - - The error collection for the generation process - - - - - A list of the lengths of each indent that was added with PushIndent - - - - - Gets the current indent we use when adding lines to the output - - - - - Current transformation session - - - - - Write text directly into the generated output - - - - - Write text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Raise an error - - - - - Raise a warning - - - - - Increase the indent - - - - - Remove the last indent that was added with PushIndent - - - - - Remove any indentation - - - - - Utility class to produce culture-oriented representation of an object as a string. - - - - - Gets or sets format provider to be used by ToStringWithCulture method. - - - - - This is called from the compile/run appdomain to convert objects within an expression block to a string - - - - - Helper to produce culture-oriented representation of an object as a string - - - - - Class to produce the template output - - - - - Create the template output - - - - - Base class for this transformation - - - - - The string builder that generation-time code is using to assemble generated output - - - - - The error collection for the generation process - - - - - A list of the lengths of each indent that was added with PushIndent - - - - - Gets the current indent we use when adding lines to the output - - - - - Current transformation session - - - - - Write text directly into the generated output - - - - - Write text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Raise an error - - - - - Raise a warning - - - - - Increase the indent - - - - - Remove the last indent that was added with PushIndent - - - - - Remove any indentation - - - - - Utility class to produce culture-oriented representation of an object as a string. - - - - - Gets or sets format provider to be used by ToStringWithCulture method. - - - - - This is called from the compile/run appdomain to convert objects within an expression block to a string - - - - - Helper to produce culture-oriented representation of an object as a string - - - - - Class to produce the template output - - - - - Create the template output - - - - - Base class for this transformation - - - - - The string builder that generation-time code is using to assemble generated output - - - - - The error collection for the generation process - - - - - A list of the lengths of each indent that was added with PushIndent - - - - - Gets the current indent we use when adding lines to the output - - - - - Current transformation session - - - - - Write text directly into the generated output - - - - - Write text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Raise an error - - - - - Raise a warning - - - - - Increase the indent - - - - - Remove the last indent that was added with PushIndent - - - - - Remove any indentation - - - - - Utility class to produce culture-oriented representation of an object as a string. - - - - - Gets or sets format provider to be used by ToStringWithCulture method. - - - - - This is called from the compile/run appdomain to convert objects within an expression block to a string - - - - - Helper to produce culture-oriented representation of an object as a string - - - - - Class to produce the template output - - - - - Create the template output - - - - - Base class for this transformation - - - - - The string builder that generation-time code is using to assemble generated output - - - - - The error collection for the generation process - - - - - A list of the lengths of each indent that was added with PushIndent - - - - - Gets the current indent we use when adding lines to the output - - - - - Current transformation session - - - - - Write text directly into the generated output - - - - - Write text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Write formatted text directly into the generated output - - - - - Raise an error - - - - - Raise a warning - - - - - Increase the indent - - - - - Remove the last indent that was added with PushIndent - - - - - Remove any indentation - - - - - Utility class to produce culture-oriented representation of an object as a string. - - - - - Gets or sets format provider to be used by ToStringWithCulture method. - - - - - This is called from the compile/run appdomain to convert objects within an expression block to a string - - - - - Helper to produce culture-oriented representation of an object as a string - - - - The TypeScript output templates. - - - Uses JQuery with callbacks. - - - Uses JQuery with Promises/A+. - - - Uses $http from AngularJS 1.x. - - - Uses the http service from AngularJS 2.x. - - - Uses the window.fetch API. - - - Uses the Aurelia fetch service. - - - Generates the code to process the response. - - - Renders the client class helper methods. - The model. - The tab count. - The helper methods. - - - Renders the URL generation code. - The operation. - The tab count. - Rendered request body - - - Renders the request body generation code. - The operation. - The tab count. - Rendered request body - - - Renders the respone process code. - The operation. - The tab count. - Rendered request body - - - Generates a TypeScript type name (Error is renamed to ErrorDto, otherwise the defaults are used). - - - Generates the type name for the given schema. - The schema. - The type name hint. - The type name. - - - diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.dll deleted file mode 100644 index 7d4032eac4..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.dll.config b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.dll.config deleted file mode 100644 index 8460dd432e..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.dll.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.pdb b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.pdb deleted file mode 100644 index e1c6fd11f7..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.pdb and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.xml b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.xml deleted file mode 100644 index 287215bfd8..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.CodeGeneration.xml +++ /dev/null @@ -1,552 +0,0 @@ - - - - NSwag.CodeGeneration - - - - The client generator base. - The type of the operation model. - The type of the parameter model. - The type of the response model. - - - - Initializes a new instance of the class. - The type resolver. - The code generator settings. - - - Generates the the whole file containing all needed types. - The code - - - Gets the base settings. - - - Gets the type. - The schema. - if set to true [is nullable]. - The type name hint. - The type name. - - - Gets the type resolver. - - - Generates the file. - The client code. - The client classes. - Type of the output. - The code. - - - Generates the client class. - Name of the controller. - Name of the controller class. - The operations. - Type of the output. - The code. - - - Creates an operation model. - The operation. - The settings. - The operation model. - - - Generates the file. - The document. - The type. - The code. - - - Settings for the ClientGeneratorBase. - - - Initializes a new instance of the class. - - - Gets the code generator settings. - - - Gets or sets the class name of the service client or controller. - - - Gets or sets a value indicating whether to generate DTO classes (default: true). - - - Gets or sets a value indicating whether to generate interfaces for the client classes (default: false). - - - Gets or sets a value indicating whether to generate client types (default: true). - - - Gets or sets the operation name generator. - - - Gets or sets a value indicating whether to reorder parameters (required first, optional at the end) and generate optional C# parameters (default: true). - - - Gets or sets the parameter name generator. - - - Generates the name of the controller based on the provided settings. - Name of the controller. - The controller name. - - - Specifies the output type. - - - A single output with contracts and implementation. - - - The contracts output. - - - The implementation output. - - - Settings for the ClientGeneratorBase. - - - Initializes a new instance of the class. - - - Gets or sets a value indicating whether to generate DTO classes (default: true). - - - The default parameter name generator. - - - Generates the parameter name for the given parameter. - The parameter. - All parameters. - The parameter name. - - - The default template factory which loads templates from embedded resources. - - - Creates a template for the given language, template name and template model. - The package name (i.e. language). - The template name. - The template model. - The template. - Supports NJsonSchema and NSwag embedded templates. - - - The client generator interface. - - - Gets the type. - The schema. - if set to true [is nullable]. - The type name hint. - The type name. - - - The parameter name generator interface. - - - Generates the parameter name for the given parameter. - The parameter. - All parameters. - The parameter name. - - - JSON Schema extensions. - - - Checks whether the schema uses an object schema somewhere (i.e. does it require a DTO class). - The schema. - true or false - - - The operation model interface. - - - Gets the responses. - - - The Swagger operation template model. - - - Initializes a new instance of the class. - The exception schema. - The operation. - The resolver. - The generator. - The settings. - - - Creates the response model. - The status code. - The response. - The exception schema. - The generator. - The settings. - The response model. - - - Gets or sets the operation. - - - Gets the operation ID. - - - Gets or sets the HTTP path (i.e. the absolute route). - - - Gets or sets the HTTP method. - - - Gets or sets the name of the operation. - - - Gets the actual name of the operation (language specific). - - - Gets the HTTP method in uppercase. - - - Gets the HTTP method in lowercase. - - - Gets a value indicating whether the HTTP method is GET or DELETE or HEAD. - - - Gets a value indicating whether the HTTP method is GET or HEAD. - - - Gets or sets a value indicating whether the operation has a result type (i.e. not void). - - - Gets or sets the type of the result. - - - Gets the type of the unwrapped result type (without Task). - - - Gets a value indicating whether the result has description. - - - Gets or sets the result description. - - - Gets the name of the controller. - - - Gets or sets the type of the exception. - - - Gets or sets the responses. - - - Gets a value indicating whether the operation has default response. - - - Gets or sets the default response. - - - Gets a value indicating whether the operation has an explicit success response defined. - - - Gets the success response. - - - Gets the responses. - - - Gets or sets the parameters. - - - Gets a value indicating whether the operation has only a default response. - - - Gets a value indicating whether the operation has content parameter. - - - Gets a value indicating whether the the request has a body. - - - Gets the content parameter. - - - Gets the path parameters. - - - Gets the query parameters. - - - Gets a value indicating whether the operation has query parameters. - - - Gets the header parameters. - - - Gets or sets a value indicating whether the accept header is defined in a parameter. - - - Gets or sets a value indicating whether the operation has form parameters. - - - Gets the form parameters. - - - Gets a value indicating whether the operation has summary. - - - Gets the summary text. - - - Gets a value indicating whether the operation has any documentation. - - - Gets a value indicating whether the operation is deprecated. - - - Gets or sets a value indicating whether this operation has an XML body parameter. - - - Gets the mime type of the request body. - - - Gets the mime type of the response body. - - - Gets a value indicating whether a file response is expected from one of the responses. - - - Gets the success response. - The response. - - - Gets the name of the parameter variable. - The parameter. - All parameters. - The parameter variable name. - - - Resolves the type of the parameter. - The parameter. - The parameter type name. - - - The parameter template model. - - - Initializes a new instance of the class. - Name of the parameter. - Name of the variable. - The type name. - The parameter. - All parameters. - The settings. - The client generator base. - - - Gets the type of the parameter. - - - Gets the name. - - - Gets the variable name in (usually lowercase). - - - Gets the parameter kind. - - - Gets a value indicating whether the parameter has a description. - - - Gets the parameter description. - - - Gets the schema. - - - Gets a value indicating whether the parameter is required. - - - Gets a value indicating whether the parameter is nullable. - - - Gets a value indicating whether the parameter is optional (i.e. not required). - - - Gets a value indicating whether the parameter has a description or is optional. - - - Gets a value indicating whether the parameter is the last parameter of the operation. - - - Gets a value indicating whether this is an XML body parameter. - - - Gets a value indicating whether the parameter is of type date. - - - Gets a value indicating whether the parameter is of type array. - - - Gets a value indicating whether the parameter is a string array. - - - Gets a value indicating whether this is a file parameter. - - - Gets a value indicating whether the parameter is of type dictionary. - - - Gets a value indicating whether the parameter is of type date array. - - - Gets a value indicating whether the parameter is of type object array. - - - The response template model. - - - Initializes a new instance of the class. - The status code. - The response. - Specifies whether this is the success response. - The exception schema. - The settings. - The client generator. - - - Gets the HTTP status code. - - - Gets the type of the response. - - - Gets a value indicating whether the response has a type (i.e. not void). - - - Gets or sets the expected child schemas of the base schema (can be used for generating enhanced typings/documentation). - - - Gets a value indicating whether the response is of type date. - - - Gets a value indicating whether this is a file response. - - - Gets the response's exception description. - - - Gets the actual response schema. - - - Gets the schema. - - - Gets a value indicating whether the response is nullable. - - - Gets a value indicating whether the response type inherits from exception. - - - Gets a value indicating whether this is the primary success response. - - - Gets a value indicating whether this is success response. - - - Gets a value indicating whether this is an exceptional response. - - - Generates the client and operation name for a given operation. - - - Gets a value indicating whether the generator supports multiple client classes. - - - Gets the client name for a given operation (may be empty). - The Swagger document. - The HTTP path. - The HTTP method. - The operation. - The client name. - - - Gets the operation name for a given operation. - The Swagger document. - The HTTP path. - The HTTP method. - The operation. - The operation name. - - - Generates multiple clients and operation names based on the Swagger operation ID (underscore separated). - - - Gets a value indicating whether the generator supports multiple client classes. - - - Gets the client name for a given operation (may be empty). - The Swagger document. - The HTTP path. - The HTTP method. - The operation. - The client name. - - - Gets the operation name for a given operation. - The Swagger document. - The HTTP path. - The HTTP method. - The operation. - The operation name. - - - Generates the client and operation name based on the path segments (operation name = last segment, client name = second to last segment). - - - Gets a value indicating whether the generator supports multiple client classes. - - - Gets the client name for a given operation (may be empty). - The Swagger document. - The HTTP path. - The HTTP method. - The operation. - The client name. - - - Gets the client name for a given operation (may be empty). - The Swagger document. - The HTTP path. - The HTTP method. - The operation. - The client name. - - - Generates the client and operation name based on the Swagger operation ID. - - - Gets a value indicating whether the generator supports multiple client classes. - - - Gets the client name for a given operation (may be empty). - The Swagger document. - The HTTP path. - The HTTP method. - The operation. - The client name. - - - Gets the client name for a given operation (may be empty). - The Swagger document. - The HTTP path. - The HTTP method. - The operation. - The client name. - - - diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Commands.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Commands.dll deleted file mode 100644 index beee5f3a2e..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Commands.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Commands.pdb b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Commands.pdb deleted file mode 100644 index 783746121f..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Commands.pdb and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Commands.xml b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Commands.xml deleted file mode 100644 index d81484fdfc..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Commands.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - NSwag.Commands - - - - The command collection. - - - Gets or sets the SwaggerToTypeScriptClientCommand. - - - Gets or sets the SwaggerToCSharpClientCommand. - - - Gets or sets the SwaggerToCSharpControllerCommand. - - - Gets the items. - - - Creates a new generator instance. - The generator. - - - The argument 'Input' was empty. - - - The argument 'Input' was empty. - - - Creates a new document in the given path. - The file path. - The task. - - - Loads an existing NSwagDocument. - The file path. - The document. - - - Reads a Swagger specification from JSON or an URL. - - - Gets or sets the input Swagger specification. - - - Gets or sets the input Swagger specification URL. - - - Runs the asynchronous. - The processor. - The host. - - - - - - - Occurs when property changed. - - - Called when property changed. - - - Specifies how the operation name and client classes/interfaces are generated. - - - Multiple clients from the Swagger operation ID in the form '{controller}_{action}'. - - - From path segments (operation name = last segment, client name = second to last segment). - - - From the Swagger operation ID. - - - Prints the tool chain version. - - - Runs the command. - The processor. - The host. - The output. - - - Creates a new generator instance. - The generator. - - - - - - Initializes a new instance of the class. - The command assembly. - The host. - - - Processes the command line arguments. - The arguments. - The result. - - - The NSwagDocument base class. - - - - Initializes a new instance of the class. - - - Converts a path to an absolute path. - The path to convert. - The absolute path. - - - Converts a path to an relative path. - The path to convert. - The relative path. - - - Gets or sets the selected swagger generator JSON. - - - Gets the swagger generators. - - - Gets the code generators. - - - Gets or sets the path. - - - Gets the name of the document. - - - Gets a value indicating whether the document is dirty (has any changes). - - - Gets the selected Swagger generator. - - - Creates a new NSwagDocument. - The type. - The document. - - - Loads an existing NSwagDocument. - The type. - The file path. - The mappings. - The document. - - - Saves the document. - The task. - - - Executes the document. - The task. - - - Occurs when a property value changes. - - - Raises all properties changed. - - - - - - Gets or sets the input to swagger command. - - - Gets or sets the json schema to swagger command. - - - Gets or sets the Web API to swagger command. - - - Gets or sets the assembly type to swagger command. - - - Gets the items. - - - diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Core.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Core.dll deleted file mode 100644 index aa354617be..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Core.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Core.dll.config b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Core.dll.config deleted file mode 100644 index de5386a470..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Core.dll.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Core.pdb b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Core.pdb deleted file mode 100644 index 08d668d4a8..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Core.pdb and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Core.xml b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Core.xml deleted file mode 100644 index cfb46de733..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.Core.xml +++ /dev/null @@ -1,752 +0,0 @@ - - - - NSwag.Core - - - - An implementation of an observable dictionary. - The type of the key. - The type of the value. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The dictionary to initialize this dictionary. - - - Initializes a new instance of the class. - The comparer. - - - Initializes a new instance of the class. - The capacity. - - - Initializes a new instance of the class. - The dictionary to initialize this dictionary. - The comparer. - - - Initializes a new instance of the class. - The capacity. - The comparer. - - - Gets the underlying dictonary. - - - Adds multiple key-value pairs the the dictionary. - The key-value pairs. - - - Inserts a key-value pair into the dictionary. - The key. - The value. - If true and key already exists then an exception is thrown. - - - Called when the property has changed. - Name of the property. - - - Called when the collection has changed. - - - Called when the collection has changed. - The action. - The changed item. - - - Called when the collection has changed. - The action. - The new item. - The old item. - - - Called when the collection has changed. - The action. - The new items. - - - Adds the specified key. - The key. - The value. - - - Determines whether the specified key contains key. - The key. - - - - Gets an containing the keys of the . - - - Removes the specified key. - The key. - - key - - - Tries the get value. - The key. - The value. - - - - Gets an containing the values in the . - - - Gets or sets the TValue with the specified key. - The TValue. - The key. - - - - Adds the specified item. - The item. - - - Removes all items from the . - - - Initializes the specified key value pairs. - The key value pairs. - - - Initializes the specified key value pairs. - The key value pairs. - - - Determines whether [contains] [the specified key]. - The key. - - - - Removes the specified key. - The key. - - - Gets a value indicating whether the object has a fixed size. - - - Determines whether [contains] [the specified item]. - The item. - - - - Copies to. - The array. - Index of the array. - - - Copies to. - The array. - The index. - - - Gets the number of elements contained in the . - - - Gets a value indicating whether access to the is synchronized (thread safe). - - - Gets an object that can be used to synchronize access to the . - - - Gets a value indicating whether the is read-only. - - - Removes the specified item. - The item. - - - - Returns an enumerator that iterates through the collection. - A that can be used to iterate through the collection. - - - Occurs when the collection has changed. - - - Occurs when a property has changed. - - - Special JsonConvert resolver that allows you to ignore properties. See http://stackoverflow.com/a/13588192/1037948 - - - Initializes a new instance of the class. - - - Explicitly ignore the given property(s) for the given type - The type. - One or more properties to ignore. Leave empty to ignore the type entirely. - - - Is the given property for the given type ignored? - The type. - Name of the property. - - - - Rename a property for a given type - The type. - Name of the property. - New name of the property. - - - - - - The type. - Name of the property. - New name of the property. - - - - The decision logic goes here - The member to create a for. - The member's parent . - A created for the given . - - - Contains HTTP utilities. - - - Checks whether the given HTTP status code indicates success. - The HTTP status code. - true if success. - - - The web service contact description. - - - Gets or sets the name. - - - Gets or sets the contact URL. - - - Gets or sets the contact email. - - - Describes a JSON web service. - - - Initializes a new instance of the class. - - - Gets the NSwag toolchain version. - - - Gets the document path (URI or file path). - - - Gets or sets the Swagger generator information. - - - Gets or sets the Swagger specification version being used. - - - Gets or sets the metadata about the API. - - - Gets or sets the host (name or ip) serving the API. - - - Gets or sets the base path on which the API is served, which is relative to the . - - - Gets or sets the schemes. - - - Gets or sets a list of MIME types the operation can consume. - - - Gets or sets a list of MIME types the operation can produce. - - - Gets or sets the operations. - - - Gets or sets the types. - - - Gets or sets the parameters which can be used for all operations. - - - Gets or sets the responses which can be used for all operations. - - - Gets or sets the security definitions. - - - Gets or sets a security description. - - - Gets or sets the description. - - - Gets the base URL of the web service. - - - Gets or sets the external documentation. - - - Converts the description object to JSON. - The JSON string. - - - Converts the description object to JSON. - The JSON Schema generator settings. - The JSON string. - - - Creates a Swagger specification from a JSON string. - The JSON data. - The document path (URL or file path) for resolving relative document references. - The . - - - Creates a Swagger specification from a JSON file. - The file path. - The . - - - Creates a Swagger specification from an URL. - The URL. - The . - - - Gets the operations. - - - Generates missing or non-unique operation IDs. - - - The external documentation description. - - - Gets or sets the description. - - - Gets or sets the documentation URL. - - - A collection of headers. - - - The web service description. - - - Gets or sets the title. - - - Gets or sets the description. - - - Gets or sets the terms of service. - - - Gets or sets the contact information. - - - Gets or sets the license information. - - - Gets or sets the API version. - - - Get or set the schema less extensions (this can be used as vendor extensions as well) in Path schema - - - The license information. - - - Gets or sets the name. - - - Gets or sets the license URL. - - - Enumeration of the OAuth2 flows. - - - An undefined flow. - - - Use implicit flow. - - - Use password flow. - - - Use application flow. - - - Use access code flow. - - - Describes a JSON web service operation. - - - Initializes a new instance of the class. - - - Gets the parent operations list. - - - Gets or sets the tags. - - - Gets or sets the summary of the operation. - - - Gets or sets the long description of the operation. - - - Gets or sets the external documentation. - - - Gets or sets the operation ID (unique name). - - - Gets or sets the schemes. - - - Gets or sets a list of MIME types the operation can consume. - - - Gets or sets a list of MIME types the operation can produce. - - - Gets or sets the parameters. - - - Gets the actual parameters (a combination of all inherited and local parameters). - - - Gets or sets the HTTP Status Code/Response pairs. - - - Gets or sets a value indicating whether the operation is deprecated. - - - Gets or sets a security description. - - - Get or set the schema less extensions (this can be used as vendor extensions as well). - - - Gets the list of MIME types the operation can consume, either from the operation or from the . - - - Gets the list of MIME types the operation can produce, either from the operation or from the . - - - Gets the actual schemes, either from the operation or from the . - - - Gets the responses from the operation and from the . - - - Gets the actual security description, either from the operation or from the . - - - Flattened information about an operation. - - - Gets or sets the relative URL path. - - - Gets or sets the HTTP method. - - - Gets or sets the operation. - - - Enumeration of the available HTTP methods. - - - An undefined method. - - - The HTTP GET method. - - - The HTTP POST method. - - - The HTTP PUT method. - - - The HTTP DELETE method. - - - The HTTP OPTIONS method. - - - The HTTP HEAD method. - - - The HTTP PATCH method. - - - A Swagger path. - - - Initializes a new instance of the class. - - - Gets the parent . - - - Gets or sets the parameters. - - - Describes an operation parameter. - - - Gets the parent operation. - - - Gets or sets the name. - - - Gets or sets the kind of the parameter. - - - Gets or sets a value indicating whether the parameter is required (default: false). - - - Gets or sets a value indicating whether passing empty-valued parameters is allowed (default: false). - - - Gets or sets the schema which is only available when == body. - - - Sets a value indicating whether the parameter can be null (use IsNullable() to get a parameter's nullability). - The Swagger spec does not support null in schemas, see https://github.com/OAI/OpenAPI-Specification/issues/229 - - - Gets the actual schema, either the parameter schema itself (or its reference) or the property when == body. - The schema reference path is not resolved. - - - Gets or sets the format of the array if type array is used. - - - Gets a value indicating whether the validated data can be null. - The null handling. - The result. - - - Gets a value indicating whether this is an XML body parameter. - - - Defines the collectionFormat of a parameter. - - - An undefined format. - - - Comma separated values "foo, bar". - - - Space separated values "foo bar". - - - Tab separated values "foo\tbar". - - - Pipe separated values "foo|bar". - - - Corresponds to multiple parameter instances instead of multiple values for a single instance "foo=bar&foo=baz". - - - Enumeration of the parameter kinds. - - - An undefined kind. - - - A JSON object as POST or PUT body (only one parameter of this type is allowed). - - - A query key-value pair. - - - An URL path placeholder. - - - A HTTP header parameter. - - - A form data parameter. - - - A model binding parameter (either form data, path or query; by default query; generated by Swashbuckle). - - - The Swagger response. - - - Gets the parent . - - - Gets or sets the response's description. - - - Gets or sets the response schema. - - - Gets or sets the headers. - - - Sets a value indicating whether the response can be null (use IsNullable() to get a parameter's nullability). - The Swagger spec does not support null in schemas, see https://github.com/OAI/OpenAPI-Specification/issues/229 - - - Gets the actual non-nullable response schema (either oneOf schema or the actual schema). - - - Get or set the schema less extensions (this can be used as vendor extensions as well) in response schema. - - - Gets or sets the expected child schemas of the base schema (can be used for generating enhanced typings/documentation). - - - Determines whether the specified null handling is nullable (fallback value: false). - The null handling. - The result. - - - Determines whether the specified null handling is nullable. - The null handling. - The fallback value when 'x-nullable' is not defined. - The result. - - - - - - Gets or sets the description. - - - Gets or sets the schema. - - - A collection of Swagger responses. - - - The enumeration of Swagger protocol schemes. - - - An undefined schema. - - - The HTTP schema. - - - The HTTPS schema. - - - The WS schema. - - - The WSS schema. - - - Appends a JSON Schema to the Definitions of a Swagger document. - - - Initializes a new instance of the class. - The Swagger document. - The settings. - is - - - Appends the schema to the root object. - The schema to append. - The type name hint. - - - Specifies the location of the API Key. - - - The API key kind is not defined. - - - In a query parameter. - - - In the HTTP header. - - - The operation security requirements. - - - The definition of a security scheme that can be used by the operations. - - - Gets or sets the type of the security scheme. - - - Gets or sets the short description for security scheme. - - - Gets or sets the name of the header or query parameter to be used to transmit the API key. - - - Gets or sets the type of the API key. - - - Gets or sets the used by the OAuth2 security scheme. - - - Gets or sets the authorization URL to be used for this flow. - - - Gets or sets the token URL to be used for this flow. . - - - Gets the available scopes for the OAuth2 security scheme. - - - Get or set the schema less extensions (this can be used as vendor extensions as well) in security schema - - - - - - The security scheme is not defined. - - - Basic authentication. - - - API key authentication. - - - OAuth2 authentication. - - - Describes a Swagger tag. - - - Gets or sets the name. - - - Gets or sets the description. - - - Gets or sets the external documentation. - - - Get or set the schema less extensions (this can be used as vendor extensions as well) in tag schema - - - diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.WebApi.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.WebApi.dll deleted file mode 100644 index 62d666cfb7..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.WebApi.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.WebApi.dll.config b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.WebApi.dll.config deleted file mode 100644 index 4a3c60bef1..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.WebApi.dll.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.WebApi.pdb b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.WebApi.pdb deleted file mode 100644 index f3c4ec63f9..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.WebApi.pdb and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.WebApi.xml b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.WebApi.xml deleted file mode 100644 index cdebd66a69..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.WebApi.xml +++ /dev/null @@ -1,224 +0,0 @@ - - - - NSwag.SwaggerGeneration.WebApi - - - - Object reflection extensions. - - - Determines whether the specified property name exists. - The object. - Name of the property. - true if the property exists; otherwise, false. - - - Determines whether the specified property name exists. - The object. - Name of the property. - Default value if the property does not exist. - true if the property exists; otherwise, false. - - - - Uses reflection to provide a common interface to the following types: - * RouteAttribute - * IHttpRouteInfoProvider - * IRouteTemplateProvider - - - - - Uses reflection to provide a common interface to the following types: - * RoutePrefixAttribute - * IRoutePrefix - - - - Processes the SwaggerTagAttribute and SwaggerTagsAttribute on the controller classes. - - - Processes the specified Swagger document. - - - - Generates the operation's parameters. - - - Initializes a new instance of the class. - The settings. - - - Processes the specified method information. - - true if the operation should be added to the Swagger specification. - - - Generates the operation's response objects based on reflection and the ResponseTypeAttribute, SwaggerResponseAttribute and ProducesResponseTypeAttribute attributes. - - - Initializes a new instance of the class. - The settings. - - - Processes the specified method information. - - true if the operation should be added to the Swagger specification. - - - Loads the operation summary and description from the DescriptionAttribute and the XML documentation. - - - Processes the specified method information. - - true if the operation should be added to the Swagger specification. - - - Processes the SwaggerTagsAttribute on the operation method. - - - Processes the specified method information. - - true if the operation should be added to the Swagger specification. - - - Generates the OAuth2 security scopes for an operation by reflecting the AuthorizeAttribute attributes. - - - Initializes a new instance of the class. - The security definition name. - - - Processes the specified method information. - - true if the operation should be added to the Swagger specification. - - - Gets the security scopes for an operation. - The operation description. - The method information. - The scopes. - - - Appends the OAuth2 security scheme to the document's security definitions. - - - Initializes a new instance of the class. - The name/key of the security scheme/definition. - The Swagger security scheme. - - - Processes the specified Swagger document. - - - - - - - Initializes a new instance of the class. - The generator settings. - - - Gets or sets the settings. - - - Generates for controllers. - The controller class names. - The Swagger document. - - - Gets the controller classes. - The controller class names. - - - Settings for the WebApiAssemblyToSwaggerGenerator. - - - Initializes a new instance of the class. - - - Gets or sets the Web API assembly paths. - - - Gets or sets the path to the assembly App.config or Web.config (optional). - - - Gets ot sets the paths where to search for referenced assemblies - - - Generates a object for the given Web API class type. - - - Initializes a new instance of the class. - The settings. - - - Initializes a new instance of the class. - The settings. - The schema generator. - - - Gets all controller class types of the given assembly. - The assembly. - The controller classes. - - - Gets or sets the generator settings. - - - Generates a Swagger specification for the given controller type. - The type of the controller. - The . - The operation has more than one body parameter. - - - Generates a Swagger specification for the given controller type. - The type of the controller. - The . - The operation has more than one body parameter. - - - Generates a Swagger specification for the given controller types. - The types of the controller. - The . - The operation has more than one body parameter. - - - The operation has more than one body parameter. - - - Settings for the . - - - Initializes a new instance of the class. - - - Gets or sets the default Web API URL template (default for Web API: 'api/{controller}/{id}'; for MVC projects: '{controller}/{action}/{id?}'). - - - Gets or sets the Swagger specification title. - - - Gets or sets the Swagger specification description. - - - Gets or sets the Swagger specification version. - - - Gets the operation processor. - - - Gets the operation processor. - - - Gets or sets the document template representing the initial Swagger specification (JSON data). - - - Gets or sets a value indicating whether the controllers are hosted by ASP.NET Core. - - - Gets or sets a value indicating whether to add path parameters which are missing in the action method. - - - diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.dll deleted file mode 100644 index 7b03b1531a..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.pdb b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.pdb deleted file mode 100644 index 7cc014c0d1..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.pdb and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.xml b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.xml deleted file mode 100644 index 55f9be2c6b..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.SwaggerGeneration.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - NSwag.SwaggerGeneration - - - - - - - Initializes a new instance of the class. - The settings. - - - Gets or sets the settings. - - - Generates the swagger document for the specified classes. - The class names. - The Swagger document. - - - Gets the classes. - The class names. - - - Settings for the AssemblyTypeToSwaggerGenerator. - - - Initializes a new instance of the class. - - - Gets or sets the assembly path. - - - Gets or sets the path to the assembly App.config or Web.config (optional). - - - Gets ot sets the paths where to search for referenced assemblies - - - The context. - - - Initializes a new instance of the class. - The document. - The controller types. - The schema resolver. - The schema generator. - - - Gets the Swagger document. - - - Gets the controller types. - - - Gets or sets the schema resolver. - - - Gets or sets the schema generator (call Generate() with JsonSchemaResolver property!). - - - The context. - - - Initializes a new instance of the class. - The document. - The operation description. - Type of the controller. - The method information. - The swagger generator. - All operation descriptions. - - - Gets the Swagger document. - - - Gets or sets the operation description. - - - Gets the type of the controller. - The type of the controller. - - - Gets or sets the method information. - - - Gets or sets the Swagger generator. - - - Gets or sets all operation descriptions. - - - Post processes a generated . - - - Processes the specified Swagger document. - The processor context. - - - Post processes a generated . - - - Processes the specified method information. - The processor context. - true if the operation should be added to the Swagger specification. - - - Provides services to for Swagger generators like the creation of parameters and handling of schemas. - - - Initializes a new instance of the class. - The schema generator. - The schema generator settings. - The schema resolver. - - - Creates a primitive parameter for the given parameter information reflection object. - The name. - The parameter information. - The created parameter. - - - Creates a path parameter for a given type. - Name of the parameter. - Type of the parameter. - The parameter. - - - Creates a primitive parameter for the given parameter information reflection object. - The name. - The description. - Type of the parameter. - The parent attributes. - - - - Gets the contract for the given type. - - The contract. - - - Creates a primitive parameter for the given parameter information reflection object. - The name. - The parameter. - - - - Generates and appends a schema from a given type. - The type. - if set to true [may be null]. - The parent attributes. - - - - A which only generate the schema for the root type. - Referenced types are added to the service's Definitions collection. - - - Initializes a new instance of the class. - The settings. - - - Generates the properties for the given type and schema. - The type of the schema type. - The types. - The JSON object contract. - The properties - The schema resolver. - - - - diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.VersionMissmatchTest.exe b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.VersionMissmatchTest.exe deleted file mode 100644 index ad686346ca..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.VersionMissmatchTest.exe and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.VersionMissmatchTest.exe.config b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.VersionMissmatchTest.exe.config deleted file mode 100644 index 926ea1c928..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.VersionMissmatchTest.exe.config +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.VersionMissmatchTest.pdb b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.VersionMissmatchTest.pdb deleted file mode 100644 index f48e9922e6..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/NSwag.VersionMissmatchTest.pdb and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/Newtonsoft.Json.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/Newtonsoft.Json.dll deleted file mode 100644 index e5c8978e06..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/Newtonsoft.Json.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/Newtonsoft.Json.xml b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/Newtonsoft.Json.xml deleted file mode 100644 index de78eb0c01..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/Newtonsoft.Json.xml +++ /dev/null @@ -1,10760 +0,0 @@ - - - - Newtonsoft.Json - - - - - Represents a BSON Oid (object id). - - - - - Gets or sets the value of the Oid. - - The value of the Oid. - - - - Initializes a new instance of the class. - - The Oid value. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized BSON data. - - - - - Gets or sets a value indicating whether binary data reading should be compatible with incorrect Json.NET 3.5 written binary. - - - true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. - - - - - Gets or sets a value indicating whether the root object will be read as a JSON array. - - - true if the root object will be read as a JSON array; otherwise, false. - - - - - Gets or sets the used when reading values from BSON. - - The used when reading values from BSON. - - - - Initializes a new instance of the class. - - The containing the BSON data to read. - - - - Initializes a new instance of the class. - - The containing the BSON data to read. - - - - Initializes a new instance of the class. - - The containing the BSON data to read. - if set to true the root object will be read as a JSON array. - The used when reading values from BSON. - - - - Initializes a new instance of the class. - - The containing the BSON data to read. - if set to true the root object will be read as a JSON array. - The used when reading values from BSON. - - - - Reads the next JSON token from the underlying . - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Changes the reader's state to . - If is set to true, the underlying is also closed. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating BSON data. - - - - - Gets or sets the used when writing values to BSON. - When set to no conversion will occur. - - The used when writing values to BSON. - - - - Initializes a new instance of the class. - - The to write to. - - - - Initializes a new instance of the class. - - The to write to. - - - - Flushes whatever is in the buffer to the underlying and also flushes the underlying stream. - - - - - Writes the end. - - The token. - - - - Writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - - - - Writes the beginning of a JSON array. - - - - - Writes the beginning of a JSON object. - - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - - - - Closes this writer. - If is set to true, the underlying is also closed. - If is set to true, the JSON is auto-completed. - - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value. - - The [] value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value that represents a BSON object id. - - The Object ID value to write. - - - - Writes a BSON regex. - - The regex pattern. - The regex options. - - - - Specifies how constructors are used when initializing objects during deserialization by the . - - - - - First attempt to use the public default constructor, then fall back to a single parameterized constructor, then to the non-public default constructor. - - - - - Json.NET will use a non-public default constructor before falling back to a parameterized constructor. - - - - - Converts a binary value to and from a base 64 string value. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from JSON and BSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Creates a custom object. - - The object type to convert. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Creates an object which will then be populated by the serializer. - - Type of the object. - The created object. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can write JSON. - - - true if this can write JSON; otherwise, false. - - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Provides a base class for converting a to and from JSON. - - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a F# discriminated union type to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an Entity Framework to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can write JSON. - - - true if this can write JSON; otherwise, false. - - - - - Converts a to and from the ISO 8601 date format (e.g. "2008-04-12T12:53Z"). - - - - - Gets or sets the date time styles used when converting a date to and from JSON. - - The date time styles used when converting a date to and from JSON. - - - - Gets or sets the date time format used when converting a date to and from JSON. - - The date time format used when converting a date to and from JSON. - - - - Gets or sets the culture used when converting a date to and from JSON. - - The culture used when converting a date to and from JSON. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Converts a to and from a JavaScript Date constructor (e.g. new Date(52231943)). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing property value of the JSON that is being converted. - The calling serializer. - The object value. - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from JSON and BSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an to and from its name string value. - - - - - Gets or sets a value indicating whether the written enum text should be camel case. - - true if the written enum text will be camel case; otherwise, false. - - - - Gets or sets a value indicating whether integer values are allowed when deserializing. - - true if integers are allowed when deserializing; otherwise, false. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - true if the written enum text will be camel case; otherwise, false. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from a string (e.g. "1.2.3.4"). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing property value of the JSON that is being converted. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts XML to and from JSON. - - - - - Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produced multiple root elements. - - The name of the deserialized root element. - - - - Gets or sets a flag to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - true if the array attribute is written to the XML; otherwise, false. - - - - Gets or sets a value indicating whether to write the root JSON object. - - true if the JSON root object is omitted; otherwise, false. - - - - Writes the JSON representation of the object. - - The to write to. - The calling serializer. - The value. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Checks if the is a namespace attribute. - - Attribute name to test. - The attribute name prefix if it has one, otherwise an empty string. - true if attribute name is for a namespace attribute, otherwise false. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Specifies how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Floating point numbers are parsed to . - - - - - Floating point numbers are parsed to . - - - - - Specifies how dates are formatted when writing JSON text. - - - - - Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". - - - - - Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". - - - - - Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. - - - - - Date formatted strings are not parsed to a date type and are read as strings. - - - - - Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . - - - - - Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . - - - - - Specifies how to treat the time value when converting between string and . - - - - - Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. - - - - - Treat as a UTC. If the object represents a local time, it is converted to a UTC. - - - - - Treat as a local time if a is being converted to a string. - If a string is being converted to , convert to a local time if a time zone is specified. - - - - - Time zone information should be preserved when converting. - - - - - Specifies default value handling options for the . - - - - - - - - - Include members where the member value is the same as the member's default value when serializing objects. - Included members are written to JSON. Has no effect when deserializing. - - - - - Ignore members where the member value is the same as the member's default value when serializing objects - so that it is not written to JSON. - This option will ignore all default values (e.g. null for objects and nullable types; 0 for integers, - decimals and floating point numbers; and false for booleans). The default value ignored can be changed by - placing the on the property. - - - - - Members with a default value but no JSON will be set to their default value when deserializing. - - - - - Ignore members where the member value is the same as the member's default value when serializing objects - and set members to their default value when deserializing. - - - - - Specifies float format handling options when writing special floating point numbers, e.g. , - and with . - - - - - Write special floating point values as strings in JSON, e.g. "NaN", "Infinity", "-Infinity". - - - - - Write special floating point values as symbols in JSON, e.g. NaN, Infinity, -Infinity. - Note that this will produce non-valid JSON. - - - - - Write special floating point values as the property's default value in JSON, e.g. 0.0 for a property, null for a of property. - - - - - Specifies formatting options for the . - - - - - No special formatting is applied. This is the default. - - - - - Causes child objects to be indented according to the and settings. - - - - - Provides an interface for using pooled arrays. - - The array type content. - - - - Rent an array from the pool. This array must be returned when it is no longer needed. - - The minimum required length of the array. The returned array may be longer. - The rented array from the pool. This array must be returned when it is no longer needed. - - - - Return an array to the pool. - - The array that is being returned. - - - - Provides an interface to enable a class to return line and position information. - - - - - Gets a value indicating whether the class can return line information. - - - true if and can be provided; otherwise, false. - - - - - Gets the current line number. - - The current line number or 0 if no line information is available (for example, when returns false). - - - - Gets the current line position. - - The current line position or 0 if no line information is available (for example, when returns false). - - - - Instructs the how to serialize the collection. - - - - - Gets or sets a value indicating whether null items are allowed in the collection. - - true if null items are allowed in the collection; otherwise, false. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with a flag indicating whether the array can contain null items. - - A flag indicating whether the array can contain null items. - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Instructs the to use the specified constructor when deserializing that object. - - - - - Instructs the how to serialize the object. - - - - - Gets or sets the id. - - The id. - - - - Gets or sets the title. - - The title. - - - - Gets or sets the description. - - The description. - - - - Gets or sets the collection's items converter. - - The collection's items converter. - - - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - When non-null, there must be a constructor defined in the that exactly matches the number, - order, and type of these parameters. - - - - [JsonContainer(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })] - - - - - - Gets or sets the of the . - - The of the . - - - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - When non-null, there must be a constructor defined in the that exactly matches the number, - order, and type of these parameters. - - - - [JsonContainer(NamingStrategyType = typeof(MyNamingStrategy), NamingStrategyParameters = new object[] { 123, "Four" })] - - - - - - Gets or sets a value that indicates whether to preserve object references. - - - true to keep object reference; otherwise, false. The default is false. - - - - - Gets or sets a value that indicates whether to preserve collection's items references. - - - true to keep collection's items object references; otherwise, false. The default is false. - - - - - Gets or sets the reference loop handling used when serializing the collection's items. - - The reference loop handling. - - - - Gets or sets the type name handling used when serializing the collection's items. - - The type name handling. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Provides methods for converting between .NET types and JSON types. - - - - - - - - Gets or sets a function that creates default . - Default settings are automatically used by serialization methods on , - and and on . - To serialize without using any default settings create a with - . - - - - - Represents JavaScript's boolean value true as a string. This field is read-only. - - - - - Represents JavaScript's boolean value false as a string. This field is read-only. - - - - - Represents JavaScript's null as a string. This field is read-only. - - - - - Represents JavaScript's undefined as a string. This field is read-only. - - - - - Represents JavaScript's positive infinity as a string. This field is read-only. - - - - - Represents JavaScript's negative infinity as a string. This field is read-only. - - - - - Represents JavaScript's NaN as a string. This field is read-only. - - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation using the specified. - - The value to convert. - The format the date will be converted to. - The time zone handling when the date is converted to a string. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation using the specified. - - The value to convert. - The format the date will be converted to. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - The string delimiter character. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - The string delimiter character. - The string escape handling. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Serializes the specified object to a JSON string. - - The object to serialize. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using formatting. - - The object to serialize. - Indicates how the output should be formatted. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a collection of . - - The object to serialize. - A collection of converters used while serializing. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using formatting and a collection of . - - The object to serialize. - Indicates how the output should be formatted. - A collection of converters used while serializing. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using . - - The object to serialize. - The used to serialize the object. - If this is null, default serialization settings will be used. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a type, formatting and . - - The object to serialize. - The used to serialize the object. - If this is null, default serialization settings will be used. - - The type of the value being serialized. - This parameter is used when is to write out the type name if the type of the value does not match. - Specifying the type is optional. - - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using formatting and . - - The object to serialize. - Indicates how the output should be formatted. - The used to serialize the object. - If this is null, default serialization settings will be used. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a type, formatting and . - - The object to serialize. - Indicates how the output should be formatted. - The used to serialize the object. - If this is null, default serialization settings will be used. - - The type of the value being serialized. - This parameter is used when is to write out the type name if the type of the value does not match. - Specifying the type is optional. - - - A JSON string representation of the object. - - - - - Deserializes the JSON to a .NET object. - - The JSON to deserialize. - The deserialized object from the JSON string. - - - - Deserializes the JSON to a .NET object using . - - The JSON to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type. - - The JSON to deserialize. - The of object being deserialized. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type. - - The type of the object to deserialize to. - The JSON to deserialize. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the given anonymous type. - - - The anonymous type to deserialize to. This can't be specified - traditionally and must be inferred from the anonymous type passed - as a parameter. - - The JSON to deserialize. - The anonymous type object. - The deserialized anonymous type from the JSON string. - - - - Deserializes the JSON to the given anonymous type using . - - - The anonymous type to deserialize to. This can't be specified - traditionally and must be inferred from the anonymous type passed - as a parameter. - - The JSON to deserialize. - The anonymous type object. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - The deserialized anonymous type from the JSON string. - - - - Deserializes the JSON to the specified .NET type using a collection of . - - The type of the object to deserialize to. - The JSON to deserialize. - Converters to use while deserializing. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using . - - The type of the object to deserialize to. - The object to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using a collection of . - - The JSON to deserialize. - The type of the object to deserialize. - Converters to use while deserializing. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type using . - - The JSON to deserialize. - The type of the object to deserialize to. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - The deserialized object from the JSON string. - - - - Populates the object with values from the JSON string. - - The JSON to populate values from. - The target object to populate values onto. - - - - Populates the object with values from the JSON string using . - - The JSON to populate values from. - The target object to populate values onto. - - The used to deserialize the object. - If this is null, default serialization settings will be used. - - - - - Serializes the to a JSON string. - - The node to serialize. - A JSON string of the . - - - - Serializes the to a JSON string using formatting. - - The node to serialize. - Indicates how the output should be formatted. - A JSON string of the . - - - - Serializes the to a JSON string using formatting and omits the root object if is true. - - The node to serialize. - Indicates how the output should be formatted. - Omits writing the root object. - A JSON string of the . - - - - Deserializes the from a JSON string. - - The JSON string. - The deserialized . - - - - Deserializes the from a JSON string nested in a root element specified by . - - The JSON string. - The name of the root element to append when deserializing. - The deserialized . - - - - Deserializes the from a JSON string nested in a root element specified by - and writes a Json.NET array attribute for collections. - - The JSON string. - The name of the root element to append when deserializing. - - A flag to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - The deserialized . - - - - Serializes the to a JSON string. - - The node to convert to JSON. - A JSON string of the . - - - - Serializes the to a JSON string using formatting. - - The node to convert to JSON. - Indicates how the output should be formatted. - A JSON string of the . - - - - Serializes the to a JSON string using formatting and omits the root object if is true. - - The node to serialize. - Indicates how the output should be formatted. - Omits writing the root object. - A JSON string of the . - - - - Deserializes the from a JSON string. - - The JSON string. - The deserialized . - - - - Deserializes the from a JSON string nested in a root element specified by . - - The JSON string. - The name of the root element to append when deserializing. - The deserialized . - - - - Deserializes the from a JSON string nested in a root element specified by - and writes a Json.NET array attribute for collections. - - The JSON string. - The name of the root element to append when deserializing. - - A flag to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - The deserialized . - - - - Converts an object to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can read JSON. - - true if this can read JSON; otherwise, false. - - - - Gets a value indicating whether this can write JSON. - - true if this can write JSON; otherwise, false. - - - - Instructs the to use the specified when serializing the member or class. - - - - - Gets the of the . - - The of the . - - - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - - - - - Initializes a new instance of the class. - - Type of the . - - - - Initializes a new instance of the class. - - Type of the . - Parameter list to use when constructing the . Can be null. - - - - Represents a collection of . - - - - - Instructs the how to serialize the collection. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - The exception thrown when an error occurs during JSON serialization or deserialization. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Instructs the to deserialize properties with no matching class member into the specified collection - and write values during serialization. - - - - - Gets or sets a value that indicates whether to write extension data when serializing the object. - - - true to write extension data when serializing the object; otherwise, false. The default is true. - - - - - Gets or sets a value that indicates whether to read extension data when deserializing the object. - - - true to read extension data when deserializing the object; otherwise, false. The default is true. - - - - - Initializes a new instance of the class. - - - - - Instructs the not to serialize the public field or public read/write property value. - - - - - Instructs the how to serialize the object. - - - - - Gets or sets the member serialization. - - The member serialization. - - - - Gets or sets a value that indicates whether the object's properties are required. - - - A value indicating whether the object's properties are required. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified member serialization. - - The member serialization. - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Instructs the to always serialize the member with the specified name. - - - - - Gets or sets the used when serializing the property's collection items. - - The collection's items . - - - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - When non-null, there must be a constructor defined in the that exactly matches the number, - order, and type of these parameters. - - - - [JsonProperty(ItemConverterType = typeof(MyContainerConverter), ItemConverterParameters = new object[] { 123, "Four" })] - - - - - - Gets or sets the of the . - - The of the . - - - - The parameter list to use when constructing the described by . - If null, the default constructor is used. - When non-null, there must be a constructor defined in the that exactly matches the number, - order, and type of these parameters. - - - - [JsonProperty(NamingStrategyType = typeof(MyNamingStrategy), NamingStrategyParameters = new object[] { 123, "Four" })] - - - - - - Gets or sets the null value handling used when serializing this property. - - The null value handling. - - - - Gets or sets the default value handling used when serializing this property. - - The default value handling. - - - - Gets or sets the reference loop handling used when serializing this property. - - The reference loop handling. - - - - Gets or sets the object creation handling used when deserializing this property. - - The object creation handling. - - - - Gets or sets the type name handling used when serializing this property. - - The type name handling. - - - - Gets or sets whether this property's value is serialized as a reference. - - Whether this property's value is serialized as a reference. - - - - Gets or sets the order of serialization of a member. - - The numeric order of serialization. - - - - Gets or sets a value indicating whether this property is required. - - - A value indicating whether this property is required. - - - - - Gets or sets the name of the property. - - The name of the property. - - - - Gets or sets the reference loop handling used when serializing the property's collection items. - - The collection's items reference loop handling. - - - - Gets or sets the type name handling used when serializing the property's collection items. - - The collection's items type name handling. - - - - Gets or sets whether this property's collection items are serialized as a reference. - - Whether this property's collection items are serialized as a reference. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified name. - - Name of the property. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized JSON data. - - - - - Asynchronously reads the next JSON token from the source. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns true if the next token was read successfully; false if there are no more tokens to read. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously skips the children of the current token. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously reads the next JSON token from the source as a []. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the []. This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously reads the next JSON token from the source as a . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the . This result will be null at the end of an array. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Specifies the state of the reader. - - - - - A read method has not been called. - - - - - The end of the file has been reached successfully. - - - - - Reader is at a property. - - - - - Reader is at the start of an object. - - - - - Reader is in an object. - - - - - Reader is at the start of an array. - - - - - Reader is in an array. - - - - - The method has been called. - - - - - Reader has just read a value. - - - - - Reader is at the start of a constructor. - - - - - Reader is in a constructor. - - - - - An error occurred that prevents the read operation from continuing. - - - - - The end of the file has been reached successfully. - - - - - Gets the current reader state. - - The current reader state. - - - - Gets or sets a value indicating whether the source should be closed when this reader is closed. - - - true to close the source when this reader is closed; otherwise false. The default is true. - - - - - Gets or sets a value indicating whether multiple pieces of JSON content can - be read from a continuous stream without erroring. - - - true to support reading multiple pieces of JSON content; otherwise false. - The default is false. - - - - - Gets the quotation mark character used to enclose the value of a string. - - - - - Gets or sets how time zones are handled when reading JSON. - - - - - Gets or sets how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Gets or sets how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Gets or sets how custom date formatted strings are parsed when reading JSON. - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Gets the type of the current JSON token. - - - - - Gets the text value of the current JSON token. - - - - - Gets the .NET type for the current JSON token. - - - - - Gets the depth of the current token in the JSON document. - - The depth of the current token in the JSON document. - - - - Gets the path of the current JSON token. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Initializes a new instance of the class. - - - - - Reads the next JSON token from the source. - - true if the next token was read successfully; false if there are no more tokens to read. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a []. - - A [] or null if the next JSON token is null. This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the source as a of . - - A of . This method will return null at the end of an array. - - - - Skips the children of the current token. - - - - - Sets the current token. - - The new token. - - - - Sets the current token and value. - - The new token. - The value. - - - - Sets the current token and value. - - The new token. - The value. - A flag indicating whether the position index inside an array should be updated. - - - - Sets the state based on current token type. - - - - - Releases unmanaged and - optionally - managed resources. - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Changes the reader's state to . - If is set to true, the source is also closed. - - - - - The exception thrown when an error occurs while reading JSON text. - - - - - Gets the line number indicating where the error occurred. - - The line number indicating where the error occurred. - - - - Gets the line position indicating where the error occurred. - - The line position indicating where the error occurred. - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Initializes a new instance of the class - with a specified error message, JSON path, line number, line position, and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The path to the JSON where the error occurred. - The line number indicating where the error occurred. - The line position indicating where the error occurred. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Instructs the to always serialize the member, and to require that the member has a value. - - - - - The exception thrown when an error occurs during JSON serialization or deserialization. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Serializes and deserializes objects into and from the JSON format. - The enables you to control how objects are encoded into JSON. - - - - - Occurs when the errors during serialization and deserialization. - - - - - Gets or sets the used by the serializer when resolving references. - - - - - Gets or sets the used by the serializer when resolving type names. - - - - - Gets or sets the used by the serializer when resolving type names. - - - - - Gets or sets the used by the serializer when writing trace messages. - - The trace writer. - - - - Gets or sets the equality comparer used by the serializer when comparing references. - - The equality comparer. - - - - Gets or sets how type name writing and reading is handled by the serializer. - - - should be used with caution when your application deserializes JSON from an external source. - Incoming types should be validated with a custom - when deserializing with a value other than . - - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - - The type name assembly format. - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - - The type name assembly format. - - - - Gets or sets how object references are preserved by the serializer. - - - - - Gets or sets how reference loops (e.g. a class referencing itself) is handled. - - - - - Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. - - - - - Gets or sets how null values are handled during serialization and deserialization. - - - - - Gets or sets how default values are handled during serialization and deserialization. - - - - - Gets or sets how objects are created during deserialization. - - The object creation handling. - - - - Gets or sets how constructors are used during deserialization. - - The constructor handling. - - - - Gets or sets how metadata properties are used during deserialization. - - The metadata properties handling. - - - - Gets a collection that will be used during serialization. - - Collection that will be used during serialization. - - - - Gets or sets the contract resolver used by the serializer when - serializing .NET objects to JSON and vice versa. - - - - - Gets or sets the used by the serializer when invoking serialization callback methods. - - The context. - - - - Indicates how JSON text output is formatted. - - - - - Gets or sets how dates are written to JSON text. - - - - - Gets or sets how time zones are handled during serialization and deserialization. - - - - - Gets or sets how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Gets or sets how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Gets or sets how special floating point numbers, e.g. , - and , - are written as JSON text. - - - - - Gets or sets how strings are escaped when writing JSON text. - - - - - Gets or sets how and values are formatted when writing JSON text, - and the expected date format when reading JSON text. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. - - - true if there will be a check for additional JSON content after deserializing an object; otherwise, false. - - - - - Initializes a new instance of the class. - - - - - Creates a new instance. - The will not use default settings - from . - - - A new instance. - The will not use default settings - from . - - - - - Creates a new instance using the specified . - The will not use default settings - from . - - The settings to be applied to the . - - A new instance using the specified . - The will not use default settings - from . - - - - - Creates a new instance. - The will use default settings - from . - - - A new instance. - The will use default settings - from . - - - - - Creates a new instance using the specified . - The will use default settings - from as well as the specified . - - The settings to be applied to the . - - A new instance using the specified . - The will use default settings - from as well as the specified . - - - - - Populates the JSON values onto the target object. - - The that contains the JSON structure to reader values from. - The target object to populate values onto. - - - - Populates the JSON values onto the target object. - - The that contains the JSON structure to reader values from. - The target object to populate values onto. - - - - Deserializes the JSON structure contained by the specified . - - The that contains the JSON structure to deserialize. - The being deserialized. - - - - Deserializes the JSON structure contained by the specified - into an instance of the specified type. - - The containing the object. - The of object being deserialized. - The instance of being deserialized. - - - - Deserializes the JSON structure contained by the specified - into an instance of the specified type. - - The containing the object. - The type of the object to deserialize. - The instance of being deserialized. - - - - Deserializes the JSON structure contained by the specified - into an instance of the specified type. - - The containing the object. - The of object being deserialized. - The instance of being deserialized. - - - - Serializes the specified and writes the JSON structure - using the specified . - - The used to write the JSON structure. - The to serialize. - - - - Serializes the specified and writes the JSON structure - using the specified . - - The used to write the JSON structure. - The to serialize. - - The type of the value being serialized. - This parameter is used when is to write out the type name if the type of the value does not match. - Specifying the type is optional. - - - - - Serializes the specified and writes the JSON structure - using the specified . - - The used to write the JSON structure. - The to serialize. - - The type of the value being serialized. - This parameter is used when is Auto to write out the type name if the type of the value does not match. - Specifying the type is optional. - - - - - Serializes the specified and writes the JSON structure - using the specified . - - The used to write the JSON structure. - The to serialize. - - - - Specifies the settings on a object. - - - - - Gets or sets how reference loops (e.g. a class referencing itself) are handled. - - Reference loop handling. - - - - Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. - - Missing member handling. - - - - Gets or sets how objects are created during deserialization. - - The object creation handling. - - - - Gets or sets how null values are handled during serialization and deserialization. - - Null value handling. - - - - Gets or sets how default values are handled during serialization and deserialization. - - The default value handling. - - - - Gets or sets a collection that will be used during serialization. - - The converters. - - - - Gets or sets how object references are preserved by the serializer. - - The preserve references handling. - - - - Gets or sets how type name writing and reading is handled by the serializer. - - - should be used with caution when your application deserializes JSON from an external source. - Incoming types should be validated with a custom - when deserializing with a value other than . - - The type name handling. - - - - Gets or sets how metadata properties are used during deserialization. - - The metadata properties handling. - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - - The type name assembly format. - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - - The type name assembly format. - - - - Gets or sets how constructors are used during deserialization. - - The constructor handling. - - - - Gets or sets the contract resolver used by the serializer when - serializing .NET objects to JSON and vice versa. - - The contract resolver. - - - - Gets or sets the equality comparer used by the serializer when comparing references. - - The equality comparer. - - - - Gets or sets the used by the serializer when resolving references. - - The reference resolver. - - - - Gets or sets a function that creates the used by the serializer when resolving references. - - A function that creates the used by the serializer when resolving references. - - - - Gets or sets the used by the serializer when writing trace messages. - - The trace writer. - - - - Gets or sets the used by the serializer when resolving type names. - - The binder. - - - - Gets or sets the used by the serializer when resolving type names. - - The binder. - - - - Gets or sets the error handler called during serialization and deserialization. - - The error handler called during serialization and deserialization. - - - - Gets or sets the used by the serializer when invoking serialization callback methods. - - The context. - - - - Gets or sets how and values are formatted when writing JSON text, - and the expected date format when reading JSON text. - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Indicates how JSON text output is formatted. - - - - - Gets or sets how dates are written to JSON text. - - - - - Gets or sets how time zones are handled during serialization and deserialization. - - - - - Gets or sets how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Gets or sets how special floating point numbers, e.g. , - and , - are written as JSON. - - - - - Gets or sets how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text. - - - - - Gets or sets how strings are escaped when writing JSON text. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Gets a value indicating whether there will be a check for additional content after deserializing an object. - - - true if there will be a check for additional content after deserializing an object; otherwise, false. - - - - - Initializes a new instance of the class. - - - - - Represents a reader that provides fast, non-cached, forward-only access to JSON text data. - - - - - Asynchronously reads the next JSON token from the source. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns true if the next token was read successfully; false if there are no more tokens to read. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a []. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the []. This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a of . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the of . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously reads the next JSON token from the source as a . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous read. The - property returns the . This result will be null at the end of an array. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Initializes a new instance of the class with the specified . - - The containing the JSON data to read. - - - - Gets or sets the reader's character buffer pool. - - - - - Reads the next JSON token from the underlying . - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a []. - - A [] or null if the next JSON token is null. This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Changes the reader's state to . - If is set to true, the underlying is also closed. - - - - - Gets a value indicating whether the class can return line information. - - - true if and can be provided; otherwise, false. - - - - - Gets the current line number. - - - The current line number or 0 if no line information is available (for example, returns false). - - - - - Gets the current line position. - - - The current line position or 0 if no line information is available (for example, returns false). - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. - - - - - Asynchronously flushes whatever is in the buffer to the destination and also flushes the destination. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the JSON value delimiter. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the specified end token. - - The end token to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously closes this writer. - If is set to true, the destination is also closed. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the end of the current JSON object or array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes indent characters. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes an indent space. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes raw JSON without changing the writer's state. - - The raw JSON to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a null value. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the property name of a name/value pair of a JSON object. - - The name of the property. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the property name of a name/value pair of a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the beginning of a JSON array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the beginning of a JSON object. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the start of a constructor with the given name. - - The name of the constructor. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes an undefined value. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the given white space. - - The string of white space characters. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a [] value. - - The [] value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the end of an array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the end of a constructor. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes the end of a JSON object. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Asynchronously writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - Derived classes must override this method to get asynchronous behaviour. Otherwise it will - execute synchronously, returning an already-completed task. - - - - Gets or sets the writer's character array pool. - - - - - Gets or sets how many s to write for each level in the hierarchy when is set to . - - - - - Gets or sets which character to use to quote attribute values. - - - - - Gets or sets which character to use for indenting when is set to . - - - - - Gets or sets a value indicating whether object names will be surrounded with quotes. - - - - - Initializes a new instance of the class using the specified . - - The to write to. - - - - Flushes whatever is in the buffer to the underlying and also flushes the underlying . - - - - - Closes this writer. - If is set to true, the underlying is also closed. - If is set to true, the JSON is auto-completed. - - - - - Writes the beginning of a JSON object. - - - - - Writes the beginning of a JSON array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the specified end token. - - The end token to write. - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - - - - Writes indent characters. - - - - - Writes the JSON value delimiter. - - - - - Writes an indent space. - - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a value. - - The value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value. - - The [] value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes the given white space. - - The string of white space characters. - - - - Specifies the type of JSON token. - - - - - This is returned by the if a read method has not been called. - - - - - An object start token. - - - - - An array start token. - - - - - A constructor start token. - - - - - An object property name. - - - - - A comment. - - - - - Raw JSON. - - - - - An integer. - - - - - A float. - - - - - A string. - - - - - A boolean. - - - - - A null token. - - - - - An undefined token. - - - - - An object end token. - - - - - An array end token. - - - - - A constructor end token. - - - - - A Date. - - - - - Byte data. - - - - - - Represents a reader that provides validation. - - - JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details. - - - - - - Sets an event handler for receiving schema validation errors. - - - - - Gets the text value of the current JSON token. - - - - - - Gets the depth of the current token in the JSON document. - - The depth of the current token in the JSON document. - - - - Gets the path of the current JSON token. - - - - - Gets the quotation mark character used to enclose the value of a string. - - - - - - Gets the type of the current JSON token. - - - - - - Gets the .NET type for the current JSON token. - - - - - - Initializes a new instance of the class that - validates the content returned from the given . - - The to read from while validating. - - - - Gets or sets the schema. - - The schema. - - - - Gets the used to construct this . - - The specified in the constructor. - - - - Changes the reader's state to . - If is set to true, the underlying is also closed. - - - - - Reads the next JSON token from the underlying as a of . - - A of . - - - - Reads the next JSON token from the underlying as a []. - - - A [] or null if the next JSON token is null. - - - - - Reads the next JSON token from the underlying as a of . - - A of . - - - - Reads the next JSON token from the underlying as a of . - - A of . - - - - Reads the next JSON token from the underlying as a of . - - A of . - - - - Reads the next JSON token from the underlying as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . This method will return null at the end of an array. - - - - Reads the next JSON token from the underlying as a of . - - A of . - - - - Reads the next JSON token from the underlying . - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. - - - - - Asynchronously closes this writer. - If is set to true, the destination is also closed. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously flushes whatever is in the buffer to the destination and also flushes the destination. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes the specified end token. - - The end token to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes indent characters. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes the JSON value delimiter. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes an indent space. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes raw JSON without changing the writer's state. - - The raw JSON to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes the end of the current JSON object or array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes the end of an array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes the end of a constructor. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes the end of a JSON object. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a null value. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes the property name of a name/value pair of a JSON object. - - The name of the property. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes the property name of a name/value pair of a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes the beginning of a JSON array. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes the start of a constructor with the given name. - - The name of the constructor. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes the beginning of a JSON object. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes the current token. - - The to read the token from. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes the current token. - - The to read the token from. - A flag indicating whether the current token's children should be written. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes the token and its value. - - The to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes the token and its value. - - The to write. - - The value to write. - A value is only required for tokens that have an associated value, e.g. the property name for . - null can be passed to the method for tokens that don't have a value, e.g. . - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a [] value. - - The [] value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a value. - - The value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes a of value. - - The of value to write. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes an undefined value. - - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously writes the given white space. - - The string of white space characters. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Asynchronously ets the state of the . - - The being written. - The value being written. - The token to monitor for cancellation requests. The default value is . - A that represents the asynchronous operation. - The default behaviour is to execute synchronously, returning an already-completed task. Derived - classes can override this behaviour for true asychronousity. - - - - Gets or sets a value indicating whether the destination should be closed when this writer is closed. - - - true to close the destination when this writer is closed; otherwise false. The default is true. - - - - - Gets or sets a value indicating whether the JSON should be auto-completed when this writer is closed. - - - true to auto-complete the JSON when this writer is closed; otherwise false. The default is true. - - - - - Gets the top. - - The top. - - - - Gets the state of the writer. - - - - - Gets the path of the writer. - - - - - Gets or sets a value indicating how JSON text output should be formatted. - - - - - Gets or sets how dates are written to JSON text. - - - - - Gets or sets how time zones are handled when writing JSON text. - - - - - Gets or sets how strings are escaped when writing JSON text. - - - - - Gets or sets how special floating point numbers, e.g. , - and , - are written to JSON text. - - - - - Gets or sets how and values are formatted when writing JSON text. - - - - - Gets or sets the culture used when writing JSON. Defaults to . - - - - - Initializes a new instance of the class. - - - - - Flushes whatever is in the buffer to the destination and also flushes the destination. - - - - - Closes this writer. - If is set to true, the destination is also closed. - If is set to true, the JSON is auto-completed. - - - - - Writes the beginning of a JSON object. - - - - - Writes the end of a JSON object. - - - - - Writes the beginning of a JSON array. - - - - - Writes the end of an array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the end constructor. - - - - - Writes the property name of a name/value pair of a JSON object. - - The name of the property. - - - - Writes the property name of a name/value pair of a JSON object. - - The name of the property. - A flag to indicate whether the text should be escaped when it is written as a JSON property name. - - - - Writes the end of the current JSON object or array. - - - - - Writes the current token and its children. - - The to read the token from. - - - - Writes the current token. - - The to read the token from. - A flag indicating whether the current token's children should be written. - - - - Writes the token and its value. - - The to write. - - The value to write. - A value is only required for tokens that have an associated value, e.g. the property name for . - null can be passed to the method for tokens that don't have a value, e.g. . - - - - - Writes the token. - - The to write. - - - - Writes the specified end token. - - The end token to write. - - - - Writes indent characters. - - - - - Writes the JSON value delimiter. - - - - - Writes an indent space. - - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON without changing the writer's state. - - The raw JSON to write. - - - - Writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a of value. - - The of value to write. - - - - Writes a [] value. - - The [] value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes the given white space. - - The string of white space characters. - - - - Releases unmanaged and - optionally - managed resources. - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Sets the state of the . - - The being written. - The value being written. - - - - The exception thrown when an error occurs while writing JSON text. - - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - Initializes a new instance of the class - with a specified error message, JSON path and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The path to the JSON where the error occurred. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Specifies how JSON comments are handled when loading JSON. - - - - - Ignore comments. - - - - - Load comments as a with type . - - - - - Specifies how line information is handled when loading JSON. - - - - - Ignore line information. - - - - - Load line information. - - - - - Contains the LINQ to JSON extension methods. - - - - - Returns a collection of tokens that contains the ancestors of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains the ancestors of every token in the source collection. - - - - Returns a collection of tokens that contains every token in the source collection, and the ancestors of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains every token in the source collection, the ancestors of every token in the source collection. - - - - Returns a collection of tokens that contains the descendants of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains the descendants of every token in the source collection. - - - - Returns a collection of tokens that contains every token in the source collection, and the descendants of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains every token in the source collection, and the descendants of every token in the source collection. - - - - Returns a collection of child properties of every object in the source collection. - - An of that contains the source collection. - An of that contains the properties of every object in the source collection. - - - - Returns a collection of child values of every object in the source collection with the given key. - - An of that contains the source collection. - The token key. - An of that contains the values of every token in the source collection with the given key. - - - - Returns a collection of child values of every object in the source collection. - - An of that contains the source collection. - An of that contains the values of every token in the source collection. - - - - Returns a collection of converted child values of every object in the source collection with the given key. - - The type to convert the values to. - An of that contains the source collection. - The token key. - An that contains the converted values of every token in the source collection with the given key. - - - - Returns a collection of converted child values of every object in the source collection. - - The type to convert the values to. - An of that contains the source collection. - An that contains the converted values of every token in the source collection. - - - - Converts the value. - - The type to convert the value to. - A cast as a of . - A converted value. - - - - Converts the value. - - The source collection type. - The type to convert the value to. - A cast as a of . - A converted value. - - - - Returns a collection of child tokens of every array in the source collection. - - The source collection type. - An of that contains the source collection. - An of that contains the values of every token in the source collection. - - - - Returns a collection of converted child tokens of every array in the source collection. - - An of that contains the source collection. - The type to convert the values to. - The source collection type. - An that contains the converted values of every token in the source collection. - - - - Returns the input typed as . - - An of that contains the source collection. - The input typed as . - - - - Returns the input typed as . - - The source collection type. - An of that contains the source collection. - The input typed as . - - - - Represents a collection of objects. - - The type of token. - - - - Gets the of with the specified key. - - - - - - Represents a JSON array. - - - - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - A representing the asynchronous load. The property contains the JSON that was read from the specified . - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - A representing the asynchronous load. The property contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets the node type for this . - - The type. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Loads an from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - A that contains the JSON that was read from the specified . - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - - - - Load a from a string that contains JSON. - - A that contains JSON. - The used to load the JSON. - If this is null, default load settings will be used. - A populated from the string that contains JSON. - - - - - - - Creates a from an object. - - The object that will be used to create . - A with the values of the specified object. - - - - Creates a from an object. - - The object that will be used to create . - The that will be used to read the object. - A with the values of the specified object. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets or sets the at the specified index. - - - - - - Determines the index of a specific item in the . - - The object to locate in the . - - The index of if found in the list; otherwise, -1. - - - - - Inserts an item to the at the specified index. - - The zero-based index at which should be inserted. - The object to insert into the . - - is not a valid index in the . - - - - - Removes the item at the specified index. - - The zero-based index of the item to remove. - - is not a valid index in the . - - - - - Returns an enumerator that iterates through the collection. - - - A of that can be used to iterate through the collection. - - - - - Adds an item to the . - - The object to add to the . - - - - Removes all items from the . - - - - - Determines whether the contains a specific value. - - The object to locate in the . - - true if is found in the ; otherwise, false. - - - - - Copies the elements of the to an array, starting at a particular array index. - - The array. - Index of the array. - - - - Gets a value indicating whether the is read-only. - - true if the is read-only; otherwise, false. - - - - Removes the first occurrence of a specific object from the . - - The object to remove from the . - - true if was successfully removed from the ; otherwise, false. This method also returns false if is not found in the original . - - - - - Represents a JSON constructor. - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous load. The - property returns a that contains the JSON that was read from the specified . - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous load. The - property returns a that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets or sets the name of this constructor. - - The constructor name. - - - - Gets the node type for this . - - The type. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified name and content. - - The constructor name. - The contents of the constructor. - - - - Initializes a new instance of the class with the specified name and content. - - The constructor name. - The contents of the constructor. - - - - Initializes a new instance of the class with the specified name. - - The constructor name. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Gets the with the specified key. - - The with the specified key. - - - - Loads a from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - A that contains the JSON that was read from the specified . - - - - Represents a token that can contain other tokens. - - - - - Occurs when the list changes or an item in the list changes. - - - - - Occurs before an item is added to the collection. - - - - - Occurs when the items list of the collection has changed, or the collection is reset. - - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Raises the event. - - The instance containing the event data. - - - - Raises the event. - - The instance containing the event data. - - - - Raises the event. - - The instance containing the event data. - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Get the first child token of this token. - - - A containing the first child token of the . - - - - - Get the last child token of this token. - - - A containing the last child token of the . - - - - - Returns a collection of the child tokens of this token, in document order. - - - An of containing the child tokens of this , in document order. - - - - - Returns a collection of the child values of this token, in document order. - - The type to convert the values to. - - A containing the child values of this , in document order. - - - - - Returns a collection of the descendant tokens for this token in document order. - - An of containing the descendant tokens of the . - - - - Returns a collection of the tokens that contain this token, and all descendant tokens of this token, in document order. - - An of containing this token, and all the descendant tokens of the . - - - - Adds the specified content as children of this . - - The content to be added. - - - - Adds the specified content as the first children of this . - - The content to be added. - - - - Creates a that can be used to add tokens to the . - - A that is ready to have content written to it. - - - - Replaces the child nodes of this token with the specified content. - - The content. - - - - Removes the child nodes from this token. - - - - - Merge the specified content into this . - - The content to be merged. - - - - Merge the specified content into this using . - - The content to be merged. - The used to merge the content. - - - - Gets the count of child JSON tokens. - - The count of child JSON tokens. - - - - Represents a collection of objects. - - The type of token. - - - - An empty collection of objects. - - - - - Initializes a new instance of the struct. - - The enumerable. - - - - Returns an enumerator that can be used to iterate through the collection. - - - A that can be used to iterate through the collection. - - - - - Gets the of with the specified key. - - - - - - Determines whether the specified is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Determines whether the specified is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Represents a JSON object. - - - - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous load. The - property returns a that contains the JSON that was read from the specified . - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous load. The - property returns a that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Occurs when a property value changes. - - - - - Occurs when a property value is changing. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified content. - - The contents of the object. - - - - Initializes a new instance of the class with the specified content. - - The contents of the object. - - - - Gets the node type for this . - - The type. - - - - Gets an of of this object's properties. - - An of of this object's properties. - - - - Gets a the specified name. - - The property name. - A with the specified name or null. - - - - Gets a of of this object's property values. - - A of of this object's property values. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets or sets the with the specified property name. - - - - - - Loads a from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - is not valid JSON. - - - - - Loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - A that contains the JSON that was read from the specified . - - is not valid JSON. - - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - is not valid JSON. - - - - - - - - Load a from a string that contains JSON. - - A that contains JSON. - The used to load the JSON. - If this is null, default load settings will be used. - A populated from the string that contains JSON. - - is not valid JSON. - - - - - - - - Creates a from an object. - - The object that will be used to create . - A with the values of the specified object. - - - - Creates a from an object. - - The object that will be used to create . - The that will be used to read the object. - A with the values of the specified object. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Gets the with the specified property name. - - Name of the property. - The with the specified property name. - - - - Gets the with the specified property name. - The exact property name will be searched for first and if no matching property is found then - the will be used to match a property. - - Name of the property. - One of the enumeration values that specifies how the strings will be compared. - The with the specified property name. - - - - Tries to get the with the specified property name. - The exact property name will be searched for first and if no matching property is found then - the will be used to match a property. - - Name of the property. - The value. - One of the enumeration values that specifies how the strings will be compared. - true if a value was successfully retrieved; otherwise, false. - - - - Adds the specified property name. - - Name of the property. - The value. - - - - Removes the property with the specified name. - - Name of the property. - true if item was successfully removed; otherwise, false. - - - - Tries to get the with the specified property name. - - Name of the property. - The value. - true if a value was successfully retrieved; otherwise, false. - - - - Returns an enumerator that can be used to iterate through the collection. - - - A that can be used to iterate through the collection. - - - - - Raises the event with the provided arguments. - - Name of the property. - - - - Raises the event with the provided arguments. - - Name of the property. - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Represents a JSON property. - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The token to monitor for cancellation requests. The default value is . - A representing the asynchronous creation. The - property returns a that contains the JSON that was read from the specified . - - - - Asynchronously loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - A representing the asynchronous creation. The - property returns a that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets the property name. - - The property name. - - - - Gets or sets the property value. - - The property value. - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Gets the node type for this . - - The type. - - - - Initializes a new instance of the class. - - The property name. - The property content. - - - - Initializes a new instance of the class. - - The property name. - The property content. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Loads a from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Loads a from a . - - A that will be read for the content of the . - The used to load the JSON. - If this is null, default load settings will be used. - A that contains the JSON that was read from the specified . - - - - Represents a raw JSON string. - - - - - Asynchronously creates an instance of with the content of the reader's current token. - - The reader. - The token to monitor for cancellation requests. The default value is . - A representing the asynchronous creation. The - property returns an instance of with the content of the reader's current token. - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class. - - The raw json. - - - - Creates an instance of with the content of the reader's current token. - - The reader. - An instance of with the content of the reader's current token. - - - - Specifies the settings used when merging JSON. - - - - - Gets or sets the method used when merging JSON arrays. - - The method used when merging JSON arrays. - - - - Gets or sets how null value properties are merged. - - How null value properties are merged. - - - - Represents a view of a . - - - - - Initializes a new instance of the class. - - The name. - - - - When overridden in a derived class, returns whether resetting an object changes its value. - - - true if resetting the component changes its value; otherwise, false. - - The component to test for reset capability. - - - - When overridden in a derived class, gets the current value of the property on a component. - - - The value of a property for a given component. - - The component with the property for which to retrieve the value. - - - - When overridden in a derived class, resets the value for this property of the component to the default value. - - The component with the property value that is to be reset to the default value. - - - - When overridden in a derived class, sets the value of the component to a different value. - - The component with the property value that is to be set. - The new value. - - - - When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. - - - true if the property should be persisted; otherwise, false. - - The component with the property to be examined for persistence. - - - - When overridden in a derived class, gets the type of the component this property is bound to. - - - A that represents the type of component this property is bound to. - When the or - - methods are invoked, the object specified might be an instance of this type. - - - - - When overridden in a derived class, gets a value indicating whether this property is read-only. - - - true if the property is read-only; otherwise, false. - - - - - When overridden in a derived class, gets the type of the property. - - - A that represents the type of the property. - - - - - Gets the hash code for the name of the member. - - - - The hash code for the name of the member. - - - - - Represents an abstract JSON token. - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Writes this token to a asynchronously. - - A into which this method will write. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Asynchronously creates a from a . - - An positioned at the token to read into this . - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous creation. The - property returns a that contains - the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Asynchronously creates a from a . - - An positioned at the token to read into this . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous creation. The - property returns a that contains - the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Asynchronously creates a from a . - - A positioned at the token to read into this . - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous creation. The - property returns a that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Asynchronously creates a from a . - - A positioned at the token to read into this . - The used to load the JSON. - If this is null, default load settings will be used. - The token to monitor for cancellation requests. The default value is . - - A that represents the asynchronous creation. The - property returns a that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Gets a comparer that can compare two tokens for value equality. - - A that can compare two nodes for value equality. - - - - Gets or sets the parent. - - The parent. - - - - Gets the root of this . - - The root of this . - - - - Gets the node type for this . - - The type. - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Compares the values of two tokens, including the values of all descendant tokens. - - The first to compare. - The second to compare. - true if the tokens are equal; otherwise false. - - - - Gets the next sibling token of this node. - - The that contains the next sibling token. - - - - Gets the previous sibling token of this node. - - The that contains the previous sibling token. - - - - Gets the path of the JSON token. - - - - - Adds the specified content immediately after this token. - - A content object that contains simple content or a collection of content objects to be added after this token. - - - - Adds the specified content immediately before this token. - - A content object that contains simple content or a collection of content objects to be added before this token. - - - - Returns a collection of the ancestor tokens of this token. - - A collection of the ancestor tokens of this token. - - - - Returns a collection of tokens that contain this token, and the ancestors of this token. - - A collection of tokens that contain this token, and the ancestors of this token. - - - - Returns a collection of the sibling tokens after this token, in document order. - - A collection of the sibling tokens after this tokens, in document order. - - - - Returns a collection of the sibling tokens before this token, in document order. - - A collection of the sibling tokens before this token, in document order. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets the with the specified key converted to the specified type. - - The type to convert the token to. - The token key. - The converted token value. - - - - Get the first child token of this token. - - A containing the first child token of the . - - - - Get the last child token of this token. - - A containing the last child token of the . - - - - Returns a collection of the child tokens of this token, in document order. - - An of containing the child tokens of this , in document order. - - - - Returns a collection of the child tokens of this token, in document order, filtered by the specified type. - - The type to filter the child tokens on. - A containing the child tokens of this , in document order. - - - - Returns a collection of the child values of this token, in document order. - - The type to convert the values to. - A containing the child values of this , in document order. - - - - Removes this token from its parent. - - - - - Replaces this token with the specified token. - - The value. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Returns the indented JSON for this token. - - - The indented JSON for this token. - - - - - Returns the JSON for this token using the given formatting and converters. - - Indicates how the output should be formatted. - A collection of s which will be used when writing the token. - The JSON for this token using the given formatting and converters. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to []. - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to of . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from [] to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from of to . - - The value to create a from. - The initialized with the specified value. - - - - Creates a for this token. - - A that can be used to read this token and its descendants. - - - - Creates a from an object. - - The object that will be used to create . - A with the value of the specified object. - - - - Creates a from an object using the specified . - - The object that will be used to create . - The that will be used when reading the object. - A with the value of the specified object. - - - - Creates an instance of the specified .NET type from the . - - The object type that the token will be deserialized to. - The new object created from the JSON value. - - - - Creates an instance of the specified .NET type from the . - - The object type that the token will be deserialized to. - The new object created from the JSON value. - - - - Creates an instance of the specified .NET type from the using the specified . - - The object type that the token will be deserialized to. - The that will be used when creating the object. - The new object created from the JSON value. - - - - Creates an instance of the specified .NET type from the using the specified . - - The object type that the token will be deserialized to. - The that will be used when creating the object. - The new object created from the JSON value. - - - - Creates a from a . - - A positioned at the token to read into this . - - A that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Creates a from a . - - An positioned at the token to read into this . - The used to load the JSON. - If this is null, default load settings will be used. - - A that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Load a from a string that contains JSON. - - A that contains JSON. - The used to load the JSON. - If this is null, default load settings will be used. - A populated from the string that contains JSON. - - - - Creates a from a . - - A positioned at the token to read into this . - The used to load the JSON. - If this is null, default load settings will be used. - - A that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Creates a from a . - - A positioned at the token to read into this . - - A that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Selects a using a JPath expression. Selects the token that matches the object path. - - - A that contains a JPath expression. - - A , or null. - - - - Selects a using a JPath expression. Selects the token that matches the object path. - - - A that contains a JPath expression. - - A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. - A . - - - - Selects a collection of elements using a JPath expression. - - - A that contains a JPath expression. - - An of that contains the selected elements. - - - - Selects a collection of elements using a JPath expression. - - - A that contains a JPath expression. - - A flag to indicate whether an error should be thrown if no tokens are found when evaluating part of the expression. - An of that contains the selected elements. - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Creates a new instance of the . All child tokens are recursively cloned. - - A new instance of the . - - - - Adds an object to the annotation list of this . - - The annotation to add. - - - - Get the first annotation object of the specified type from this . - - The type of the annotation to retrieve. - The first annotation object that matches the specified type, or null if no annotation is of the specified type. - - - - Gets the first annotation object of the specified type from this . - - The of the annotation to retrieve. - The first annotation object that matches the specified type, or null if no annotation is of the specified type. - - - - Gets a collection of annotations of the specified type for this . - - The type of the annotations to retrieve. - An that contains the annotations for this . - - - - Gets a collection of annotations of the specified type for this . - - The of the annotations to retrieve. - An of that contains the annotations that match the specified type for this . - - - - Removes the annotations of the specified type from this . - - The type of annotations to remove. - - - - Removes the annotations of the specified type from this . - - The of annotations to remove. - - - - Compares tokens to determine whether they are equal. - - - - - Determines whether the specified objects are equal. - - The first object of type to compare. - The second object of type to compare. - - true if the specified objects are equal; otherwise, false. - - - - - Returns a hash code for the specified object. - - The for which a hash code is to be returned. - A hash code for the specified object. - The type of is a reference type and is null. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized JSON data. - - - - - Gets the at the reader's current position. - - - - - Initializes a new instance of the class. - - The token to read from. - - - - Reads the next JSON token from the underlying . - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Gets the path of the current JSON token. - - - - - Specifies the type of token. - - - - - No token type has been set. - - - - - A JSON object. - - - - - A JSON array. - - - - - A JSON constructor. - - - - - A JSON object property. - - - - - A comment. - - - - - An integer value. - - - - - A float value. - - - - - A string value. - - - - - A boolean value. - - - - - A null value. - - - - - An undefined value. - - - - - A date value. - - - - - A raw JSON value. - - - - - A collection of bytes value. - - - - - A Guid value. - - - - - A Uri value. - - - - - A TimeSpan value. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating JSON data. - - - - - Gets the at the writer's current position. - - - - - Gets the token being written. - - The token being written. - - - - Initializes a new instance of the class writing to the given . - - The container being written to. - - - - Initializes a new instance of the class. - - - - - Flushes whatever is in the buffer to the underlying . - - - - - Closes this writer. - If is set to true, the JSON is auto-completed. - - - Setting to true has no additional effect, since the underlying is a type that cannot be closed. - - - - - Writes the beginning of a JSON object. - - - - - Writes the beginning of a JSON array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the end. - - The token. - - - - Writes the property name of a name/value pair on a JSON object. - - The name of the property. - - - - Writes a value. - An error will be raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a [] value. - - The [] value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Represents a value in JSON (string, integer, date, etc). - - - - - Writes this token to a asynchronously. - - A into which this method will write. - The token to monitor for cancellation requests. - A collection of which will be used when writing the token. - A that represents the asynchronous write operation. - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Gets a value indicating whether this token has child tokens. - - - true if this token has child values; otherwise, false. - - - - - Creates a comment with the given value. - - The value. - A comment with the given value. - - - - Creates a string with the given value. - - The value. - A string with the given value. - - - - Creates a null value. - - A null value. - - - - Creates a undefined value. - - A undefined value. - - - - Gets the node type for this . - - The type. - - - - Gets or sets the underlying token value. - - The underlying token value. - - - - Writes this token to a . - - A into which this method will write. - A collection of s which will be used when writing the token. - - - - Indicates whether the current object is equal to another object of the same type. - - - true if the current object is equal to the parameter; otherwise, false. - - An object to compare with this object. - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format provider. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - The format provider. - - A that represents this instance. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. - - An object to compare with this instance. - - A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: - Value - Meaning - Less than zero - This instance is less than . - Zero - This instance is equal to . - Greater than zero - This instance is greater than . - - - is not of the same type as this instance. - - - - - Specifies the settings used when loading JSON. - - - - - Initializes a new instance of the class. - - - - - Gets or sets how JSON comments are handled when loading JSON. - - The JSON comment handling. - - - - Gets or sets how JSON line info is handled when loading JSON. - - The JSON line info handling. - - - - Specifies how JSON arrays are merged together. - - - - Concatenate arrays. - - - Union arrays, skipping items that already exist. - - - Replace all array items. - - - Merge array items together, matched by index. - - - - Specifies how null value properties are merged. - - - - - The content's null value properties will be ignored during merging. - - - - - The content's null value properties will be merged. - - - - - Specifies the member serialization options for the . - - - - - All public members are serialized by default. Members can be excluded using or . - This is the default member serialization mode. - - - - - Only members marked with or are serialized. - This member serialization mode can also be set by marking the class with . - - - - - All public and private fields are serialized. Members can be excluded using or . - This member serialization mode can also be set by marking the class with - and setting IgnoreSerializableAttribute on to false. - - - - - Specifies metadata property handling options for the . - - - - - Read metadata properties located at the start of a JSON object. - - - - - Read metadata properties located anywhere in a JSON object. Note that this setting will impact performance. - - - - - Do not try to read metadata properties. - - - - - Specifies missing member handling options for the . - - - - - Ignore a missing member and do not attempt to deserialize it. - - - - - Throw a when a missing member is encountered during deserialization. - - - - - Specifies null value handling options for the . - - - - - - - - - Include null values when serializing and deserializing objects. - - - - - Ignore null values when serializing and deserializing objects. - - - - - Specifies how object creation is handled by the . - - - - - Reuse existing objects, create new objects when needed. - - - - - Only reuse existing objects. - - - - - Always create new objects. - - - - - Specifies reference handling options for the . - Note that references cannot be preserved when a value is set via a non-default constructor such as types that implement . - - - - - - - - Do not preserve references when serializing types. - - - - - Preserve references when serializing into a JSON object structure. - - - - - Preserve references when serializing into a JSON array structure. - - - - - Preserve references when serializing. - - - - - Specifies reference loop handling options for the . - - - - - Throw a when a loop is encountered. - - - - - Ignore loop references and do not serialize. - - - - - Serialize loop references. - - - - - Indicating whether a property is required. - - - - - The property is not required. The default state. - - - - - The property must be defined in JSON but can be a null value. - - - - - The property must be defined in JSON and cannot be a null value. - - - - - The property is not required but it cannot be a null value. - - - - - - Contains the JSON schema extension methods. - - - JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details. - - - - - - - Determines whether the is valid. - - - JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details. - - - The source to test. - The schema to test with. - - true if the specified is valid; otherwise, false. - - - - - - Determines whether the is valid. - - - JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details. - - - The source to test. - The schema to test with. - When this method returns, contains any error messages generated while validating. - - true if the specified is valid; otherwise, false. - - - - - - Validates the specified . - - - JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details. - - - The source to test. - The schema to test with. - - - - - Validates the specified . - - - JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details. - - - The source to test. - The schema to test with. - The validation event handler. - - - - - An in-memory representation of a JSON Schema. - - - JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details. - - - - - - Gets or sets the id. - - - - - Gets or sets the title. - - - - - Gets or sets whether the object is required. - - - - - Gets or sets whether the object is read-only. - - - - - Gets or sets whether the object is visible to users. - - - - - Gets or sets whether the object is transient. - - - - - Gets or sets the description of the object. - - - - - Gets or sets the types of values allowed by the object. - - The type. - - - - Gets or sets the pattern. - - The pattern. - - - - Gets or sets the minimum length. - - The minimum length. - - - - Gets or sets the maximum length. - - The maximum length. - - - - Gets or sets a number that the value should be divisible by. - - A number that the value should be divisible by. - - - - Gets or sets the minimum. - - The minimum. - - - - Gets or sets the maximum. - - The maximum. - - - - Gets or sets a flag indicating whether the value can not equal the number defined by the minimum attribute (). - - A flag indicating whether the value can not equal the number defined by the minimum attribute (). - - - - Gets or sets a flag indicating whether the value can not equal the number defined by the maximum attribute (). - - A flag indicating whether the value can not equal the number defined by the maximum attribute (). - - - - Gets or sets the minimum number of items. - - The minimum number of items. - - - - Gets or sets the maximum number of items. - - The maximum number of items. - - - - Gets or sets the of items. - - The of items. - - - - Gets or sets a value indicating whether items in an array are validated using the instance at their array position from . - - - true if items are validated using their array position; otherwise, false. - - - - - Gets or sets the of additional items. - - The of additional items. - - - - Gets or sets a value indicating whether additional items are allowed. - - - true if additional items are allowed; otherwise, false. - - - - - Gets or sets whether the array items must be unique. - - - - - Gets or sets the of properties. - - The of properties. - - - - Gets or sets the of additional properties. - - The of additional properties. - - - - Gets or sets the pattern properties. - - The pattern properties. - - - - Gets or sets a value indicating whether additional properties are allowed. - - - true if additional properties are allowed; otherwise, false. - - - - - Gets or sets the required property if this property is present. - - The required property if this property is present. - - - - Gets or sets the a collection of valid enum values allowed. - - A collection of valid enum values allowed. - - - - Gets or sets disallowed types. - - The disallowed types. - - - - Gets or sets the default value. - - The default value. - - - - Gets or sets the collection of that this schema extends. - - The collection of that this schema extends. - - - - Gets or sets the format. - - The format. - - - - Initializes a new instance of the class. - - - - - Reads a from the specified . - - The containing the JSON Schema to read. - The object representing the JSON Schema. - - - - Reads a from the specified . - - The containing the JSON Schema to read. - The to use when resolving schema references. - The object representing the JSON Schema. - - - - Load a from a string that contains JSON Schema. - - A that contains JSON Schema. - A populated from the string that contains JSON Schema. - - - - Load a from a string that contains JSON Schema using the specified . - - A that contains JSON Schema. - The resolver. - A populated from the string that contains JSON Schema. - - - - Writes this schema to a . - - A into which this method will write. - - - - Writes this schema to a using the specified . - - A into which this method will write. - The resolver used. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - - Returns detailed information about the schema exception. - - - JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details. - - - - - - Gets the line number indicating where the error occurred. - - The line number indicating where the error occurred. - - - - Gets the line position indicating where the error occurred. - - The line position indicating where the error occurred. - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - - Initializes a new instance of the class. - - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The parameter is null. - The class name is null or is zero (0). - - - - - Generates a from a specified . - - - JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details. - - - - - - Gets or sets how undefined schemas are handled by the serializer. - - - - - Gets or sets the contract resolver. - - The contract resolver. - - - - Generate a from the specified type. - - The type to generate a from. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - The used to resolve schema references. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - Specify whether the generated root will be nullable. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - The used to resolve schema references. - Specify whether the generated root will be nullable. - A generated from the specified type. - - - - - Resolves from an id. - - - JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details. - - - - - - Gets or sets the loaded schemas. - - The loaded schemas. - - - - Initializes a new instance of the class. - - - - - Gets a for the specified reference. - - The id. - A for the specified reference. - - - - - The value types allowed by the . - - - JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details. - - - - - - No type specified. - - - - - String type. - - - - - Float type. - - - - - Integer type. - - - - - Boolean type. - - - - - Object type. - - - - - Array type. - - - - - Null type. - - - - - Any type. - - - - - - Specifies undefined schema Id handling options for the . - - - JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details. - - - - - - Do not infer a schema Id. - - - - - Use the .NET type name as the schema Id. - - - - - Use the assembly qualified .NET type name as the schema Id. - - - - - - Returns detailed information related to the . - - - JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details. - - - - - - Gets the associated with the validation error. - - The JsonSchemaException associated with the validation error. - - - - Gets the path of the JSON location where the validation error occurred. - - The path of the JSON location where the validation error occurred. - - - - Gets the text description corresponding to the validation error. - - The text description. - - - - - Represents the callback method that will handle JSON schema validation events and the . - - - JSON Schema validation has been moved to its own package. See http://www.newtonsoft.com/jsonschema for more details. - - - - - - Allows users to control class loading and mandate what class to load. - - - - - When implemented, controls the binding of a serialized object to a type. - - Specifies the name of the serialized object. - Specifies the name of the serialized object - The type of the object the formatter creates a new instance of. - - - - When implemented, controls the binding of a serialized object to a type. - - The type of the object the formatter creates a new instance of. - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - - - A snake case naming strategy. - - - - - Initializes a new instance of the class. - - - A flag indicating whether dictionary keys should be processed. - - - A flag indicating whether explicitly specified property names should be processed, - e.g. a property name customized with a . - - - - - Initializes a new instance of the class. - - - A flag indicating whether dictionary keys should be processed. - - - A flag indicating whether explicitly specified property names should be processed, - e.g. a property name customized with a . - - - A flag indicating whether extension data names should be processed. - - - - - Initializes a new instance of the class. - - - - - Resolves the specified property name. - - The property name to resolve. - The resolved property name. - - - - A camel case naming strategy. - - - - - Initializes a new instance of the class. - - - A flag indicating whether dictionary keys should be processed. - - - A flag indicating whether explicitly specified property names should be processed, - e.g. a property name customized with a . - - - - - Initializes a new instance of the class. - - - A flag indicating whether dictionary keys should be processed. - - - A flag indicating whether explicitly specified property names should be processed, - e.g. a property name customized with a . - - - A flag indicating whether extension data names should be processed. - - - - - Initializes a new instance of the class. - - - - - Resolves the specified property name. - - The property name to resolve. - The resolved property name. - - - - Resolves member mappings for a type, camel casing property names. - - - - - Initializes a new instance of the class. - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - Used by to resolve a for a given . - - - - - Gets a value indicating whether members are being get and set using dynamic code generation. - This value is determined by the runtime permissions available. - - - true if using dynamic code generation; otherwise, false. - - - - - Gets or sets the default members search flags. - - The default members search flags. - - - - Gets or sets a value indicating whether compiler generated members should be serialized. - - - true if serialized compiler generated members; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore the interface when serializing and deserializing types. - - - true if the interface will be ignored when serializing and deserializing types; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore the attribute when serializing and deserializing types. - - - true if the attribute will be ignored when serializing and deserializing types; otherwise, false. - - - - - Gets or sets the naming strategy used to resolve how property names and dictionary keys are serialized. - - The naming strategy used to resolve how property names and dictionary keys are serialized. - - - - Initializes a new instance of the class. - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - Gets the serializable members for the type. - - The type to get serializable members for. - The serializable members for the type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates the constructor parameters. - - The constructor to create properties for. - The type's member properties. - Properties for the given . - - - - Creates a for the given . - - The matching member property. - The constructor parameter. - A created for the given . - - - - Resolves the default for the contract. - - Type of the object. - The contract's default . - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Determines which contract type is created for the given type. - - Type of the object. - A for the given type. - - - - Creates properties for the given . - - The type to create properties for. - /// The member serialization mode for the type. - Properties for the given . - - - - Creates the used by the serializer to get and set values from a member. - - The member. - The used by the serializer to get and set values from a member. - - - - Creates a for the given . - - The member's parent . - The member to create a for. - A created for the given . - - - - Resolves the name of the property. - - Name of the property. - Resolved name of the property. - - - - Resolves the name of the extension data. By default no changes are made to extension data names. - - Name of the extension data. - Resolved name of the extension data. - - - - Resolves the key of the dictionary. By default is used to resolve dictionary keys. - - Key of the dictionary. - Resolved key of the dictionary. - - - - Gets the resolved name of the property. - - Name of the property. - Name of the property. - - - - The default naming strategy. Property names and dictionary keys are unchanged. - - - - - Resolves the specified property name. - - The property name to resolve. - The resolved property name. - - - - The default serialization binder used when resolving and loading classes from type names. - - - - - Initializes a new instance of the class. - - - - - When overridden in a derived class, controls the binding of a serialized object to a type. - - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - The type of the object the formatter creates a new instance of. - - - - - When overridden in a derived class, controls the binding of a serialized object to a type. - - The type of the object the formatter creates a new instance of. - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - - - Represents a trace writer that writes to the application's instances. - - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of will exclude messages and include , - and messages. - - - The that will be used to filter the trace messages passed to the writer. - - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Get and set values for a using dynamic methods. - - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Provides information surrounding an error. - - - - - Gets the error. - - The error. - - - - Gets the original object that caused the error. - - The original object that caused the error. - - - - Gets the member that caused the error. - - The member that caused the error. - - - - Gets the path of the JSON location where the error occurred. - - The path of the JSON location where the error occurred. - - - - Gets or sets a value indicating whether this is handled. - - true if handled; otherwise, false. - - - - Provides data for the Error event. - - - - - Gets the current object the error event is being raised against. - - The current object the error event is being raised against. - - - - Gets the error context. - - The error context. - - - - Initializes a new instance of the class. - - The current object. - The error context. - - - - Get and set values for a using dynamic methods. - - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Provides methods to get attributes. - - - - - Returns a collection of all of the attributes, or an empty collection if there are no attributes. - - When true, look up the hierarchy chain for the inherited custom attribute. - A collection of s, or an empty collection. - - - - Returns a collection of attributes, identified by type, or an empty collection if there are no attributes. - - The type of the attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - A collection of s, or an empty collection. - - - - Used by to resolve a for a given . - - - - - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - A base class for resolving how property names and dictionary keys are serialized. - - - - - A flag indicating whether dictionary keys should be processed. - Defaults to false. - - - - - A flag indicating whether extension data names should be processed. - Defaults to false. - - - - - A flag indicating whether explicitly specified property names, - e.g. a property name customized with a , should be processed. - Defaults to false. - - - - - Gets the serialized name for a given property name. - - The initial property name. - A flag indicating whether the property has had a name explicitly specified. - The serialized property name. - - - - Gets the serialized name for a given extension data name. - - The initial extension data name. - The serialized extension data name. - - - - Gets the serialized key for a given dictionary key. - - The initial dictionary key. - The serialized dictionary key. - - - - Resolves the specified property name. - - The property name to resolve. - The resolved property name. - - - - Used to resolve references when serializing and deserializing JSON by the . - - - - - Resolves a reference to its object. - - The serialization context. - The reference to resolve. - The object that was resolved from the reference. - - - - Gets the reference for the specified object. - - The serialization context. - The object to get a reference for. - The reference to the object. - - - - Determines whether the specified object is referenced. - - The serialization context. - The object to test for a reference. - - true if the specified object is referenced; otherwise, false. - - - - - Adds a reference to the specified object. - - The serialization context. - The reference. - The object to reference. - - - - Represents a trace writer. - - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of will exclude messages and include , - and messages. - - The that will be used to filter the trace messages passed to the writer. - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Provides methods to get and set values. - - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Contract details for a used by the . - - - - - Gets the of the collection items. - - The of the collection items. - - - - Gets a value indicating whether the collection type is a multidimensional array. - - true if the collection type is a multidimensional array; otherwise, false. - - - - Gets or sets the function used to create the object. When set this function will override . - - The function used to create the object. - - - - Gets a value indicating whether the creator has a parameter with the collection values. - - true if the creator has a parameter with the collection values; otherwise, false. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Gets or sets the default collection items . - - The converter. - - - - Gets or sets a value indicating whether the collection items preserve object references. - - true if collection items preserve object references; otherwise, false. - - - - Gets or sets the collection item reference loop handling. - - The reference loop handling. - - - - Gets or sets the collection item type name handling. - - The type name handling. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Handles serialization callback events. - - The object that raised the callback event. - The streaming context. - - - - Handles serialization error callback events. - - The object that raised the callback event. - The streaming context. - The error context. - - - - Sets extension data for an object during deserialization. - - The object to set extension data on. - The extension data key. - The extension data value. - - - - Gets extension data for an object during serialization. - - The object to set extension data on. - - - - Contract details for a used by the . - - - - - Gets the underlying type for the contract. - - The underlying type for the contract. - - - - Gets or sets the type created during deserialization. - - The type created during deserialization. - - - - Gets or sets whether this type contract is serialized as a reference. - - Whether this type contract is serialized as a reference. - - - - Gets or sets the default for this contract. - - The converter. - - - - Gets or sets all methods called immediately after deserialization of the object. - - The methods called immediately after deserialization of the object. - - - - Gets or sets all methods called during deserialization of the object. - - The methods called during deserialization of the object. - - - - Gets or sets all methods called after serialization of the object graph. - - The methods called after serialization of the object graph. - - - - Gets or sets all methods called before serialization of the object. - - The methods called before serialization of the object. - - - - Gets or sets all method called when an error is thrown during the serialization of the object. - - The methods called when an error is thrown during the serialization of the object. - - - - Gets or sets the default creator method used to create the object. - - The default creator method used to create the object. - - - - Gets or sets a value indicating whether the default creator is non-public. - - true if the default object creator is non-public; otherwise, false. - - - - Contract details for a used by the . - - - - - Gets or sets the dictionary key resolver. - - The dictionary key resolver. - - - - Gets the of the dictionary keys. - - The of the dictionary keys. - - - - Gets the of the dictionary values. - - The of the dictionary values. - - - - Gets or sets the function used to create the object. When set this function will override . - - The function used to create the object. - - - - Gets a value indicating whether the creator has a parameter with the dictionary values. - - true if the creator has a parameter with the dictionary values; otherwise, false. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Gets the object's properties. - - The object's properties. - - - - Gets or sets the property name resolver. - - The property name resolver. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Gets or sets the object constructor. - - The object constructor. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Gets or sets the object member serialization. - - The member object serialization. - - - - Gets or sets a value that indicates whether the object's properties are required. - - - A value indicating whether the object's properties are required. - - - - - Gets the object's properties. - - The object's properties. - - - - Gets a collection of instances that define the parameters used with . - - - - - Gets or sets the function used to create the object. When set this function will override . - This function is called with a collection of arguments which are defined by the collection. - - The function used to create the object. - - - - Gets or sets the extension data setter. - - - - - Gets or sets the extension data getter. - - - - - Gets or sets the extension data value type. - - - - - Gets or sets the extension data name resolver. - - The extension data name resolver. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Maps a JSON property to a .NET member or constructor parameter. - - - - - Gets or sets the name of the property. - - The name of the property. - - - - Gets or sets the type that declared this property. - - The type that declared this property. - - - - Gets or sets the order of serialization of a member. - - The numeric order of serialization. - - - - Gets or sets the name of the underlying member or parameter. - - The name of the underlying member or parameter. - - - - Gets the that will get and set the during serialization. - - The that will get and set the during serialization. - - - - Gets or sets the for this property. - - The for this property. - - - - Gets or sets the type of the property. - - The type of the property. - - - - Gets or sets the for the property. - If set this converter takes precedence over the contract converter for the property type. - - The converter. - - - - Gets or sets the member converter. - - The member converter. - - - - Gets or sets a value indicating whether this is ignored. - - true if ignored; otherwise, false. - - - - Gets or sets a value indicating whether this is readable. - - true if readable; otherwise, false. - - - - Gets or sets a value indicating whether this is writable. - - true if writable; otherwise, false. - - - - Gets or sets a value indicating whether this has a member attribute. - - true if has a member attribute; otherwise, false. - - - - Gets the default value. - - The default value. - - - - Gets or sets a value indicating whether this is required. - - A value indicating whether this is required. - - - - Gets or sets a value indicating whether this property preserves object references. - - - true if this instance is reference; otherwise, false. - - - - - Gets or sets the property null value handling. - - The null value handling. - - - - Gets or sets the property default value handling. - - The default value handling. - - - - Gets or sets the property reference loop handling. - - The reference loop handling. - - - - Gets or sets the property object creation handling. - - The object creation handling. - - - - Gets or sets or sets the type name handling. - - The type name handling. - - - - Gets or sets a predicate used to determine whether the property should be serialized. - - A predicate used to determine whether the property should be serialized. - - - - Gets or sets a predicate used to determine whether the property should be deserialized. - - A predicate used to determine whether the property should be deserialized. - - - - Gets or sets a predicate used to determine whether the property should be serialized. - - A predicate used to determine whether the property should be serialized. - - - - Gets or sets an action used to set whether the property has been deserialized. - - An action used to set whether the property has been deserialized. - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets or sets the converter used when serializing the property's collection items. - - The collection's items converter. - - - - Gets or sets whether this property's collection items are serialized as a reference. - - Whether this property's collection items are serialized as a reference. - - - - Gets or sets the type name handling used when serializing the property's collection items. - - The collection's items type name handling. - - - - Gets or sets the reference loop handling used when serializing the property's collection items. - - The collection's items reference loop handling. - - - - A collection of objects. - - - - - Initializes a new instance of the class. - - The type. - - - - When implemented in a derived class, extracts the key from the specified element. - - The element from which to extract the key. - The key for the specified element. - - - - Adds a object. - - The property to add to the collection. - - - - Gets the closest matching object. - First attempts to get an exact case match of and then - a case insensitive match. - - Name of the property. - A matching property if found. - - - - Gets a property by property name. - - The name of the property to get. - Type property name string comparison. - A matching property if found. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Lookup and create an instance of the type described by the argument. - - The type to create. - Optional arguments to pass to an initializing constructor of the JsonConverter. - If null, the default constructor is used. - - - - Represents a trace writer that writes to memory. When the trace message limit is - reached then old trace messages will be removed as new messages are added. - - - - - Gets the that will be used to filter the trace messages passed to the writer. - For example a filter level of will exclude messages and include , - and messages. - - - The that will be used to filter the trace messages passed to the writer. - - - - - Initializes a new instance of the class. - - - - - Writes the specified trace level, message and optional exception. - - The at which to write this trace. - The trace message. - The trace exception. This parameter is optional. - - - - Returns an enumeration of the most recent trace messages. - - An enumeration of the most recent trace messages. - - - - Returns a of the most recent trace messages. - - - A of the most recent trace messages. - - - - - Represents a method that constructs an object. - - The object type to create. - - - - When applied to a method, specifies that the method is called when an error occurs serializing an object. - - - - - Provides methods to get attributes from a , , or . - - - - - Initializes a new instance of the class. - - The instance to get attributes for. This parameter should be a , , or . - - - - Returns a collection of all of the attributes, or an empty collection if there are no attributes. - - When true, look up the hierarchy chain for the inherited custom attribute. - A collection of s, or an empty collection. - - - - Returns a collection of attributes, identified by type, or an empty collection if there are no attributes. - - The type of the attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - A collection of s, or an empty collection. - - - - Get and set values for a using reflection. - - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Indicates the method that will be used during deserialization for locating and loading assemblies. - - - - - In simple mode, the assembly used during deserialization need not match exactly the assembly used during serialization. Specifically, the version numbers need not match as the LoadWithPartialName method of the class is used to load the assembly. - - - - - In full mode, the assembly used during deserialization must match exactly the assembly used during serialization. The Load method of the class is used to load the assembly. - - - - - Specifies how strings are escaped when writing JSON text. - - - - - Only control characters (e.g. newline) are escaped. - - - - - All non-ASCII and control characters (e.g. newline) are escaped. - - - - - HTML (<, >, &, ', ") and control characters (e.g. newline) are escaped. - - - - - Specifies type name handling options for the . - - - should be used with caution when your application deserializes JSON from an external source. - Incoming types should be validated with a custom - when deserializing with a value other than . - - - - - Do not include the .NET type name when serializing types. - - - - - Include the .NET type name when serializing into a JSON object structure. - - - - - Include the .NET type name when serializing into a JSON array structure. - - - - - Always include the .NET type name when serializing. - - - - - Include the .NET type name when the type of the object being serialized is not the same as its declared type. - Note that this doesn't include the root serialized object by default. To include the root object's type name in JSON - you must specify a root type object with - or . - - - - - Determines whether the collection is null or empty. - - The collection. - - true if the collection is null or empty; otherwise, false. - - - - - Adds the elements of the specified collection to the specified generic . - - The list to add to. - The collection of elements to add. - - - - Converts the value to the specified type. If the value is unable to be converted, the - value is checked whether it assignable to the specified type. - - The value to convert. - The culture to use when converting. - The type to convert or cast the value to. - - The converted type. If conversion was unsuccessful, the initial value - is returned if assignable to the target type. - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic that returns a result - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic, but uses one of the arguments for - the result. - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic, but uses one of the arguments for - the result. - - - - - Returns a Restrictions object which includes our current restrictions merged - with a restriction limiting our type - - - - - Gets a dictionary of the names and values of an type. - - - - - - Gets a dictionary of the names and values of an Enum type. - - The enum type to get names and values for. - - - - - Gets the type of the typed collection's items. - - The type. - The type of the typed collection's items. - - - - Gets the member's underlying type. - - The member. - The underlying type of the member. - - - - Determines whether the member is an indexed property. - - The member. - - true if the member is an indexed property; otherwise, false. - - - - - Determines whether the property is an indexed property. - - The property. - - true if the property is an indexed property; otherwise, false. - - - - - Gets the member's value on the object. - - The member. - The target object. - The member's value on the object. - - - - Sets the member's value on the target object. - - The member. - The target. - The value. - - - - Determines whether the specified MemberInfo can be read. - - The MemberInfo to determine whether can be read. - /// if set to true then allow the member to be gotten non-publicly. - - true if the specified MemberInfo can be read; otherwise, false. - - - - - Determines whether the specified MemberInfo can be set. - - The MemberInfo to determine whether can be set. - if set to true then allow the member to be set non-publicly. - if set to true then allow the member to be set if read-only. - - true if the specified MemberInfo can be set; otherwise, false. - - - - - Builds a string. Unlike this class lets you reuse its internal buffer. - - - - - Determines whether the string is all white space. Empty string will return false. - - The string to test whether it is all white space. - - true if the string is all white space; otherwise, false. - - - - - Specifies the state of the . - - - - - An exception has been thrown, which has left the in an invalid state. - You may call the method to put the in the Closed state. - Any other method calls result in an being thrown. - - - - - The method has been called. - - - - - An object is being written. - - - - - An array is being written. - - - - - A constructor is being written. - - - - - A property is being written. - - - - - A write method has not been called. - - - - diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/System.Net.Http.Formatting.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/System.Net.Http.Formatting.dll deleted file mode 100644 index 3b76acd6be..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/System.Net.Http.Formatting.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/System.Net.Http.Formatting.xml b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/System.Net.Http.Formatting.xml deleted file mode 100644 index 3fb65976cf..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/System.Net.Http.Formatting.xml +++ /dev/null @@ -1,2094 +0,0 @@ - - - - System.Net.Http.Formatting - - - - - implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. The supports one or more byte ranges regardless of whether the ranges are consecutive or not. If there is only one range then a single partial response body containing a Content-Range header is generated. If there are more than one ranges then a multipart/byteranges response is generated where each body part contains a range indicated by the associated Content-Range header field. - - - - implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend of the selected resource represented by the content parameter then an is thrown indicating the valid Content-Range of the content. - The stream over which to generate a byte range view. - The range or ranges, typically obtained from the Range HTTP request header field. - The media type of the content stream. - - - - implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend of the selected resource represented by the content parameter then an is thrown indicating the valid Content-Range of the content. - The stream over which to generate a byte range view. - The range or ranges, typically obtained from the Range HTTP request header field. - The media type of the content stream. - The buffer size used when copying the content stream. - - - - implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend of the selected resource represented by the content parameter then an is thrown indicating the valid Content-Range of the content. - The stream over which to generate a byte range view. - The range or ranges, typically obtained from the Range HTTP request header field. - The media type of the content stream. - - - - implementation which provides a byte range view over a stream used to generate HTTP 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend of the selected resource represented by the content parameter then an is thrown indicating the valid Content-Range of the content. - The stream over which to generate a byte range view. - The range or ranges, typically obtained from the Range HTTP request header field. - The media type of the content stream. - The buffer size used when copying the content stream. - - - Releases the resources used by the current instance of the class. - true to release managed and unmanaged resources; false to release only unmanaged resources. - - - Asynchronously serialize and write the byte range to an HTTP content stream. - The task object representing the asynchronous operation. - The target stream. - Information about the transport. - - - Determines whether a byte array has a valid length in bytes. - true if length is a valid length; otherwise, false. - The length in bytes of the byte array. - - - Extension methods that aid in making formatted requests using . - - - - - - - - - Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as JSON. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as JSON. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - - - - - - - Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as XML. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with the given value serialized as XML. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - - - - - - - - - - - - - - - - Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - Sends a POST request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - - - - - - - Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as JSON. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as JSON. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - - - - - - - Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as XML. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with the given value serialized as XML. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - - - - - - - - - - - - - - - - Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - The authoritative value of the request's content's Content-Type header. Can be null in which case the <paramref name="formatter">formatter's</paramref> default content type will be used. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - Sends a PUT request as an asynchronous operation to the specified Uri with value serialized using the given formatter. - A task object representing the asynchronous operation. - The client used to make the request. - The Uri the request is sent to. - The value that will be placed in the request's entity body. - The formatter used to serialize the value. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The type of value. - - - Represents the factory for creating new instance of . - - - Creates a new instance of the . - A new instance of the . - The list of HTTP handler that delegates the processing of HTTP response messages to another handler. - - - Creates a new instance of the . - A new instance of the . - The inner handler which is responsible for processing the HTTP response messages. - The list of HTTP handler that delegates the processing of HTTP response messages to another handler. - - - Creates a new instance of the which should be pipelined. - A new instance of the which should be pipelined. - The inner handler which is responsible for processing the HTTP response messages. - The list of HTTP handler that delegates the processing of HTTP response messages to another handler. - - - Specifies extension methods to allow strongly typed objects to be read from HttpContent instances. - - - Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The collection of MediaTyepFormatter instances to use. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The collection of MediaTypeFormatter instances to use. - The IFormatterLogger to log events to. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The collection of MediaTypeFormatter instances to use. - The IFormatterLogger to log events to. - The token to cancel the operation. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The collection of MediaTypeFormatter instances to use. - The token to cancel the operation. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type from the content instance. - An object instance of the specified type. - The HttpContent instance from which to read. - The token to cancel the operation. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type from the content instance. - A Task that will yield an object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - - - Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - The collection of MediaTypeFormatter instances to use. - - - Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - The collection of MediaTypeFormatter instances to use. - The IFormatterLogger to log events to. - - - Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - The collection of MediaTypeFormatter instances to use. - The IFormatterLogger to log events to. - The token to cancel the operation. - - - Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - The collection of MediaTypeFormatter instances to use. - The token to cancel the operation. - - - Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content. - An object instance of the specified type. - The HttpContent instance from which to read. - The type of the object to read. - The token to cancel the operation. - - - Extension methods to read HTML form URL-encoded datafrom instances. - - - Determines whether the specified content is HTML form URL-encoded data. - true if the specified content is HTML form URL-encoded data; otherwise, false. - The content. - - - Asynchronously reads HTML form URL-encoded from an instance and stores the results in a object. - A task object representing the asynchronous operation. - The content. - - - Asynchronously reads HTML form URL-encoded from an instance and stores the results in a object. - A task object representing the asynchronous operation. - The content. - The token to cancel the operation. - - - Provides extension methods to read and entities from instances. - - - Determines whether the specified content is HTTP request message content. - true if the specified content is HTTP message content; otherwise, false. - The content to check. - - - Determines whether the specified content is HTTP response message content. - true if the specified content is HTTP message content; otherwise, false. - The content to check. - - - Reads the as an . - The parsed instance. - The content to read. - - - Reads the as an . - The parsed instance. - The content to read. - The URI scheme to use for the request URI. - - - Reads the as an . - The parsed instance. - The content to read. - The URI scheme to use for the request URI. - The size of the buffer. - - - Reads the as an . - The parsed instance. - The content to read. - The URI scheme to use for the request URI. - The size of the buffer. - The maximum length of the HTTP header. - - - - - - - Reads the as an . - The parsed instance. - The content to read. - - - Reads the as an . - The parsed instance. - The content to read. - The size of the buffer. - - - Reads the as an . - The parsed instance. - The content to read. - The size of the buffer. - The maximum length of the HTTP header. - - - - - - Extension methods to read MIME multipart entities from instances. - - - Determines whether the specified content is MIME multipart content. - true if the specified content is MIME multipart content; otherwise, false. - The content. - - - Determines whether the specified content is MIME multipart content with the specified subtype. - true if the specified content is MIME multipart content with the specified subtype; otherwise, false. - The content. - The MIME multipart subtype to match. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - The token to cancel the operation. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - A stream provider providing output streams for where to write body parts as they are parsed. - The type of the MIME multipart. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written and bufferSize as read buffer size. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - A stream provider providing output streams for where to write body parts as they are parsed. - Size of the buffer used to read the contents. - The type of the MIME multipart. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written and bufferSize as read buffer size. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - A stream provider providing output streams for where to write body parts as they are parsed. - Size of the buffer used to read the contents. - The token to cancel the operation. - The type of the MIME multipart. - - - Reads all body parts within a MIME multipart message and produces a set of instances as a result using the streamProvider instance to determine where the contents of each body part is written. - A representing the tasks of getting the collection of instances where each instance represents a body part. - An existing instance to use for the object's content. - A stream provider providing output streams for where to write body parts as they are parsed. - The token to cancel the operation. - The type of the MIME multipart. - - - Derived class which can encapsulate an or an as an entity with media type "application/http". - - - Initializes a new instance of the class encapsulating an . - The instance to encapsulate. - - - Initializes a new instance of the class encapsulating an . - The instance to encapsulate. - - - Releases unmanaged and - optionally - managed resources - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets the HTTP request message. - - - Gets the HTTP response message. - - - Asynchronously serializes the object's content to the given stream. - A instance that is asynchronously serializing the object's content. - The to which to write. - The associated . - - - Computes the length of the stream if possible. - true if the length has been computed; otherwise false. - The computed length of the stream. - - - Provides extension methods for the class. - - - Gets any cookie headers present in the request. - A collection of instances. - The request headers. - - - Gets any cookie headers present in the request that contain a cookie state whose name that matches the specified value. - A collection of instances. - The request headers. - The cookie state name to match. - - - - - Provides extension methods for the class. - - - Adds cookies to a response. Each Set-Cookie header is represented as one instance. A contains information about the domain, path, and other cookie information as well as one or more instances. Each instance contains a cookie name and whatever cookie state is associate with that name. The state is in the form of a which on the wire is encoded as HTML Form URL-encoded data. This representation allows for multiple related "cookies" to be carried within the same Cookie header while still providing separation between each cookie state. A sample Cookie header is shown below. In this example, there are two with names state1 and state2 respectively. Further, each cookie state contains two name/value pairs (name1/value1 and name2/value2) and (name3/value3 and name4/value4). <code> Set-Cookie: state1:name1=value1&amp;name2=value2; state2:name3=value3&amp;name4=value4; domain=domain1; path=path1; </code> - The response headers - The cookie values to add to the response. - - - An exception thrown by in case none of the requested ranges overlap with the current extend of the selected resource. The current extend of the resource is indicated in the ContentRange property. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - - - The current extend of the resource indicated in terms of a ContentRange header field. - - - Represents a multipart file data. - - - Initializes a new instance of the class. - The headers of the multipart file data. - The name of the local file for the multipart file data. - - - Gets or sets the headers of the multipart file data. - The headers of the multipart file data. - - - Gets or sets the name of the local file for the multipart file data. - The name of the local file for the multipart file data. - - - Represents an suited for writing each MIME body parts of the MIME multipart message to a file using a . - - - Initializes a new instance of the class. - The root path where the content of MIME multipart body parts are written to. - - - Initializes a new instance of the class. - The root path where the content of MIME multipart body parts are written to. - The number of bytes buffered for writes to the file. - - - Gets or sets the number of bytes buffered for writes to the file. - The number of bytes buffered for writes to the file. - - - Gets or sets the multipart file data. - The multipart file data. - - - Gets the name of the local file which will be combined with the root path to create an absolute file name where the contents of the current MIME body part will be stored. - A relative filename with no path component. - The headers for the current MIME body part. - - - Gets the stream instance where the message body part is written to. - The instance where the message body part is written to. - The content of HTTP. - The header fields describing the body part. - - - Gets or sets the root path where the content of MIME multipart body parts are written to. - The root path where the content of MIME multipart body parts are written to. - - - A implementation suited for use with HTML file uploads for writing file content to a remote storage . The stream provider looks at the Content-Disposition header field and determines an output remote based on the presence of a filename parameter. If a filename parameter is present in the Content-Disposition header field, then the body part is written to a remote provided by . Otherwise it is written to a . - - - Initializes a new instance of the class. - - - Read the non-file contents as form data. - A representing the post processing. - - - Read the non-file contents as form data. - A representing the post processing. - The token to monitor for cancellation requests. - - - Gets a collection of file data passed as part of the multipart form data. - - - Gets a of form data passed as part of the multipart form data. - - - Provides a for . Override this method to provide a remote stream to which the data should be written. - A result specifying a remote stream where the file will be written to and a location where the file can be accessed. It cannot be null and the stream must be writable. - The parent MIME multipart instance. - The header fields describing the body part's content. - - - - Represents an suited for use with HTML file uploads for writing file content to a . - - - Initializes a new instance of the class. - The root path where the content of MIME multipart body parts are written to. - - - Initializes a new instance of the class. - The root path where the content of MIME multipart body parts are written to. - The number of bytes buffered for writes to the file. - - - Reads the non-file contents as form data. - A task that represents the asynchronous operation. - - - - Gets a of form data passed as part of the multipart form data. - The of form data. - - - Gets the streaming instance where the message body part is written. - The instance where the message body part is written. - The HTTP content that contains this body part. - Header fields describing the body part. - - - Represents a multipart memory stream provider. - - - Initializes a new instance of the class. - - - Returns the for the . - The for the . - A object. - The HTTP content headers. - - - Represents the provider for the multipart related multistream. - - - Initializes a new instance of the class. - - - Gets the related stream for the provider. - The content headers. - The parent content. - The http content headers. - - - Gets the root content of the . - The root content of the . - - - Represents a multipart file data for remote storage. - - - Initializes a new instance of the class. - The headers of the multipart file data. - The remote file's location. - The remote file's name. - - - Gets the remote file's name. - - - Gets the headers of the multipart file data. - - - Gets the remote file's location. - - - Represents a stream provider that examines the headers provided by the MIME multipart parser as part of the MIME multipart extension methods (see ) and decides what kind of stream to return for the body part to be written to. - - - Initializes a new instance of the class. - - - Gets or sets the contents for this . - The contents for this . - - - Executes the post processing operation for this . - The asynchronous task for this operation. - - - Executes the post processing operation for this . - The asynchronous task for this operation. - The token to cancel the operation. - - - Gets the stream where to write the body part to. This method is called when a MIME multipart body part has been parsed. - The instance where the message body part is written to. - The content of the HTTP. - The header fields describing the body part. - - - Contains a value as well as an associated that will be used to serialize the value when writing this content. - - - Initializes a new instance of the class. - The type of object this instance will contain. - The value of the object this instance will contain. - The formatter to use when serializing the value. - - - Initializes a new instance of the class. - The type of object this instance will contain. - The value of the object this instance will contain. - The formatter to use when serializing the value. - The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used. - - - Initializes a new instance of the class. - The type of object this instance will contain. - The value of the object this instance will contain. - The formatter to use when serializing the value. - The authoritative value of the Content-Type header. - - - Gets the media-type formatter associated with this content instance. - The media type formatter associated with this content instance. - - - Gets the type of object managed by this instance. - The object type. - - - Asynchronously serializes the object's content to the given stream. - The task object representing the asynchronous operation. - The stream to write to. - The associated . - - - Computes the length of the stream if possible. - true if the length has been computed; otherwise, false. - Receives the computed length of the stream. - - - Gets or sets the value of the content. - The content value. - - - Generic form of . - The type of object this class will contain. - - - Initializes a new instance of the class. - The value of the object this instance will contain. - The formatter to use when serializing the value. - - - Initializes a new instance of the <see cref="T:System.Net.Http.ObjectContent`1" /> class. - The value of the object this instance will contain. - The formatter to use when serializing the value. - The authoritative value of the Content-Type header. Can be null, in which case the default content type of the formatter will be used. - - - Initializes a new instance of the class. - The value of the object this instance will contain. - The formatter to use when serializing the value. - The authoritative value of the Content-Type header. - - - Enables scenarios where a data producer wants to write directly (either synchronously or asynchronously) using a stream. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - The media type. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - The media type. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - The media type. - - - Initializes a new instance of the class. - An action that is called when an output stream is available, allowing the action to write to it directly. - The media type. - - - Asynchronously serializes the push content into stream. - The serialized push content. - The stream where the push content will be serialized. - The context. - - - Determines whether the stream content has a valid length in bytes. - true if length is a valid length; otherwise, false. - The length in bytes of the stream content. - - - Represents the result for . - - - Initializes a new instance of the class. - The remote stream instance where the file will be written to. - The remote file's location. - The remote file's name. - - - Gets the remote file's location. - - - Gets the remote file's location. - - - Gets the remote stream instance where the file will be written to. - - - Defines an exception type for signalling that a request's media type was not supported. - - - Initializes a new instance of the class. - The message that describes the error. - The unsupported media type. - - - Gets or sets the media type. - The media type. - - - Contains extension methods to allow strongly typed objects to be read from the query component of instances. - - - Parses the query portion of the specified URI. - A that contains the query parameters. - The URI to parse. - - - Reads HTML form URL encoded data provided in the URI query string as an object of a specified type. - true if the query component of the URI can be read as the specified type; otherwise, false. - The URI to read. - The type of object to read. - When this method returns, contains an object that is initialized from the query component of the URI. This parameter is treated as uninitialized. - - - Reads HTML form URL encoded data provided in the URI query string as an object of a specified type. - true if the query component of the URI can be read as the specified type; otherwise, false. - The URI to read. - When this method returns, contains an object that is initialized from the query component of the URI. This parameter is treated as uninitialized. - The type of object to read. - - - Reads HTML form URL encoded data provided in the query component as a object. - true if the query component can be read as ; otherwise false. - The instance from which to read. - An object to be initialized with this instance or null if the conversion cannot be performed. - - - Abstract media type formatter class to support Bson and Json. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Determines whether this formatter can read objects of the specified type. - true if objects of this type can be read, otherwise false. - The type of object that will be read. - - - Determines whether this formatter can write objects of the specified type. - true if objects of this type can be written, otherwise false. - The type of object to write. - - - Creates a instance with the default settings used by the . - Returns . - - - Called during deserialization to get the . - The reader to use during deserialization. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - - - Called during serialization and deserialization to get the . - The JsonSerializer used during serialization and deserialization. - - - Called during serialization to get the . - The writer to use during serialization. - The type of the object to write. - The stream to write to. - The encoding to use when writing. - - - Gets or sets the maximum depth allowed by this formatter. - The maximum depth allowed by this formatter. - - - Called during deserialization to read an object of the specified type from the specified stream. - The object that has been read. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - The logger to log events to. - - - Called during deserialization to read an object of the specified type from the specified stream. - A task whose result will be the object instance that has been read. - The type of the object to read. - The stream from which to read. - The for the content being read. - The logger to log events to. - - - Gets or sets the JsonSerializerSettings used to configure the JsonSerializer. - The JsonSerializerSettings used to configure the JsonSerializer. - - - Called during serialization to write an object of the specified type to the specified stream. - The type of the object to write. - The object to write. - The stream to write to. - The encoding to use when writing. - - - Called during serialization to write an object of the specified type to the specified stream. - Returns . - The type of the object to write. - The object to write. - The stream to write to. - The for the content being written. - The transport context. - The token to monitor for cancellation. - - - Represents a media type formatter to handle Bson. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The formatter to copy settings from. - - - Called during deserialization to get the . - The reader to use during deserialization. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - - - Called during serialization to get the . - The writer to use during serialization. - The type of the object to write. - The stream to write to. - The encoding to use when writing. - - - Gets the default media type for Json, namely "application/bson". - The default media type for Json, namely "application/bson". - - - Gets or sets the maximum depth allowed by this formatter. - The maximum depth allowed by this formatter. - - - Called during deserialization to read an object of the specified type from the specified stream. - The object that has been read. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - The logger to log events to. - - - Called during deserialization to read an object of the specified type from the specified stream. - A task whose result will be the object instance that has been read. - The type of the object to read. - The stream from which to read. - The for the content being read. - The logger to log events to. - - - Called during serialization to write an object of the specified type to the specified stream. - The type of the object to write. - The object to write. - The stream to write to. - The encoding to use when writing. - - - Represents a helper class to allow a synchronous formatter on top of the asynchronous formatter infrastructure. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Gets or sets the suggested size of buffer to use with streams in bytes. - The suggested size of buffer to use with streams in bytes. - - - Reads synchronously from the buffered stream. - An object of the given . - The type of the object to deserialize. - The stream from which to read. - The , if available. Can be null. - The to log events to. - - - Reads synchronously from the buffered stream. - An object of the given . - The type of the object to deserialize. - The stream from which to read. - The , if available. Can be null. - The to log events to. - The token to cancel the operation. - - - Reads asynchronously from the buffered stream. - A task object representing the asynchronous operation. - The type of the object to deserialize. - The stream from which to read. - The , if available. Can be null. - The to log events to. - - - Reads asynchronously from the buffered stream. - A task object representing the asynchronous operation. - The type of the object to deserialize. - The stream from which to read. - The , if available. Can be null. - The to log events to. - The token to cancel the operation. - - - Writes synchronously to the buffered stream. - The type of the object to serialize. - The object value to write. Can be null. - The stream to which to write. - The , if available. Can be null. - - - Writes synchronously to the buffered stream. - The type of the object to serialize. - The object value to write. Can be null. - The stream to which to write. - The , if available. Can be null. - The token to cancel the operation. - - - Writes asynchronously to the buffered stream. - A task object representing the asynchronous operation. - The type of the object to serialize. - The object value to write. It may be null. - The stream to which to write. - The , if available. Can be null. - The transport context. - - - Writes asynchronously to the buffered stream. - A task object representing the asynchronous operation. - The type of the object to serialize. - The object value to write. It may be null. - The stream to which to write. - The , if available. Can be null. - The transport context. - The token to cancel the operation. - - - Represents the result of content negotiation performed using <see cref="M:System.Net.Http.Formatting.IContentNegotiator.Negotiate(System.Type,System.Net.Http.HttpRequestMessage,System.Collections.Generic.IEnumerable{System.Net.Http.Formatting.MediaTypeFormatter})" /> - - - Create the content negotiation result object. - The formatter. - The preferred media type. Can be null. - - - The formatter chosen for serialization. - - - The media type that is associated with the formatter chosen for serialization. Can be null. - - - The default implementation of , which is used to select a for an or . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - true to exclude formatters that match only on the object type; otherwise, false. - - - Determines how well each formatter matches an HTTP request. - Returns a collection of objects that represent all of the matches. - The type to be serialized. - The request. - The set of objects from which to choose. - - - If true, exclude formatters that match only on the object type; otherwise, false. - Returns a . - - - Matches a set of Accept header fields against the media types that a formatter supports. - Returns a object that indicates the quality of the match, or null if there is no match. - A list of Accept header values, sorted in descending order of q factor. You can create this list by calling the method. - The formatter to match against. - - - Matches a request against the objects in a media-type formatter. - Returns a object that indicates the quality of the match, or null if there is no match. - The request to match. - The media-type formatter. - - - Match the content type of a request against the media types that a formatter supports. - Returns a object that indicates the quality of the match, or null if there is no match. - The request to match. - The formatter to match against. - - - Selects the first supported media type of a formatter. - Returns a with set to MatchOnCanWriteType, or null if there is no match. A indicating the quality of the match or null is no match. - The type to match. - The formatter to match against. - - - Performs content negotiating by selecting the most appropriate out of the passed in for the given that can serialize an object of the given . - The result of the negotiation containing the most appropriate instance, or null if there is no appropriate formatter. - The type to be serialized. - The request. - The set of objects from which to choose. - - - Determines the best character encoding for writing the response. - Returns the that is the best match. - The request. - The selected media formatter. - - - Select the best match among the candidate matches found. - Returns the object that represents the best match. - The collection of matches. - - - Determine whether to match on type or not. This is used to determine whether to generate a 406 response or use the default media type formatter in case there is no match against anything in the request. If ExcludeMatchOnTypeOnly is true then we don't match on type unless there are no accept headers. - True if not ExcludeMatchOnTypeOnly and accept headers with a q-factor bigger than 0.0 are present. - The sorted accept header values to match. - - - Sorts Accept header values in descending order of q factor. - Returns the sorted list of MediaTypeWithQualityHeaderValue objects. - A collection of StringWithQualityHeaderValue objects, representing the header fields. - - - Sorts a list of Accept-Charset, Accept-Encoding, Accept-Language or related header values in descending order or q factor. - Returns the sorted list of StringWithQualityHeaderValue objects. - A collection of StringWithQualityHeaderValue objects, representing the header fields. - - - Evaluates whether a match is better than the current match. - Returns whichever object is a better match. - The current match. - The match to evaluate against the current match. - - - Helper class to serialize <see cref="T:System.Collections.Generic.IEnumerable`1" /> types by delegating them through a concrete implementation."/&gt;. - The interface implementing to proxy. - - - Initialize a DelegatingEnumerable. This constructor is necessary for to work. - - - Initialize a DelegatingEnumerable with an <see cref="T:System.Collections.Generic.IEnumerable`1" />. This is a helper class to proxy <see cref="T:System.Collections.Generic.IEnumerable`1" /> interfaces for . - The <see cref="T:System.Collections.Generic.IEnumerable`1" /> instance to get the enumerator from. - - - This method is not implemented but is required method for serialization to work. Do not use. - The item to add. Unused. - - - Get the enumerator of the associated <see cref="T:System.Collections.Generic.IEnumerable`1" />. - The enumerator of the <see cref="T:System.Collections.Generic.IEnumerable`1" /> source. - - - Get the enumerator of the associated <see cref="T:System.Collections.Generic.IEnumerable`1" />. - The enumerator of the <see cref="T:System.Collections.Generic.IEnumerable`1" /> source. - - - Represent the collection of form data. - - - Initializes a new instance of class. - The pairs. - - - Initializes a new instance of class. - The query. - - - Initializes a new instance of class. - The URI - - - Gets the collection of form data. - The collection of form data. - The key. - - - Gets an enumerable that iterates through the collection. - The enumerable that iterates through the collection. - - - Gets the values of the collection of form data. - The values of the collection of form data. - The key. - - - Gets values associated with a given key. If there are multiple values, they're concatenated. - Values associated with a given key. If there are multiple values, they're concatenated. - - - Reads the collection of form data as a collection of name value. - The collection of form data as a collection of name value. - - - Gets an enumerable that iterates through the collection. - The enumerable that iterates through the collection. - - - - class for handling HTML form URL-ended data, also known as application/x-www-form-urlencoded. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Queries whether the can deserializean object of the specified type. - true if the can deserialize the type; otherwise, false. - The type to deserialize. - - - Queries whether the can serializean object of the specified type. - true if the can serialize the type; otherwise, false. - The type to serialize. - - - Gets the default media type for HTML form-URL-encoded data, which is application/x-www-form-urlencoded. - The default media type for HTML form-URL-encoded data - - - Gets or sets the maximum depth allowed by this formatter. - The maximum depth. - - - Gets or sets the size of the buffer when reading the incoming stream. - The buffer size. - - - Asynchronously deserializes an object of the specified type. - A whose result will be the object instance that has been read. - The type of object to deserialize. - The to read. - The for the content being read. - The to log events to. - - - Performs content negotiation. This is the process of selecting a response writer (formatter) in compliance with header values in the request. - - - Performs content negotiating by selecting the most appropriate out of the passed in formatters for the given request that can serialize an object of the given type. - The result of the negotiation containing the most appropriate instance, or null if there is no appropriate formatter. - The type to be serialized. - Request message, which contains the header values used to perform negotiation. - The set of objects from which to choose. - - - Specifies a callback interface that a formatter can use to log errors while reading. - - - Logs an error. - The path to the member for which the error is being logged. - The error message. - - - Logs an error. - The path to the member for which the error is being logged. - The error message to be logged. - - - Defines method that determines whether a given member is required on deserialization. - - - Determines whether a given member is required on deserialization. - true if should be treated as a required member; otherwise false. - The to be deserialized. - - - Represents the default used by . It uses the formatter's to select required members and recognizes the type annotation. - - - Initializes a new instance of the class. - The formatter to use for resolving required members. - - - Creates a property on the specified class by using the specified parameters. - A to create on the specified class by using the specified parameters. - The member info. - The member serialization. - - - Represents the class to handle JSON. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Determines whether this can read objects of the specified . - true if objects of this can be read, otherwise false. - The type of object that will be read. - - - Determines whether this can write objects of the specified . - true if objects of this can be written, otherwise false. - The type of object that will be written. - - - Called during deserialization to get the . - The object used for serialization. - The type of object that will be serialized or deserialized. - - - Called during deserialization to get the . - The reader to use during deserialization. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - - - Called during serialization to get the . - The writer to use during serialization. - The type of the object to write. - The stream to write to. - The encoding to use when writing. - - - Gets the default media type for JSON, namely "application/json". - The for JSON. - - - Gets or sets a value indicating whether to indent elements when writing data. - true if to indent elements when writing data; otherwise, false. - - - Gets or sets the maximum depth allowed by this formatter. - The maximum depth allowed by this formatter. - - - Called during deserialization to read an object of the specified type from the specified stream. - The object that has been read. - The type of the object to read. - The stream from which to read. - The encoding to use when reading. - The logger to log events to. - - - Gets or sets a value indicating whether to use by default. - true if to by default; otherwise, false. - - - Called during serialization to write an object of the specified type to the specified stream. - The type of the object to write. - The object to write. - The stream to write to. - The encoding to use when writing. - - - Called during serialization to write an object of the specified type to the specified stream. - Returns . - The type of the object to write. - The object to write. - The stream to write to. - The for the content being written. - The transport context. - The token to monitor for cancellation. - - - Base class to handle serializing and deserializing strongly-typed objects using . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Queries whether this can deserializean object of the specified type. - true if the can deserialize the type; otherwise, false. - The type to deserialize. - - - Queries whether this can serializean object of the specified type. - true if the can serialize the type; otherwise, false. - The type to serialize. - - - Gets the default value for the specified type. - The default value. - The type for which to get the default value. - - - Returns a specialized instance of the that can format a response for the given parameters. - Returns . - The type to format. - The request. - The media type. - - - Gets or sets the maximum number of keys stored in a T: . - The maximum number of keys. - - - Gets the mutable collection of objects that match HTTP requests to media types. - The collection. - - - Asynchronously deserializes an object of the specified type. - A whose result will be an object of the given type. - The type of the object to deserialize. - The to read. - The , if available. It may be null. - The to log events to. - Derived types need to support reading. - - - Asynchronously deserializes an object of the specified type. - A whose result will be an object of the given type. - The type of the object to deserialize. - The to read. - The , if available. It may be null. - The to log events to. - The token to cancel the operation. - - - Gets or sets the instance used to determine required members. - The instance. - - - Determines the best character encoding for reading or writing an HTTP entity body, given a set of content headers. - The encoding that is the best match. - The content headers. - - - Sets the default headers for content that will be formatted using this formatter. This method is called from the constructor. This implementation sets the Content-Type header to the value of mediaType if it is not null. If it is null it sets the Content-Type to the default media type of this formatter. If the Content-Type does not specify a charset it will set it using this formatters configured . - The type of the object being serialized. See . - The content headers that should be configured. - The authoritative media type. Can be null. - - - Gets the mutable collection of character encodings supported bythis . - The collection of objects. - - - Gets the mutable collection of media types supported bythis . - The collection of objects. - - - Asynchronously writes an object of the specified type. - A that will perform the write. - The type of the object to write. - The object value to write. It may be null. - The to which to write. - The if available. It may be null. - The if available. It may be null. - Derived types need to support writing. - - - Asynchronously writes an object of the specified type. - A that will perform the write. - The type of the object to write. - The object value to write. It may be null. - The to which to write. - The if available. It may be null. - The if available. It may be null. - The token to cancel the operation. - Derived types need to support writing. - - - Collection class that contains instances. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - A collection of instances to place in the collection. - - - Adds the elements of the specified collection to the end of the . - The items that should be added to the end of the . The items collection itself cannot be , but it can contain elements that are . - - - Removes all items in the collection. - - - Helper to search a collection for a formatter that can read the .NET type in the given mediaType. - The formatter that can read the type. Null if no formatter found. - The .NET type to read - The media type to match on. - - - Helper to search a collection for a formatter that can write the .NET type in the given mediaType. - The formatter that can write the type. Null if no formatter found. - The .NET type to read - The media type to match on. - - - Gets the to use for application/x-www-form-urlencoded data. - The to use for application/x-www-form-urlencoded data. - - - Inserts the specified item at the specified index in the collection. - The index to insert at. - The item to insert. - - - Inserts the elements of a collection into the at the specified index. - The zero-based index at which the new elements should be inserted. - The items that should be inserted into the . The items collection itself cannot be , but it can contain elements that are . - - - Returns true if the type is one of those loosely defined types that should be excluded from validation. - true if the type should be excluded; otherwise, false. - The .NET to validate. - - - Gets the to use for JSON. - The to use for JSON. - - - Removes the item at the specified index. - The index of the item to remove. - - - Assigns the item at the specified index in the collection. - The index to insert at. - The item to assign. - - - Gets the to use for XML. - The to use for XML. - - - - - - - This class describes how well a particular matches a request. - - - Initializes a new instance of the class. - The matching formatter. - The media type. Can be null in which case the media type application/octet-stream is used. - The quality of the match. Can be null in which case it is considered a full match with a value of 1.0 - The kind of match. - - - Gets the media type formatter. - - - Gets the matched media type. - - - Gets the quality of the match - - - Gets the kind of match that occurred. - - - Contains information about the degree to which a matches the explicit or implicit preferences found in an incoming request. - - - Matched on a type, meaning that the formatter is able to serialize the type. - - - Matched on an explicit “*/*” range in the Accept header. - - - Matched on an explicit literal accept header, such as “application/json”. - - - Matched on an explicit subtype range in an Accept header, such as “application/*”. - - - Matched on the media type of the entity body in the HTTP request message. - - - Matched on after having applied the various s. - - - No match was found - - - An abstract base class used to create an association between or instances that have certain characteristics and a specific . - - - Initializes a new instance of a with the given mediaType value. - The that is associated with or instances that have the given characteristics of the . - - - Initializes a new instance of a with the given mediaType value. - The that is associated with or instances that have the given characteristics of the . - - - Gets the that is associated with or instances that have the given characteristics of the . - - - Returns the quality of the match of the associated with request. - The quality of the match. It must be between 0.0 and 1.0. A value of 0.0 signifies no match. A value of 1.0 signifies a complete match. - The to evaluate for the characteristics associated with the of the . - - - Class that provides s from query strings. - - - Initializes a new instance of the class. - The name of the query string parameter to match, if present. - The value of the query string parameter specified by queryStringParameterName. - The to use if the query parameter specified by queryStringParameterName is present and assigned the value specified by queryStringParameterValue. - - - Initializes a new instance of the class. - The name of the query string parameter to match, if present. - The value of the query string parameter specified by queryStringParameterName. - The media type to use if the query parameter specified by queryStringParameterName is present and assigned the value specified by queryStringParameterValue. - - - Gets the query string parameter name. - - - Gets the query string parameter value. - - - Returns a value indicating whether the current instance can return a from request. - If this instance can produce a from request it returns 1.0 otherwise 0.0. - The to check. - - - This class provides a mapping from an arbitrary HTTP request header field to a used to select instances for handling the entity body of an or . <remarks>This class only checks header fields associated with for a match. It does not check header fields associated with or instances.</remarks> - - - Initializes a new instance of the class. - Name of the header to match. - The header value to match. - The to use when matching headerValue. - if set to true then headerValue is considered a match if it matches a substring of the actual header value. - The to use if headerName and headerValue is considered a match. - - - Initializes a new instance of the class. - Name of the header to match. - The header value to match. - The value comparison to use when matching headerValue. - if set to true then headerValue is considered a match if it matches a substring of the actual header value. - The media type to use if headerName and headerValue is considered a match. - - - Gets the name of the header to match. - - - Gets the header value to match. - - - Gets the to use when matching . - - - Gets a value indicating whether is a matched as a substring of the actual header value. this instance is value substring. - truefalse - - - Returns a value indicating whether the current instance can return a from request. - The quality of the match. It must be between 0.0 and 1.0. A value of 0.0 signifies no match. A value of 1.0 signifies a complete match. - The to check. - - - A that maps the X-Requested-With http header field set by AJAX XmlHttpRequest (XHR) to the media type application/json if no explicit Accept header fields are present in the request. - - - Initializes a new instance of class - - - Returns a value indicating whether the current instance can return a from request. - The quality of the match. A value of 0.0 signifies no match. A value of 1.0 signifies a complete match and that the request was made using XmlHttpRequest without an Accept header. - The to check. - - - - class to handle Xml. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The instance to copy settings from. - - - Queries whether the can deserializean object of the specified type. - true if the can deserialize the type; otherwise, false. - The type to deserialize. - - - Queries whether the can serializean object of the specified type. - true if the can serialize the type; otherwise, false. - The type to serialize. - - - Called during deserialization to get the DataContractSerializer serializer. - The object used for serialization. - The type of object that will be serialized or deserialized. - - - Called during deserialization to get the XML reader to use for reading objects from the stream. - The to use for reading objects. - The to read from. - The for the content being read. - - - Called during deserialization to get the XML serializer. - The object used for serialization. - The type of object that will be serialized or deserialized. - - - Called during serialization to get the XML writer to use for writing objects to the stream. - The to use for writing objects. - The to write to. - The for the content being written. - - - Gets the default media type for the XML formatter. - The default media type, which is “application/xml”. - - - Called during deserialization to get the XML serializer to use for deserializing objects. - An instance of or to use for deserializing the object. - The type of object to deserialize. - The for the content being read. - - - Called during serialization to get the XML serializer to use for serializing objects. - An instance of or to use for serializing the object. - The type of object to serialize. - The object to serialize. - The for the content being written. - - - Gets or sets a value indicating whether to indent elements when writing data. - true to indent elements; otherwise, false. - - - This method is to support infrastructure and is not intended to be used directly from your code. - Returns . - - - This method is to support infrastructure and is not intended to be used directly from your code. - Returns . - - - This method is to support infrastructure and is not intended to be used directly from your code. - Returns . - - - This method is to support infrastructure and is not intended to be used directly from your code. - Returns . - - - Gets and sets the maximum nested node depth. - The maximum nested node depth. - - - Called during deserialization to read an object of the specified type from the specified readStream. - A whose result will be the object instance that has been read. - The type of object to read. - The from which to read. - The for the content being read. - The to log events to. - - - Unregisters the serializer currently associated with the given type. - true if a serializer was previously registered for the type; otherwise, false. - The type of object whose serializer should be removed. - - - Registers an to read or write objects of a specified type. - The instance. - The type of object that will be serialized or deserialized with. - - - Registers an to read or write objects of a specified type. - The type of object that will be serialized or deserialized with. - The instance. - - - Registers an to read or write objects of a specified type. - The type of object that will be serialized or deserialized with. - The instance. - - - Registers an to read or write objects of a specified type. - The instance. - The type of object that will be serialized or deserialized with. - - - Gets or sets a value indicating whether the XML formatter uses the as the default serializer, instead of using the . - If true, the formatter uses the by default; otherwise, it uses the by default. - - - Gets the settings to be used while writing. - The settings to be used while writing. - - - Called during serialization to write an object of the specified type to the specified writeStream. - A that will write the value to the stream. - The type of object to write. - The object to write. - The to which to write. - The for the content being written. - The . - The token to monitor cancellation. - - - Represents the event arguments for the HTTP progress. - - - Initializes a new instance of the class. - The percentage of the progress. - The user token. - The number of bytes transferred. - The total number of bytes transferred. - - - - - Generates progress notification for both request entities being uploaded and response entities being downloaded. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The inner message handler. - - - Occurs when event entities are being downloaded. - - - Occurs when event entities are being uploaded. - - - Raises the event that handles the request of the progress. - The request. - The event handler for the request. - - - Raises the event that handles the response of the progress. - The request. - The event handler for the request. - - - Sends the specified progress message to an HTTP server for delivery. - The sent progress message. - The request. - The cancellation token. - - - Provides value for the cookie header. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The value of the name. - The values. - - - Initializes a new instance of the class. - The value of the name. - The value. - - - Creates a shallow copy of the cookie value. - A shallow copy of the cookie value. - - - Gets a collection of cookies sent by the client. - A collection object representing the client’s cookie variables. - - - Gets or sets the domain to associate the cookie with. - The name of the domain to associate the cookie with. - - - Gets or sets the expiration date and time for the cookie. - The time of day (on the client) at which the cookie expires. - - - Gets or sets a value that specifies whether a cookie is accessible by client-side script. - true if the cookie has the HttpOnly attribute and cannot be accessed through a client-side script; otherwise, false. - - - Gets a shortcut to the cookie property. - The cookie value. - - - Gets or sets the maximum age permitted for a resource. - The maximum age permitted for a resource. - - - Gets or sets the virtual path to transmit with the current cookie. - The virtual path to transmit with the cookie. - - - Gets or sets a value indicating whether to transmit the cookie using Secure Sockets Layer (SSL)—that is, over HTTPS only. - true to transmit the cookie over an SSL connection (HTTPS); otherwise, false. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Indicates a value whether the string representation will be converted. - true if the string representation will be converted; otherwise, false. - The input value. - The parsed value to convert. - - - Contains cookie name and its associated cookie state. - - - Initializes a new instance of the class. - The name of the cookie. - - - Initializes a new instance of the class. - The name of the cookie. - The collection of name-value pair for the cookie. - - - Initializes a new instance of the class. - The name of the cookie. - The value of the cookie. - - - Returns a new object that is a copy of the current instance. - A new object that is a copy of the current instance. - - - Gets or sets the cookie value with the specified cookie name, if the cookie data is structured. - The cookie value with the specified cookie name. - - - Gets or sets the name of the cookie. - The name of the cookie. - - - Returns the string representation the current object. - The string representation the current object. - - - Gets or sets the cookie value, if cookie data is a simple string value. - The value of the cookie. - - - Gets or sets the collection of name-value pair, if the cookie data is structured. - The collection of name-value pair for the cookie. - - - \ No newline at end of file diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/System.Web.Http.dll b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/System.Web.Http.dll deleted file mode 100644 index e1dbdd1825..0000000000 Binary files a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/System.Web.Http.dll and /dev/null differ diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/System.Web.Http.xml b/src/NSwag.Integration.Tests/VersionMissmatchTest/input/System.Web.Http.xml deleted file mode 100644 index 365dd7b93a..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/input/System.Web.Http.xml +++ /dev/null @@ -1,6664 +0,0 @@ - - - - System.Web.Http - - - - - Creates an that represents an exception. - The request must be associated with an instance.An whose content is a serialized representation of an instance. - The HTTP request. - The status code of the response. - The exception. - - - Creates an that represents an error message. - The request must be associated with an instance.An whose content is a serialized representation of an instance. - The HTTP request. - The status code of the response. - The error message. - - - Creates an that represents an exception with an error message. - The request must be associated with an instance.An whose content is a serialized representation of an instance. - The HTTP request. - The status code of the response. - The error message. - The exception. - - - Creates an that represents an error. - The request must be associated with an instance.An whose content is a serialized representation of an instance. - The HTTP request. - The status code of the response. - The HTTP error. - - - Creates an that represents an error in the model state. - The request must be associated with an instance.An whose content is a serialized representation of an instance. - The HTTP request. - The status code of the response. - The model state. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The media type formatter. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The media type formatter. - The media type header value. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The media type formatter. - The media type. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The media type header value. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The media type. - The type of the HTTP response message. - - - Creates an wired up to the associated . - An initialized wired up to the associated . - The HTTP request message which led to this response message. - The HTTP response status code. - The content of the HTTP response message. - The HTTP configuration which contains the dependency resolver used to resolve services. - The type of the HTTP response message. - - - - - - Disposes of all tracked resources associated with the which were added via the method. - The HTTP request. - - - - Gets the current X.509 certificate from the given HTTP request. - The current , or null if a certificate is not available. - The HTTP request. - - - Retrieves the for the given request. - The for the given request. - The HTTP request. - - - Retrieves the which has been assigned as the correlation ID associated with the given . The value will be created and set the first time this method is called. - The object that represents the correlation ID associated with the request. - The HTTP request. - - - Retrieves the for the given request or null if not available. - The for the given request or null if not available. - The HTTP request. - - - Gets the parsed query string as a collection of key-value pairs. - The query string as a collection of key-value pairs. - The HTTP request. - - - - - Retrieves the for the given request or null if not available. - The for the given request or null if not available. - The HTTP request. - - - Retrieves the for the given request or null if not available. - The for the given request or null if not available. - The HTTP request. - - - Gets a instance for an HTTP request. - A instance that is initialized for the specified HTTP request. - The HTTP request. - - - - - - Adds the given to a list of resources that will be disposed by a host once the is disposed. - The HTTP request controlling the lifecycle of . - The resource to dispose when is being disposed. - - - - - - - Represents the message extensions for the HTTP response from an ASP.NET operation. - - - Attempts to retrieve the value of the content for the . - The result of the retrieval of value of the content. - The response of the operation. - The value of the content. - The type of the value to retrieve. - - - Represents extensions for adding items to a . - - - - - Provides s from path extensions appearing in a . - - - Initializes a new instance of the class. - The extension corresponding to mediaType. This value should not include a dot or wildcards. - The that will be returned if uriPathExtension is matched. - - - Initializes a new instance of the class. - The extension corresponding to mediaType. This value should not include a dot or wildcards. - The media type that will be returned if uriPathExtension is matched. - - - Returns a value indicating whether this instance can provide a for the of request. - If this instance can match a file extension in request it returns 1.0 otherwise 0.0. - The to check. - - - Gets the path extension. - The path extension. - - - The path extension key. - - - Represents an attribute that specifies which HTTP methods an action method will respond to. - - - Initializes a new instance of the class by using the action method it will respond to. - The HTTP method that the action method will respond to. - - - Initializes a new instance of the class by using a list of HTTP methods that the action method will respond to. - The HTTP methods that the action method will respond to. - - - Gets or sets the list of HTTP methods that the action method will respond to. - Gets or sets the list of HTTP methods that the action method will respond to. - - - Represents an attribute that is used for the name of an action. - - - Initializes a new instance of the class. - The name of the action. - - - Gets or sets the name of the action. - The name of the action. - - - Specifies that actions and controllers are skipped by during authorization. - - - Initializes a new instance of the class. - - - Defines properties and methods for API controller. - - - - Gets the action context. - The action context. - - - Creates a . - A . - - - Creates an (400 Bad Request) with the specified error message. - An with the specified model state. - The user-visible error message. - - - Creates an with the specified model state. - An with the specified model state. - The model state to include in the error. - - - Gets the of the current . - The of the current . - - - Creates a (409 Conflict). - A . - - - Creates a <see cref="T:System.Web.Http.NegotiatedContentResult`1" /> with the specified values. - A <see cref="T:System.Web.Http.NegotiatedContentResult`1" /> with the specified values. - The HTTP status code for the response message. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - A <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - The HTTP status code for the response message. - The content value to format in the entity body. - The formatter to use to format the content. - The type of content in the entity body. - - - Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - A <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - The HTTP status code for the response message. - The content value to format in the entity body. - The formatter to use to format the content. - The value for the Content-Type header, or <see langword="null" /> to have the formatter pick a default value. - The type of content in the entity body. - - - Creates a <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - A <see cref="T:System.Web.Http.FormattedContentResult`1" /> with the specified values. - The HTTP status code for the response message. - The content value to format in the entity body. - The formatter to use to format the content. - The value for the Content-Type header. - The type of content in the entity body. - - - Gets the of the current . - The of the current . - - - Creates a (201 Created) with the specified values. - A with the specified values. - The location at which the content has been created. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Creates a (201 Created) with the specified values. - A with the specified values. - The location at which the content has been created. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Creates a (201 Created) with the specified values. - A with the specified values. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Creates a (201 Created) with the specified values. - A with the specified values. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Executes asynchronously a single HTTP operation. - The newly started task. - The controller context for a single HTTP operation. - The cancellation token assigned for the HTTP operation. - - - Initializes the instance with the specified controllerContext. - The object that is used for the initialization. - - - Creates an (500 Internal Server Error). - A . - - - Creates an (500 Internal Server Error) with the specified exception. - An with the specified exception. - The exception to include in the error. - - - Creates a (200 OK) with the specified value. - A with the specified value. - The content value to serialize in the entity body. - The type of content in the entity body. - - - Creates a (200 OK) with the specified values. - A with the specified values. - The content value to serialize in the entity body. - The serializer settings. - The type of content in the entity body. - - - Creates a (200 OK) with the specified values. - A with the specified values. - The content value to serialize in the entity body. - The serializer settings. - The content encoding. - The type of content in the entity body. - - - Gets the model state after the model binding process. - The model state after the model binding process. - - - Creates a . - A . - - - Creates an (200 OK). - An . - - - Creates an with the specified values. - An with the specified values. - The content value to negotiate and format in the entity body. - The type of content in the entity body. - - - Creates a redirect result (302 Found) with the specified value. - A redirect result (302 Found) with the specified value. - The location to redirect to. - - - Creates a redirect result (302 Found) with the specified value. - A redirect result (302 Found) with the specified value. - The location to redirect to. - - - Creates a redirect to route result (302 Found) with the specified values. - A redirect to route result (302 Found) with the specified values. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - - - Creates a redirect to route result (302 Found) with the specified values. - A redirect to route result (302 Found) with the specified values. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - - - Gets or sets the HttpRequestMessage of the current . - The HttpRequestMessage of the current . - - - Gets the request context. - The request context. - - - Creates a with the specified response. - A for the specified response. - The HTTP response message. - - - Creates a with the specified status code. - A with the specified status code. - The HTTP status code for the response message - - - Creates an (401 Unauthorized) with the specified values. - An with the specified values. - The WWW-Authenticate challenges. - - - Creates an (401 Unauthorized) with the specified values. - An with the specified values. - The WWW-Authenticate challenges. - - - Gets an instance of a , which is used to generate URLs to other APIs. - A , which is used to generate URLs to other APIs. - - - Returns the current principal associated with this request. - The current principal associated with this request. - - - Validates the given entity and adds the validation errors to the model state under the empty prefix, if any. - The entity being validated. - The type of the entity to be validated. - - - Validates the given entity and adds the validation errors to the model state, if any. - The entity being validated. - The key prefix under which the model state errors would be added in the model state. - The type of the entity to be validated. - - - Specifies the authorization filter that verifies the request's . - - - Initializes a new instance of the class. - - - Processes requests that fail authorization. - The context. - - - Indicates whether the specified control is authorized. - true if the control is authorized; otherwise, false. - The context. - - - Calls when an action is being authorized. - The context. - The context parameter is null. - - - Gets or sets the authorized roles. - The roles string. - - - Gets a unique identifier for this attribute. - A unique identifier for this attribute. - - - Gets or sets the authorized users. - The users string. - - - An attribute that specifies that an action parameter comes only from the entity body of the incoming . - - - Initializes a new instance of the class. - - - Gets a parameter binding. - The parameter binding. - The parameter description. - - - An attribute that specifies that an action parameter comes from the URI of the incoming . - - - Initializes a new instance of the class. - - - Gets the value provider factories for the model binder. - A collection of objects. - The configuration. - - - Represents attributes that specifies that HTTP binding should exclude a property. - - - Initializes a new instance of the class. - - - Represents the required attribute for http binding. - - - Initializes a new instance of the class. - - - Represents a configuration of instances. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with an HTTP route collection. - The HTTP route collection to associate with this instance. - - - Gets or sets the dependency resolver associated with thisinstance. - The dependency resolver. - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Invoke the Intializer hook. It is considered immutable from this point forward. It's safe to call this multiple times. - - - Gets the list of filters that apply to all requests served using this instance. - The list of filters. - - - Gets the media-type formatters for this instance. - A collection of objects. - - - Gets or sets a value indicating whether error details should be included in error messages. - The value that indicates that error detail policy. - - - Gets or sets the action that will perform final initialization of the instance before it is used to process requests. - The action that will perform final initialization of the instance. - - - Gets an ordered list of instances to be invoked as an travels up the stack and an travels down in stack in return. - The message handler collection. - - - Gets the collection of rules for how parameters should be bound. - A collection of functions that can produce a parameter binding for a given parameter. - - - Gets the properties associated with this instance. - The that contains the properties. - - - Gets the associated with this instance. - The . - - - Gets the container of default services associated with this instance. - The that contains the default services for this instance. - - - Gets the root virtual path. - The root virtual path. - - - Contains extension methods for the class. - - - - - Maps the attribute-defined routes for the application. - The server configuration. - The to use for discovering and building routes. - - - Maps the attribute-defined routes for the application. - The server configuration. - The constraint resolver. - - - Maps the attribute-defined routes for the application. - The server configuration. - The to use for resolving inline constraints. - The to use for discovering and building routes. - - - - Specifies that an action supports the DELETE HTTP method. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Defines a serializable container for storing error information. This information is stored as key/value pairs. The dictionary keys to look up standard error information are available on the type. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class for . - The exception to use for error information. - true to include the exception information in the error; false otherwise - - - Initializes a new instance of the class containing error message . - The error message to associate with this instance. - - - Initializes a new instance of the class for . - The invalid model state to use for error information. - true to include exception messages in the error; false otherwise - - - Gets or sets the message of the if available. - The message of the if available. - - - Gets or sets the type of the if available. - The type of the if available. - - - Gets a particular property value from this error instance. - A particular property value from this error instance. - The name of the error property. - The type of the property. - - - Gets the inner associated with this instance if available. - The inner associated with this instance if available. - - - Gets or sets the high-level, user-visible message explaining the cause of the error. Information carried in this field should be considered public in that it will go over the wire regardless of the . As a result care should be taken not to disclose sensitive information about the server or the application. - The high-level, user-visible message explaining the cause of the error. Information carried in this field should be considered public in that it will go over the wire regardless of the . As a result care should be taken not to disclose sensitive information about the server or the application. - - - Gets or sets a detailed description of the error intended for the developer to understand exactly what failed. - A detailed description of the error intended for the developer to understand exactly what failed. - - - Gets the containing information about the errors that occurred during model binding. - The containing information about the errors that occurred during model binding. - - - Gets or sets the stack trace information associated with this instance if available. - The stack trace information associated with this instance if available. - - - This method is reserved and should not be used. - Always returns null. - - - Generates an instance from its XML representation. - The XmlReader stream from which the object is deserialized. - - - Converts an instance into its XML representation. - The XmlWriter stream to which the object is serialized. - - - Provides keys to look up error information stored in the dictionary. - - - Provides a key for the ErrorCode. - - - Provides a key for the ExceptionMessage. - - - Provides a key for the ExceptionType. - - - Provides a key for the InnerException. - - - Provides a key for the MessageDetail. - - - Provides a key for the Message. - - - Provides a key for the MessageLanguage. - - - Provides a key for the ModelState. - - - Provides a key for the StackTrace. - - - Specifies that an action supports the GET HTTP method. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Specifies that an action supports the HEAD HTTP method. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Represents an attribute that is used to restrict an HTTP method so that the method handles only HTTP OPTIONS requests. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Specifies that an action supports the PATCH HTTP method. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Specifies that an action supports the POST HTTP method. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - Represents an attribute that is used to restrict an HTTP method so that the method handles only HTTP PUT requests. - - - Initializes a new instance of the class. - - - Gets the http methods that correspond to this attribute. - The http methods that correspond to this attribute. - - - An exception that allows for a given to be returned to the client. - - - Initializes a new instance of the class. - The HTTP response to return to the client. - - - Initializes a new instance of the class. - The status code of the response. - - - Gets the HTTP response to return to the client. - The that represents the HTTP response. - - - A collection of instances. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The virtual path root. - - - Adds an instance to the collection. - The name of the route. - The instance to add to the collection. - - - Removes all items from the collection. - - - Determines whether the collection contains a specific . - true if the is found in the collection; otherwise, false. - The object to locate in the collection. - - - Determines whether the collection contains an element with the specified key. - true if the collection contains an element with the key; otherwise, false. - The key to locate in the collection. - - - Copies the instances of the collection to an array, starting at a particular array index. - The array that is the destination of the elements copied from the collection. - The zero-based index in at which copying begins. - - - Copies the route names and instances of the collection to an array, starting at a particular array index. - The array that is the destination of the elements copied from the collection. - The zero-based index in at which copying begins. - - - Gets the number of items in the collection. - The number of items in the collection. - - - Creates an instance. - The new instance. - The route template. - An object that contains the default route parameters. - An object that contains the route constraints. - The route data tokens. - - - Creates an instance. - The new instance. - The route template. - An object that contains the default route parameters. - An object that contains the route constraints. - The route data tokens. - The message handler for the route. - - - Creates an instance. - The new instance. - The route template. - An object that contains the default route parameters. - An object that contains the route constraints. - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Returns an enumerator that iterates through the collection. - An that can be used to iterate through the collection. - - - Gets the route data for a specified HTTP request. - An instance that represents the route data. - The HTTP request. - - - Gets a virtual path. - An instance that represents the virtual path. - The HTTP request. - The route name. - The route values. - - - Inserts an instance into the collection. - The zero-based index at which should be inserted. - The route name. - The to insert. The value cannot be null. - - - Gets a value indicating whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets or sets the element at the specified index. - The at the specified index. - The index. - - - Gets or sets the element with the specified route name. - The at the specified index. - The route name. - - - Called internally to get the enumerator for the collection. - An that can be used to iterate through the collection. - - - Removes an instance from the collection. - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the collection. - The name of the route to remove. - - - Adds an item to the collection. - The object to add to the collection. - - - Removes the first occurrence of a specific object from the collection. - true if was successfully removed from the collection; otherwise, false. This method also returns false if is not found in the original collection. - The object to remove from the collection. - - - Returns an enumerator that iterates through the collection. - An object that can be used to iterate through the collection. - - - Gets the with the specified route name. - true if the collection contains an element with the specified name; otherwise, false. - The route name. - When this method returns, contains the instance, if the route name is found; otherwise, null. This parameter is passed uninitialized. - - - Validates that a constraint is valid for an created by a call to the method. - The route template. - The constraint name. - The constraint object. - - - Gets the virtual path root. - The virtual path root. - - - Extension methods for - - - Ignores the specified route. - Returns . - A collection of routes for the application. - The name of the route to ignore. - The route template for the route. - - - Ignores the specified route. - Returns . - A collection of routes for the application. - The name of the route to ignore. - The route template for the route. - A set of expressions that specify values for the route template. - - - Maps the specified route for handling HTTP batch requests. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - The for handling batch requests. - - - Maps the specified route template. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - - - Maps the specified route template and sets default route values. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - An object that contains default route values. - - - Maps the specified route template and sets default route values and constraints. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - An object that contains default route values. - A set of expressions that specify values for . - - - Maps the specified route template and sets default route values, constraints, and end-point message handler. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The route template for the route. - An object that contains default route values. - A set of expressions that specify values for . - The handler to which the request will be dispatched. - - - Defines an implementation of an which dispatches an incoming and creates an as a result. - - - Initializes a new instance of the class, using the default configuration and dispatcher. - - - Initializes a new instance of the class with a specified dispatcher. - The HTTP dispatcher that will handle incoming requests. - - - Initializes a new instance of the class with a specified configuration. - The used to configure this instance. - - - Initializes a new instance of the class with a specified configuration and dispatcher. - The used to configure this instance. - The HTTP dispatcher that will handle incoming requests. - - - Gets the used to configure this instance. - The used to configure this instance. - - - Gets the HTTP dispatcher that handles incoming requests. - The HTTP dispatcher that handles incoming requests. - - - Releases the unmanaged resources that are used by the object and, optionally, releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Prepares the server for operation. - - - Dispatches an incoming . - A task representing the asynchronous operation. - The request to dispatch. - The token to monitor for cancellation requests. - - - Defines a command that asynchronously creates an . - - - Creates an asynchronously. - A task that, when completed, contains the . - The token to monitor for cancellation requests. - - - Specifies whether error details, such as exception messages and stack traces, should be included in error messages. - - - Always include error details. - - - Use the default behavior for the host environment. For ASP.NET hosting, use the value from the customErrors element in the Web.config file. For self-hosting, use the value . - - - Only include error details when responding to a local request. - - - Never include error details. - - - Represents an attribute that is used to indicate that a controller method is not an action method. - - - Initializes a new instance of the class. - - - Represents a filter attribute that overrides action filters defined at a higher level. - - - Initializes a new instance of the class. - - - Gets a value indicating whether the action filter allows multiple attribute. - true if the action filter allows multiple attribute; otherwise, false. - - - Gets the type of filters to override. - The type of filters to override. - - - Represents a filter attribute that overrides authentication filters defined at a higher level. - - - - - - Represents a filter attribute that overrides authorization filters defined at a higher level. - - - Initializes a new instance of the class. - - - Gets or sets a Boolean value indicating whether more than one instance of the indicated attribute can be specified for a single program element. - true if more than one instance is allowed to be specified; otherwise, false. - - - Gets the type to filters override attributes. - The type to filters override attributes. - - - Represents a filter attribute that overrides exception filters defined at a higher level. - - - - - - Attribute on a parameter or type that produces a . If the attribute is on a type-declaration, then it's as if that attribute is present on all action parameters of that type. - - - Initializes a new instance of the class. - - - Gets the parameter binding. - The parameter binding. - The parameter description. - - - Place on an action to expose it directly via a route. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The route template describing the URI pattern to match against. - - - Returns . - - - Returns . - - - - Returns . - - - The class can be used to indicate properties about a route parameter (the literals and placeholders located within segments of a ). It can for example be used to indicate that a route parameter is optional. - - - An optional parameter. - - - Returns a that represents this instance. - A that represents this instance. - - - Annotates a controller with a route prefix that applies to all actions within the controller. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The route prefix for the controller. - - - Gets the route prefix. - - - Provides type-safe accessors for services obtained from a object. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Returns the registered unhandled exception handler, if any. - The registered unhandled exception hander, if present; otherwise, null. - The services container. - - - Returns the collection of registered unhandled exception loggers. - The collection of registered unhandled exception loggers. - The services container. - - - Gets the collection. - Returns a collection of objects. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance, or null if no instance was registered. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the collection. - Returns a collection of objects. - The services container. - - - Gets the service. - Returns an instance. - The services container. - - - Gets the collection. - Returns a collection ofobjects. - The services container. - - - Gets the service. - Returns aninstance. - The services container. - - - Gets the service. - Returns aninstance. - The services container. - - - Gets the collection. - Returns a collection of objects. - The services container. - - - Represents an containing zero or one entities. Use together with an [EnableQuery] from the System.Web.Http.OData or System.Web.OData namespace. - - - Initializes a new instance of the class. - The containing zero or one entities. - - - Creates a from an . A helper method to instantiate a object without having to explicitly specify the type . - The created . - The containing zero or one entities. - The type of the data in the data source. - - - The containing zero or one entities. - - - Represents an containing zero or one entities. Use together with an [EnableQuery] from the System.Web.Http.OData or System.Web.OData namespace. - The type of the data in the data source. - - - Initializes a new instance of the class. - The containing zero or one entities. - - - The containing zero or one entities. - - - Defines the order of execution for batch requests. - - - Executes the batch requests non-sequentially. - - - Executes the batch requests sequentially. - - - Provides extension methods for the class. - - - Copies the properties from another . - The sub-request. - The batch request that contains the properties to copy. - - - Represents the default implementation of that encodes the HTTP request/response messages as MIME multipart. - - - Initializes a new instance of the class. - The for handling the individual batch requests. - - - Creates the batch response message. - The batch response message. - The responses for the batch requests. - The original request containing all the batch requests. - The cancellation token. - - - Executes the batch request messages. - A collection of for the batch requests. - The collection of batch request messages. - The cancellation token. - - - Gets or sets the execution order for the batch requests. The default execution order is sequential. - The execution order for the batch requests. The default execution order is sequential. - - - Converts the incoming batch request into a collection of request messages. - A collection of . - The request containing the batch request messages. - The cancellation token. - - - Processes the batch requests. - The result of the operation. - The batch request. - The cancellation token. - - - Gets the supported content types for the batch request. - The supported content types for the batch request. - - - Validates the incoming request that contains the batch request messages. - The request containing the batch request messages. - - - Defines the abstraction for handling HTTP batch requests. - - - Initializes a new instance of the class. - The for handling the individual batch requests. - - - Gets the invoker to send the batch requests to the . - The invoker to send the batch requests to the . - - - Processes the incoming batch request as a single . - The batch response. - The batch request. - The cancellation token. - - - Sends the batch handler asynchronously. - The result of the operation. - the send request. - The cancelation token. - - - Invokes the action methods of a controller. - - - Initializes a new instance of the class. - - - Asynchronously invokes the specified action by using the specified controller context. - The invoked action. - The controller context. - The cancellation token. - - - Represents a reflection based action selector. - - - Initializes a new instance of the class. - - - Gets the action mappings for the . - The action mappings. - The information that describes a controller. - - - Selects an action for the . - The selected action. - The controller context. - - - Represents a container for services that can be specific to a controller. This shadows the services from its parent . A controller can either set a service here, or fall through to the more global set of services. - - - Initializes a new instance of the class. - The parent services container. - - - Removes a single-instance service from the default services. - The type of service. - - - Gets a service of the specified type. - The first instance of the service, or null if the service is not found. - The type of service. - - - Gets the list of service objects for a given service type, and validates the service type. - The list of service objects of the specified type. - The service type. - - - Gets the list of service objects for a given service type. - The list of service objects of the specified type, or an empty list if the service is not found. - The type of service. - - - Queries whether a service type is single-instance. - true if the service type has at most one instance, or false if the service type supports multiple instances. - The service type. - - - Replaces a single-instance service object. - The service type. - The service object that replaces the previous instance. - - - Describes *how* the binding will happen and does not actually bind. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The back pointer to the action this binding is for. - The synchronous bindings for each parameter. - - - Gets or sets the back pointer to the action this binding is for. - The back pointer to the action this binding is for. - - - Executes asynchronously the binding for the given request context. - Task that is signaled when the binding is complete. - The action context for the binding. This contains the parameter dictionary that will get populated. - The cancellation token for cancelling the binding operation. Or a binder can also bind a parameter to this. - - - Gets or sets the synchronous bindings for each parameter. - The synchronous bindings for each parameter. - - - Contains information for the executing action. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The controller context. - The action descriptor. - - - Gets a list of action arguments. - A list of action arguments. - - - Gets or sets the action descriptor for the action context. - The action descriptor. - - - Gets or sets the controller context. - The controller context. - - - Gets the model state dictionary for the context. - The model state dictionary. - - - Gets the request message for the action context. - The request message for the action context. - - - Gets the current request context. - The current request context. - - - Gets or sets the response message for the action context. - The response message for the action context. - - - Contains extension methods for . - - - - - - - - - - - Provides information about the action methods. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with specified information that describes the controller of the action.. - The information that describes the controller of the action. - - - Gets or sets the binding that describes the action. - The binding that describes the action. - - - Gets the name of the action. - The name of the action. - - - Gets or sets the action configuration. - The action configuration. - - - Gets the information that describes the controller of the action. - The information that describes the controller of the action. - - - Executes the described action and returns a that once completed will contain the return value of the action. - A that once completed will contain the return value of the action. - The controller context. - A list of arguments. - The cancellation token. - - - Returns the custom attributes associated with the action descriptor. - The custom attributes associated with the action descriptor. - The action descriptor. - - - Gets the custom attributes for the action. - The collection of custom attributes applied to this action. - true to search this action's inheritance chain to find the attributes; otherwise, false. - The type of attribute to search for. - - - Retrieves the filters for the given configuration and action. - The filters for the given configuration and action. - - - Retrieves the filters for the action descriptor. - The filters for the action descriptor. - - - Retrieves the parameters for the action descriptor. - The parameters for the action descriptor. - - - Gets the properties associated with this instance. - The properties associated with this instance. - - - Gets the converter for correctly transforming the result of calling ExecuteAsync(HttpControllerContext, IDictionaryString, Object)" into an instance of . - The action result converter. - - - Gets the return type of the descriptor. - The return type of the descriptor. - - - Gets the collection of supported HTTP methods for the descriptor. - The collection of supported HTTP methods for the descriptor. - - - Contains information for a single HTTP operation. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The request context. - The HTTP request. - The controller descriptor. - The controller. - - - Initializes a new instance of the class. - The configuration. - The route data. - The request. - - - Gets or sets the configuration. - The configuration. - - - Gets or sets the HTTP controller. - The HTTP controller. - - - Gets or sets the controller descriptor. - The controller descriptor. - - - Gets or sets the request. - The request. - - - Gets or sets the request context. - - - Gets or sets the route data. - The route data. - - - Represents information that describes the HTTP controller. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The configuration. - The controller name. - The controller type. - - - Gets or sets the configurations associated with the controller. - The configurations associated with the controller. - - - Gets or sets the name of the controller. - The name of the controller. - - - Gets or sets the type of the controller. - The type of the controller. - - - Creates a controller instance for the given . - The created controller instance. - The request message. - - - Retrieves a collection of custom attributes of the controller. - A collection of custom attributes. - The type of the object. - - - Returns a collection of attributes that can be assigned to <typeparamref name="T" /> for this descriptor's controller. - A collection of attributes associated with this controller. - true to search this controller's inheritance chain to find the attributes; otherwise, false. - Used to filter the collection of attributes. Use a value of to retrieve all attributes. - - - Returns a collection of filters associated with the controller. - A collection of filters associated with the controller. - - - Gets the properties associated with this instance. - The properties associated with this instance. - - - Contains settings for an HTTP controller. - - - Initializes a new instance of the class. - A configuration object that is used to initialize the instance. - - - Gets the collection of instances for the controller. - The collection of instances. - - - Gets the collection of parameter bindingfunctions for for the controller. - The collection of parameter binding functions. - - - Gets the collection of service instances for the controller. - The collection of service instances. - - - Describes how a parameter is bound. The binding should be static (based purely on the descriptor) and can be shared across requests. - - - Initializes a new instance of the class. - An that describes the parameters. - - - Gets the that was used to initialize this instance. - The instance. - - - If the binding is invalid, gets an error message that describes the binding error. - An error message. If the binding was successful, the value is null. - - - Asynchronously executes the binding for the given request. - A task object representing the asynchronous operation. - Metadata provider to use for validation. - The action context for the binding. The action context contains the parameter dictionary that will get populated with the parameter. - Cancellation token for cancelling the binding operation. - - - Gets the parameter value from argument dictionary of the action context. - The value for this parameter in the given action context, or null if the parameter has not yet been set. - The action context. - - - Gets a value that indicates whether the binding was successful. - true if the binding was successful; otherwise, false. - - - Sets the result of this parameter binding in the argument dictionary of the action context. - The action context. - The parameter value. - - - Returns a value indicating whether this instance will read the entity body of the HTTP message. - true if this will read the entity body; otherwise, false. - - - Represents the HTTP parameter descriptor. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The action descriptor. - - - Gets or sets the action descriptor. - The action descriptor. - - - Gets or sets the for the . - The for the . - - - Gets the default value of the parameter. - The default value of the parameter. - - - Retrieves a collection of the custom attributes from the parameter. - A collection of the custom attributes from the parameter. - The type of the custom attributes. - - - Gets a value that indicates whether the parameter is optional. - true if the parameter is optional; otherwise, false. - - - Gets or sets the parameter binding attribute. - The parameter binding attribute. - - - Gets the name of the parameter. - The name of the parameter. - - - Gets the type of the parameter. - The type of the parameter. - - - Gets the prefix of this parameter. - The prefix of this parameter. - - - Gets the properties of this parameter. - The properties of this parameter. - - - Represents the context associated with a request. - - - Initializes a new instance of the class. - - - Gets or sets the client certificate. - Returns . - - - Gets or sets the configuration. - Returns . - - - Gets or sets a value indicating whether error details, such as exception messages and stack traces, should be included in the response for this request. - Returns . - - - Gets or sets a value indicating whether the request originates from a local address. - Returns . - - - .Gets or sets the principal - Returns . - - - Gets or sets the route data. - Returns . - - - Gets or sets the factory used to generate URLs to other APIs. - Returns . - - - Gets or sets the virtual path root. - Returns . - - - - - A contract for a conversion routine that can take the result of an action returned from <see cref="M:System.Web.Http.Controllers.HttpActionDescriptor.ExecuteAsync(System.Web.Http.Controllers.HttpControllerContext,System.Collections.Generic.IDictionary{System.String,System.Object})" /> and convert it to an instance of . - - - Converts the specified object to another object. - The converted object. - The controller context. - The action result. - - - Defines the method for retrieval of action binding associated with parameter value. - - - Gets the . - A object. - The action descriptor. - - - If a controller is decorated with an attribute with this interface, then it gets invoked to initialize the controller settings. - - - Callback invoked to set per-controller overrides for this controllerDescriptor. - The controller settings to initialize. - The controller descriptor. Note that the can be associated with the derived controller type given that is inherited. - - - Contains method that is used to invoke HTTP operation. - - - Executes asynchronously the HTTP operation. - The newly started task. - The execution context. - The cancellation token assigned for the HTTP operation. - - - Contains the logic for selecting an action method. - - - Returns a map, keyed by action string, of all that the selector can select. This is primarily called by to discover all the possible actions in the controller. - A map of that the selector can select, or null if the selector does not have a well-defined mapping of . - The controller descriptor. - - - Selects the action for the controller. - The action for the controller. - The context of the controller. - - - Represents an HTTP controller. - - - Executes the controller for synchronization. - The controller. - The current context for a test controller. - The notification that cancels the operation. - - - Defines extension methods for . - - - Binds parameter that results as an error. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The error message that describes the reason for fail bind. - - - Bind the parameter as if it had the given attribute on the declaration. - The HTTP parameter binding object. - The parameter to provide binding for. - The attribute that describes the binding. - - - Binds parameter by parsing the HTTP body content. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - - - Binds parameter by parsing the HTTP body content. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object. - - - Binds parameter by parsing the HTTP body content. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object. - The body model validator used to validate the parameter. - - - Binds parameter by parsing the HTTP body content. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The list of formatters which provides selection of an appropriate formatter for serializing the parameter into object. - - - Binds parameter by parsing the query string. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - - - Binds parameter by parsing the query string. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The value provider factories which provide query string parameter data. - - - Binds parameter by parsing the query string. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The model binder used to assemble the parameter into an object. - - - Binds parameter by parsing the query string. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The model binder used to assemble the parameter into an object. - The value provider factories which provide query string parameter data. - - - Binds parameter by parsing the query string. - The HTTP parameter binding object. - The parameter descriptor that describes the parameter to bind. - The value provider factories which provide query string parameter data. - - - Represents a reflected synchronous or asynchronous action method. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified descriptor and method details.. - The controller descriptor. - The action-method information. - - - Gets the name of the action. - The name of the action. - - - - Executes the described action and returns a that once completed will contain the return value of the action. - A [T:System.Threading.Tasks.Task`1"] that once completed will contain the return value of the action. - The context. - The arguments. - A cancellation token to cancel the action. - - - Returns an array of custom attributes defined for this member, identified by type. - An array of custom attributes or an empty array if no custom attributes exist. - true to search this action's inheritance chain to find the attributes; otherwise, false. - The type of the custom attributes. - - - Retrieves information about action filters. - The filter information. - - - - Retrieves the parameters of the action method. - The parameters of the action method. - - - Gets or sets the action-method information. - The action-method information. - - - Gets the return type of this method. - The return type of this method. - - - Gets or sets the supported http methods. - The supported http methods. - - - Represents the reflected HTTP parameter descriptor. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The action descriptor. - The parameter information. - - - Gets the default value for the parameter. - The default value for the parameter. - - - Retrieves a collection of the custom attributes from the parameter. - A collection of the custom attributes from the parameter. - The type of the custom attributes. - - - Gets a value that indicates whether the parameter is optional. - true if the parameter is optional; otherwise false. - - - Gets or sets the parameter information. - The parameter information. - - - Gets the name of the parameter. - The name of the parameter. - - - Gets the type of the parameter. - The type of the parameter. - - - Represents a converter for actions with a return type of . - - - Initializes a new instance of the class. - - - Converts a object to another object. - The converted object. - The controller context. - The action result. - - - An abstract class that provides a container for services used by ASP.NET Web API. - - - Initializes a new instance of the class. - - - Adds a service to the end of services list for the given service type. - The service type. - The service instance. - - - Adds the services of the specified collection to the end of the services list for the given service type. - The service type. - The services to add. - - - Removes all the service instances of the given service type. - The service type to clear from the services list. - - - Removes all instances of a multi-instance service type. - The service type to remove. - - - Removes a single-instance service type. - The service type to remove. - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - Searches for a service that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence. - The zero-based index of the first occurrence, if found; otherwise, -1. - The service type. - The delegate that defines the conditions of the element to search for. - - - Gets a service instance of a specified type. - The service type. - - - Gets a mutable list of service instances of a specified type. - A mutable list of service instances. - The service type. - - - Gets a collection of service instanes of a specified type. - A collection of service instances. - The service type. - - - Inserts a service into the collection at the specified index. - The service type. - The zero-based index at which the service should be inserted. If is passed, ensures the element is added to the end. - The service to insert. - - - Inserts the elements of the collection into the service list at the specified index. - The service type. - The zero-based index at which the new elements should be inserted. If is passed, ensures the elements are added to the end. - The collection of services to insert. - - - Determine whether the service type should be fetched with GetService or GetServices. - true iff the service is singular. - type of service to query - - - Removes the first occurrence of the given service from the service list for the given service type. - true if the item is successfully removed; otherwise, false. - The service type. - The service instance to remove. - - - Removes all the elements that match the conditions defined by the specified predicate. - The number of elements removed from the list. - The service type. - The delegate that defines the conditions of the elements to remove. - - - Removes the service at the specified index. - The service type. - The zero-based index of the service to remove. - - - Replaces all existing services for the given service type with the given service instance. This works for both singular and plural services. - The service type. - The service instance. - - - Replaces all instances of a multi-instance service with a new instance. - The type of service. - The service instance that will replace the current services of this type. - - - Replaces all existing services for the given service type with the given service instances. - The service type. - The service instances. - - - Replaces a single-instance service of a specified type. - The service type. - The service instance. - - - Removes the cached values for a single service type. - The service type. - - - A converter for creating responses from actions that return an arbitrary value. - The declared return type of an action. - - - Initializes a new instance of the class. - - - Converts the result of an action with arbitrary return type to an instance of . - The newly created object. - The action controller context. - The execution result. - - - Represents a converter for creating a response from actions that do not return a value. - - - Initializes a new instance of the class. - - - Converts the created response from actions that do not return a value. - The converted response. - The context of the controller. - The result of the action. - - - Represents a dependency injection container. - - - Starts a resolution scope. - The dependency scope. - - - Represents an interface for the range of the dependencies. - - - Retrieves a service from the scope. - The retrieved service. - The service to be retrieved. - - - Retrieves a collection of services from the scope. - The retrieved collection of services. - The collection of services to be retrieved. - - - Describes an API defined by relative URI path and HTTP method. - - - Initializes a new instance of the class. - - - Gets or sets the action descriptor that will handle the API. - The action descriptor. - - - Gets or sets the documentation of the API. - The documentation. - - - Gets or sets the HTTP method. - The HTTP method. - - - Gets the ID. The ID is unique within . - The ID. - - - Gets the parameter descriptions. - The parameter descriptions. - - - Gets or sets the relative path. - The relative path. - - - Gets or sets the response description. - The response description. - - - Gets or sets the registered route for the API. - The route. - - - Gets the supported request body formatters. - The supported request body formatters. - - - Gets the supported response formatters. - The supported response formatters. - - - Explores the URI space of the service based on routes, controllers and actions available in the system. - - - Initializes a new instance of the class. - The configuration. - - - Gets the API descriptions. The descriptions are initialized on the first access. - - - Gets or sets the documentation provider. The provider will be responsible for documenting the API. - The documentation provider. - - - Gets a collection of HttpMethods supported by the action. Called when initializing the . - A collection of HttpMethods supported by the action. - The route. - The action descriptor. - - - Determines whether the action should be considered for generation. Called when initializing the . - true if the action should be considered for generation, false otherwise. - The action variable value from the route. - The action descriptor. - The route. - - - Determines whether the controller should be considered for generation. Called when initializing the . - true if the controller should be considered for generation, false otherwise. - The controller variable value from the route. - The controller descriptor. - The route. - - - This attribute can be used on the controllers and actions to influence the behavior of . - - - Initializes a new instance of the class. - - - Gets or sets a value indicating whether to exclude the controller or action from the instances generated by . - true if the controller or action should be ignored; otherwise, false. - - - Describes a parameter on the API defined by relative URI path and HTTP method. - - - Initializes a new instance of the class. - - - Gets or sets the documentation. - The documentation. - - - Gets or sets the name. - The name. - - - Gets or sets the parameter descriptor. - The parameter descriptor. - - - Gets or sets the source of the parameter. It may come from the request URI, request body or other places. - The source. - - - Describes where the parameter come from. - - - The parameter come from Body. - - - The parameter come from Uri. - - - The location is unknown. - - - Defines the interface for getting a collection of . - - - Gets the API descriptions. - - - Defines the provider responsible for documenting the service. - - - Gets the documentation based on . - The documentation for the controller. - The action descriptor. - - - - Gets the documentation based on . - The documentation for the controller. - The parameter descriptor. - - - - Describes the API response. - - - Initializes a new instance of the class. - - - Gets or sets the declared response type. - The declared response type. - - - Gets or sets the response documentation. - The response documentation. - - - Gets or sets the actual response type. - The actual response type. - - - Use this to specify the entity type returned by an action when the declared return type is or . The will be read by when generating . - - - Initializes a new instance of the class. - The response type. - - - Gets the response type. - - - Provides an implementation of with no external dependencies. - - - Initializes a new instance of the class. - - - Returns a list of assemblies available for the application. - A <see cref="T:System.Collections.ObjectModel.Collection`1" /> of assemblies. - - - Represents a default implementation of an . A different implementation can be registered via the . We optimize for the case where we have an instance per instance but can support cases where there are many instances for one as well. In the latter case the lookup is slightly slower because it goes through the dictionary. - - - Initializes a new instance of the class. - - - Creates the specified by using the given . - An instance of type . - The request message. - The controller descriptor. - The type of the controller. - - - Represents a default instance for choosing a given a . A different implementation can be registered via the . - - - Initializes a new instance of the class. - The configuration. - - - Specifies the suffix string in the controller name. - - - Returns a map, keyed by controller string, of all that the selector can select. - A map of all that the selector can select, or null if the selector does not have a well-defined mapping of . - - - Gets the name of the controller for the specified . - The name of the controller for the specified . - The HTTP request message. - - - Selects a for the given . - The instance for the given . - The HTTP request message. - - - Provides an implementation of with no external dependencies. - - - Initializes a new instance of the class. - - - Initializes a new instance using a predicate to filter controller types. - The predicate. - - - Returns a list of controllers available for the application. - An <see cref="T:System.Collections.Generic.ICollection`1" /> of controllers. - The assemblies resolver. - - - Gets a value whether the resolver type is a controller type predicate. - true if the resolver type is a controller type predicate; otherwise, false. - - - Dispatches an incoming to an implementation for processing. - - - Initializes a new instance of the class with the specified configuration. - The http configuration. - - - Gets the HTTP configuration. - The HTTP configuration. - - - Dispatches an incoming to an . - A representing the ongoing operation. - The request to dispatch - The cancellation token. - - - This class is the default endpoint message handler which examines the of the matched route, and chooses which message handler to call. If is null, then it delegates to . - - - Initializes a new instance of the class, using the provided and as the default handler. - The server configuration. - - - Initializes a new instance of the class, using the provided and . - The server configuration. - The default handler to use when the has no . - - - Sends an HTTP request as an asynchronous operation. - The task object representing the asynchronous operation. - The HTTP request message to send. - The cancellation token to cancel operation. - - - Provides an abstraction for managing the assemblies of an application. A different implementation can be registered via the . - - - Returns a list of assemblies available for the application. - An <see cref="T:System.Collections.Generic.ICollection`1" /> of assemblies. - - - Defines the methods that are required for an . - - - Creates an object. - An object. - The message request. - The HTTP controller descriptor. - The type of the controller. - - - Defines the methods that are required for an factory. - - - Returns a map, keyed by controller string, of all that the selector can select. This is primarily called by to discover all the possible controllers in the system. - A map of all that the selector can select, or null if the selector does not have a well-defined mapping of . - - - Selects a for the given . - An instance. - The request message. - - - Provides an abstraction for managing the controller types of an application. A different implementation can be registered via the DependencyResolver. - - - Returns a list of controllers available for the application. - An <see cref="T:System.Collections.Generic.ICollection`1" /> of controllers. - The resolver for failed assemblies. - - - Provides the catch blocks used within this assembly. - - - Gets the catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpBatchHandler.SendAsync. - The catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpBatchHandler.SendAsync. - - - Gets the catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpControllerDispatcher.SendAsync. - The catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpControllerDispatcher.SendAsync. - - - Gets the catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpServer.SendAsync. - The catch block in System.Web.Http.ExceptionHandling.ExceptionCatchBlocks.HttpServer.SendAsync. - - - Gets the catch block in System.Web.Http.ApiController.ExecuteAsync when using . - The catch block in System.Web.Http.ApiController.ExecuteAsync when using . - - - Represents an exception and the contextual data associated with it when it was caught. - - - Initializes a new instance of the class. - The caught exception. - The catch block where the exception was caught. - - - Initializes a new instance of the class. - The caught exception. - The catch block where the exception was caught. - The request being processed when the exception was caught. - - - Initializes a new instance of the class. - The caught exception. - The catch block where the exception was caught. - The request being processed when the exception was caught. - The repsonse being returned when the exception was caught. - - - Initializes a new instance of the class. - The caught exception. - The catch block where the exception was caught. - The action context in which the exception occurred. - - - Gets the action context in which the exception occurred, if available. - The action context in which the exception occurred, if available. - - - Gets the catch block in which the exception was caught. - The catch block in which the exception was caught. - - - Gets the controller context in which the exception occurred, if available. - The controller context in which the exception occurred, if available. - - - Gets the caught exception. - The caught exception. - - - Gets the request being processed when the exception was caught. - The request being processed when the exception was caught. - - - Gets the request context in which the exception occurred. - The request context in which the exception occurred. - - - Gets the response being sent when the exception was caught. - The response being sent when the exception was caught. - - - Represents the catch block location for an exception context. - - - Initializes a new instance of the class. - The label for the catch block where the exception was caught. - A value indicating whether the catch block where the exception was caught is the last one before the host. - A value indicating whether exceptions in the catch block can be handled after they are logged. - - - Gets a value indicating whether exceptions in the catch block can be handled after they are logged. - A value indicating whether exceptions in the catch block can be handled after they are logged. - - - Gets a value indicating whether the catch block where the exception was caught is the last one before the host. - A value indicating whether the catch block where the exception was caught is the last one before the host. - - - Gets a label for the catch block in which the exception was caught. - A label for the catch block in which the exception was caught. - - - Returns . - - - Represents an unhandled exception handler. - - - Initializes a new instance of the class. - - - When overridden in a derived class, handles the exception synchronously. - The exception handler context. - - - When overridden in a derived class, handles the exception asynchronously. - A task representing the asynchronous exception handling operation. - The exception handler context. - The token to monitor for cancellation requests. - - - Determines whether the exception should be handled. - true if the exception should be handled; otherwise, false. - The exception handler context. - - - Returns . - - - Represents the context within which unhandled exception handling occurs. - - - Initializes a new instance of the class. - The exception context. - - - Gets the catch block in which the exception was caught. - The catch block in which the exception was caught. - - - Gets the caught exception. - The caught exception. - - - Gets the exception context providing the exception and related data. - The exception context providing the exception and related data. - - - Gets the request being processed when the exception was caught. - The request being processed when the exception was caught. - - - Gets the request context in which the exception occurred. - The request context in which the exception occurred. - - - Gets or sets the result providing the response message when the exception is handled. - The result providing the response message when the exception is handled. - - - Provides extension methods for . - - - Calls an exception handler and determines the response handling it, if any. - A task that, when completed, contains the response message to return when the exception is handled, or null when the exception remains unhandled. - The unhandled exception handler. - The exception context. - The token to monitor for cancellation requests. - - - Represents an unhandled exception logger. - - - Initializes a new instance of the class. - - - When overridden in a derived class, logs the exception synchronously. - The exception logger context. - - - When overridden in a derived class, logs the exception asynchronously. - A task representing the asynchronous exception logging operation. - The exception logger context. - The token to monitor for cancellation requests. - - - Determines whether the exception should be logged. - true if the exception should be logged; otherwise, false. - The exception logger context. - - - Returns . - - - Represents the context within which unhandled exception logging occurs. - - - Initializes a new instance of the class. - The exception context. - - - Gets or sets a value indicating whether the exception can subsequently be handled by an to produce a new response message. - A value indicating whether the exception can subsequently be handled by an to produce a new response message. - - - Gets the catch block in which the exception was caught. - The catch block in which the exception was caught. - - - Gets the caught exception. - The caught exception. - - - Gets the exception context providing the exception and related data. - The exception context providing the exception and related data. - - - Gets the request being processed when the exception was caught. - The request being processed when the exception was caught. - - - Gets the request context in which the exception occurred. - The request context in which the exception occurred. - - - Provides extension methods for . - - - Calls an exception logger. - A task representing the asynchronous exception logging operation. - The unhandled exception logger. - The exception context. - The token to monitor for cancellation requests. - - - Creates exception services to call logging and handling from catch blocks. - - - Gets an exception handler that calls the registered handler service, if any, and ensures exceptions do not accidentally propagate to the host. - An exception handler that calls any registered handler and ensures exceptions do not accidentally propagate to the host. - The services container. - - - Gets an exception handler that calls the registered handler service, if any, and ensures exceptions do not accidentally propagate to the host. - An exception handler that calls any registered handler and ensures exceptions do not accidentally propagate to the host. - The configuration. - - - Gets an exception logger that calls all registered logger services. - A composite logger. - The services container. - - - Gets an exception logger that calls all registered logger services. - A composite logger. - The configuration. - - - Defines an unhandled exception handler. - - - Process an unhandled exception, either allowing it to propagate or handling it by providing a response message to return instead. - A task representing the asynchronous exception handling operation. - The exception handler context. - The token to monitor for cancellation requests. - - - Defines an unhandled exception logger. - - - Logs an unhandled exception. - A task representing the asynchronous exception logging operation. - The exception logger context. - The token to monitor for cancellation requests. - - - Provides information about an action method, such as its name, controller, parameters, attributes, and filters. - - - Initializes a new instance of the class. - - - Returns the filters that are associated with this action method. - The filters that are associated with this action method. - The configuration. - The action descriptor. - - - Represents the base class for all action-filter attributes. - - - Initializes a new instance of the class. - - - Occurs after the action method is invoked. - The action executed context. - - - - Occurs before the action method is invoked. - The action context. - - - - Executes the filter action asynchronously. - The newly created task for this operation. - The action context. - The cancellation token assigned for this task. - The delegate function to continue after the action method is invoked. - - - Provides details for authorization filter. - - - Initializes a new instance of the class. - - - Calls when a process requests authorization. - The action context, which encapsulates information for using . - - - - Executes the authorization filter during synchronization. - The authorization filter during synchronization. - The action context, which encapsulates information for using . - The cancellation token that cancels the operation. - A continuation of the operation. - - - Represents the configuration filter provider. - - - Initializes a new instance of the class. - - - Returns the filters that are associated with this configuration method. - The filters that are associated with this configuration method. - The configuration. - The action descriptor. - - - Represents the attributes for the exception filter. - - - Initializes a new instance of the class. - - - Raises the exception event. - The context for the action. - - - - Asynchronously executes the exception filter. - The result of the execution. - The context for the action. - The cancellation context. - - - Represents the base class for action-filter attributes. - - - Initializes a new instance of the class. - - - Gets a value that indicates whether multiple filters are allowed. - true if multiple filters are allowed; otherwise, false. - - - Provides information about the available action filters. - - - Initializes a new instance of the class. - The instance of this class. - The scope of this class. - - - Gets or sets an instance of the . - A . - - - Gets or sets the scope . - The scope of the FilterInfo. - - - Defines values that specify the order in which filters run within the same filter type and filter order. - - - Specifies an order after Controller. - - - Specifies an order before Action and after Global. - - - Specifies an action before Controller. - - - Represents the action of the HTTP executed context. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The action context. - The exception. - - - Gets or sets the HTTP action context. - The HTTP action context. - - - Gets or sets the exception that was raised during the execution. - The exception that was raised during the execution. - - - Gets the object for the context. - The object for the context. - - - Gets or sets the for the context. - The for the context. - - - Represents an authentication challenge context containing information for executing an authentication challenge. - - - Initializes a new instance of the class. - The action context. - The current action result. - - - Gets the action context. - - - Gets the request message. - - - Gets or sets the action result to execute. - - - Represents an authentication context containing information for performing authentication. - - - Initializes a new instance of the class. - The action context. - The current principal. - - - Gets the action context. - The action context. - - - Gets or sets an action result that will produce an error response (if authentication failed; otherwise, null). - An action result that will produce an error response. - - - Gets or sets the authenticated principal. - The authenticated principal. - - - Gets the request message. - The request message. - - - Represents a collection of HTTP filters. - - - Initializes a new instance of the class. - - - Adds an item at the end of the collection. - The item to add to the collection. - - - - Removes all item in the collection. - - - Determines whether the collection contains the specified item. - true if the collection contains the specified item; otherwise, false. - The item to check. - - - Gets the number of elements in the collection. - The number of elements in the collection. - - - Gets an enumerator that iterates through the collection. - An enumerator object that can be used to iterate through the collection. - - - Removes the specified item from the collection. - The item to remove in the collection. - - - Gets an enumerator that iterates through the collection. - An enumerator object that can be used to iterate through the collection. - - - Defines the methods that are used in an action filter. - - - Executes the filter action asynchronously. - The newly created task for this operation. - The action context. - The cancellation token assigned for this task. - The delegate function to continue after the action method is invoked. - - - Defines a filter that performs authentication. - - - Authenticates the request. - A Task that will perform authentication. - The authentication context. - The token to monitor for cancellation requests. - - - - Defines the methods that are required for an authorization filter. - - - Executes the authorization filter to synchronize. - The authorization filter to synchronize. - The action context. - The cancellation token associated with the filter. - The continuation. - - - Defines the methods that are required for an exception filter. - - - Executes an asynchronous exception filter. - An asynchronous exception filter. - The action executed context. - The cancellation token. - - - Defines the methods that are used in a filter. - - - Gets or sets a value indicating whether more than one instance of the indicated attribute can be specified for a single program element. - true if more than one instance is allowed to be specified; otherwise, false. The default is false. - - - Provides filter information. - - - Returns an enumeration of filters. - An enumeration of filters. - The HTTP configuration. - The action descriptor. - - - - - Provides common keys for properties stored in the - - - Provides a key for the client certificate for this request. - - - Provides a key for the associated with this request. - - - Provides a key for the collection of resources that should be disposed when a request is disposed. - - - Provides a key for the associated with this request. - - - Provides a key for the associated with this request. - - - Provides a key for the associated with this request. - - - Provides a key that indicates whether error details are to be included in the response for this HTTP request. - - - Provides a key that indicates whether the request is a batch request. - - - Provides a key that indicates whether the request originates from a local address. - - - Provides a key that indicates whether the request failed to match a route. - - - Provides a key for the for this request. - - - Provides a key for the stored in . This is the correlation ID for that request. - - - Provides a key for the parsed query string stored in . - - - Provides a key for a delegate which can retrieve the client certificate for this request. - - - Provides a key for the current stored in Properties(). If Current() is null then no context is stored. - - - Interface for controlling the use of buffering requests and responses in the host. If a host provides support for buffering requests and/or responses then it can use this interface to determine the policy for when buffering is to be used. - - - Determines whether the host should buffer the entity body. - true if buffering should be used; otherwise a streamed request should be used. - The host context. - - - Determines whether the host should buffer the entity body. - true if buffering should be used; otherwise a streamed response should be used. - The HTTP response message. - - - Represents a message handler that suppresses host authentication results. - - - Initializes a new instance of the class. - - - Asynchronously sends a request message. - That task that completes the asynchronous operation. - The request message to send. - The cancellation token. - - - Represents the metadata class of the ModelMetadata. - - - Initializes a new instance of the class. - The provider. - The type of the container. - The model accessor. - The type of the model. - The name of the property. - - - Gets a dictionary that contains additional metadata about the model. - A dictionary that contains additional metadata about the model. - - - Gets or sets the type of the container for the model. - The type of the container for the model. - - - Gets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null. - true if empty strings that are posted back in forms should be converted to null; otherwise, false. The default value is true. - - - Gets or sets the description of the model. - The description of the model. The default value is null. - - - Gets the display name for the model. - The display name for the model. - - - Gets a list of validators for the model. - A list of validators for the model. - The validator providers for the model. - - - Gets or sets a value that indicates whether the model is a complex type. - A value that indicates whether the model is considered a complex. - - - Gets a value that indicates whether the type is nullable. - true if the type is nullable; otherwise, false. - - - Gets or sets a value that indicates whether the model is read-only. - true if the model is read-only; otherwise, false. - - - Gets the value of the model. - The model value can be null. - - - Gets the type of the model. - The type of the model. - - - Gets a collection of model metadata objects that describe the properties of the model. - A collection of model metadata objects that describe the properties of the model. - - - Gets the property name. - The property name. - - - Gets or sets the provider. - The provider. - - - Provides an abstract base class for a custom metadata provider. - - - Initializes a new instance of the class. - - - Gets a ModelMetadata object for each property of a model. - A ModelMetadata object for each property of a model. - The container. - The type of the container. - - - Gets a metadata for the specified property. - The metadata model for the specified property. - The model accessor. - The type of the container. - The property to get the metadata model for. - - - Gets the metadata for the specified model accessor and model type. - The metadata. - The model accessor. - The type of the mode. - - - Provides an abstract class to implement a metadata provider. - The type of the model metadata. - - - Initializes a new instance of the class. - - - When overridden in a derived class, creates the model metadata for the property using the specified prototype. - The model metadata for the property. - The prototype from which to create the model metadata. - The model accessor. - - - When overridden in a derived class, creates the model metadata for the property. - The model metadata for the property. - The set of attributes. - The type of the container. - The type of the model. - The name of the property. - - - Retrieves a list of properties for the model. - A list of properties for the model. - The model container. - The type of the container. - - - Retrieves the metadata for the specified property using the container type and property name. - The metadata for the specified property. - The model accessor. - The type of the container. - The name of the property. - - - Returns the metadata for the specified property using the type of the model. - The metadata for the specified property. - The model accessor. - The type of the container. - - - Provides prototype cache data for . - - - Initializes a new instance of the class. - The attributes that provides data for the initialization. - - - Gets or sets the metadata display attribute. - The metadata display attribute. - - - Gets or sets the metadata display format attribute. - The metadata display format attribute. - - - - Gets or sets the metadata editable attribute. - The metadata editable attribute. - - - Gets or sets the metadata read-only attribute. - The metadata read-only attribute. - - - Provides a container for common metadata, for the class, for a data model. - - - Initializes a new instance of the class. - The prototype used to initialize the model metadata. - The model accessor. - - - Initializes a new instance of the class. - The metadata provider. - The type of the container. - The type of the model. - The name of the property. - The attributes that provides data for the initialization. - - - Retrieves a value that indicates whether empty strings that are posted back in forms should be converted to null. - true if empty strings that are posted back in forms should be converted to null; otherwise, false. - - - Retrieves the description of the model. - The description of the model. - - - Retrieves a value that indicates whether the model is read-only. - true if the model is read-only; otherwise, false. - - - - Provides prototype cache data for the . - The type of prototype cache. - - - Initializes a new instance of the class. - The prototype. - The model accessor. - - - Initializes a new instance of the class. - The provider. - The type of container. - The type of the model. - The name of the property. - The prototype cache. - - - Indicates whether empty strings that are posted back in forms should be computed and converted to null. - true if empty strings that are posted back in forms should be computed and converted to null; otherwise, false. - - - Indicates the computation value. - The computation value. - - - Gets a value that indicates whether the model is a complex type. - A value that indicates whether the model is considered a complex type by the Web API framework. - - - Gets a value that indicates whether the model to be computed is read-only. - true if the model to be computed is read-only; otherwise, false. - - - Gets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null. - true if empty strings that are posted back in forms should be converted to null; otherwise, false. The default value is true. - - - Gets or sets the description of the model. - The description of the model. - - - Gets a value that indicates whether the model is a complex type. - A value that indicates whether the model is considered a complex type by the Web API framework. - - - Gets or sets a value that indicates whether the model is read-only. - true if the model is read-only; otherwise, false. - - - Gets or sets a value that indicates whether the prototype cache is updating. - true if the prototype cache is updating; otherwise, false. - - - Implements the default model metadata provider. - - - Initializes a new instance of the class. - - - Creates the metadata from prototype for the specified property. - The metadata for the property. - The prototype. - The model accessor. - - - Creates the metadata for the specified property. - The metadata for the property. - The attributes. - The type of the container. - The type of the model. - The name of the property. - - - Represents an empty model metadata provider. - - - Initializes a new instance of the class. - - - Creates metadata from prototype. - The metadata. - The model metadata prototype. - The model accessor. - - - Creates a prototype of the metadata provider of the . - A prototype of the metadata provider. - The attributes. - The type of container. - The type of model. - The name of the property. - - - Represents the binding directly to the cancellation token. - - - Initializes a new instance of the class. - The binding descriptor. - - - Executes the binding during synchronization. - The binding during synchronization. - The metadata provider. - The action context. - The notification after the cancellation of the operations. - - - Represents an attribute that invokes a custom model binder. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - A reference to an object that implements the interface. - - - Represents the default action value of the binder. - - - Initializes a new instance of the class. - - - Default implementation of the interface. This interface is the primary entry point for binding action parameters. - The associated with the . - The action descriptor. - - - Gets the associated with the . - The associated with the . - The parameter descriptor. - - - Defines a binding error. - - - Initializes a new instance of the class. - The error descriptor. - The message. - - - Gets the error message. - The error message. - - - Executes the binding method during synchronization. - The metadata provider. - The action context. - The cancellation Token value. - - - Represents parameter binding that will read from the body and invoke the formatters. - - - Initializes a new instance of the class. - The descriptor. - The formatter. - The body model validator. - - - Gets or sets an interface for the body model validator. - An interface for the body model validator. - - - Gets the error message. - The error message. - - - Asynchronously execute the binding of . - The result of the action. - The metadata provider. - The context associated with the action. - The cancellation token. - - - Gets or sets an enumerable object that represents the formatter for the parameter binding. - An enumerable object that represents the formatter for the parameter binding. - - - Asynchronously reads the content of . - The result of the action. - The request. - The type. - The formatter. - The format logger. - - - - Gets whether the will read body. - True if the will read body; otherwise, false. - - - Represents the extensions for the collection of form data. - - - Reads the collection extensions with specified type. - The read collection extensions. - The form data. - The generic type. - - - Reads the collection extensions with specified type. - The collection extensions. - The form data. - The name of the model. - The required member selector. - The formatter logger. - The generic type. - - - - - - Reads the collection extensions with specified type. - The collection extensions with specified type. - The form data. - The type of the object. - - - Reads the collection extensions with specified type and model name. - The collection extensions. - The form data. - The type of the object. - The name of the model. - The required member selector. - The formatter logger. - - - Deserialize the form data to the given type, using model binding. - best attempt to bind the object. The best attempt may be null. - collection with parsed form url data - target type to read as - null or empty to read the entire form as a single object. This is common for body data. Or the name of a model to do a partial binding against the form data. This is common for extracting individual fields. - The used to determine required members. - The to log events to. - The configuration to pick binder from. Can be null if the config was not created already. In that case a new config is created. - - - - - - - - Enumerates the behavior of the HTTP binding. - - - Never use HTTP binding. - - - The optional binding behavior - - - HTTP binding is required. - - - Provides a base class for model-binding behavior attributes. - - - Initializes a new instance of the class. - The behavior. - - - Gets or sets the behavior category. - The behavior category. - - - Gets the unique identifier for this attribute. - The id for this attribute. - - - Parameter binds to the request. - - - Initializes a new instance of the class. - The parameter descriptor. - - - Asynchronously executes parameter binding. - The binded parameter. - The metadata provider. - The action context. - The cancellation token. - - - Defines the methods that are required for a model binder. - - - Binds the model to a value by using the specified controller context and binding context. - true if model binding is successful; otherwise, false. - The action context. - The binding context. - - - Represents a value provider for parameter binding. - - - Gets the instances used by this parameter binding. - The instances used by this parameter binding. - - - Represents the class for handling HTML form URL-ended data, also known as application/x-www-form-urlencoded. - - - Initializes a new instance of the class. - - - - Determines whether this can read objects of the specified . - true if objects of this type can be read; otherwise false. - The type of object that will be read. - - - Reads an object of the specified from the specified stream. This method is called during deserialization. - A whose result will be the object instance that has been read. - The type of object to read. - The from which to read. - The content being read. - The to log events to. - - - Specify this parameter uses a model binder. This can optionally specify the specific model binder and value providers that drive that model binder. Derived attributes may provide convenience settings for the model binder or value provider. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The type of model binder. - - - Gets or sets the type of model binder. - The type of model binder. - - - Gets the binding for a parameter. - The that contains the binding. - The parameter to bind. - - - Get the IModelBinder for this type. - a non-null model binder. - The configuration. - model type that the binder is expected to bind. - - - Gets the model binder provider. - The instance. - The configuration object. - - - Gets the value providers that will be fed to the model binder. - A collection of instances. - The configuration object. - - - Gets or sets the name to consider as the parameter name during model binding. - The parameter name to consider. - - - Gets or sets a value that specifies whether the prefix check should be suppressed. - true if the prefix check should be suppressed; otherwise, false. - - - Provides a container for model-binder configuration. - - - Gets or sets the name of the resource file (class key) that contains localized string values. - The name of the resource file (class key). - - - Gets or sets the current provider for type-conversion error message. - The current provider for type-conversion error message. - - - Gets or sets the current provider for value-required error messages. - The error message provider. - - - Provides a container for model-binder error message provider. - - - Describes a parameter that gets bound via ModelBinding. - - - Initializes a new instance of the class. - The parameter descriptor. - The model binder. - The collection of value provider factory. - - - Gets the model binder. - The model binder. - - - Asynchronously executes the parameter binding via the model binder. - The task that is signaled when the binding is complete. - The metadata provider to use for validation. - The action context for the binding. - The cancellation token assigned for this task for cancelling the binding operation. - - - Gets the collection of value provider factory. - The collection of value provider factory. - - - Provides an abstract base class for model binder providers. - - - Initializes a new instance of the class. - - - Finds a binder for the given type. - A binder, which can attempt to bind this type. Or null if the binder knows statically that it will never be able to bind the type. - A configuration object. - The type of the model to bind against. - - - Provides the context in which a model binder functions. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The binding context. - - - Gets or sets a value that indicates whether the binder should use an empty prefix. - true if the binder should use an empty prefix; otherwise, false. - - - Gets or sets the model. - The model. - - - Gets or sets the model metadata. - The model metadata. - - - Gets or sets the name of the model. - The name of the model. - - - Gets or sets the state of the model. - The state of the model. - - - Gets or sets the type of the model. - The type of the model. - - - Gets the property metadata. - The property metadata. - - - Gets or sets the validation node. - The validation node. - - - Gets or sets the value provider. - The value provider. - - - Represents an error that occurs during model binding. - - - Initializes a new instance of the class by using the specified exception. - The exception. - - - Initializes a new instance of the class by using the specified exception and error message. - The exception. - The error message - - - Initializes a new instance of the class by using the specified error message. - The error message - - - Gets or sets the error message. - The error message. - - - Gets or sets the exception object. - The exception object. - - - Represents a collection of instances. - - - Initializes a new instance of the class. - - - Adds the specified Exception object to the model-error collection. - The exception. - - - Adds the specified error message to the model-error collection. - The error message. - - - Encapsulates the state of model binding to a property of an action-method argument, or to the argument itself. - - - Initializes a new instance of the class. - - - Gets a object that contains any errors that occurred during model binding. - The model state errors. - - - Gets a object that encapsulates the value that was being bound during model binding. - The model state value. - - - Represents the state of an attempt to bind a posted form to an action method, which includes validation information. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using values that are copied from the specified model-state dictionary. - The dictionary. - - - Adds the specified item to the model-state dictionary. - The object to add to the model-state dictionary. - - - Adds an element that has the specified key and value to the model-state dictionary. - The key of the element to add. - The value of the element to add. - - - Adds the specified model error to the errors collection for the model-state dictionary that is associated with the specified key. - The key. - The exception. - - - Adds the specified error message to the errors collection for the model-state dictionary that is associated with the specified key. - The key. - The error message. - - - Removes all items from the model-state dictionary. - - - Determines whether the model-state dictionary contains a specific value. - true if item is found in the model-state dictionary; otherwise, false. - The object to locate in the model-state dictionary. - - - Determines whether the model-state dictionary contains the specified key. - true if the model-state dictionary contains the specified key; otherwise, false. - The key to locate in the model-state dictionary. - - - Copies the elements of the model-state dictionary to an array, starting at a specified index. - The array. The array must have zero-based indexing. - The zero-based index in array at which copying starts. - - - Gets the number of key/value pairs in the collection. - The number of key/value pairs in the collection. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets a value that indicates whether this instance of the model-state dictionary is valid. - true if this instance is valid; otherwise, false. - - - Determines whether there are any objects that are associated with or prefixed with the specified key. - true if the model-state dictionary contains a value that is associated with the specified key; otherwise, false. - The key. - - - Gets or sets the value that is associated with the specified key. - The model state item. - The key. - - - Gets a collection that contains the keys in the dictionary. - A collection that contains the keys of the model-state dictionary. - - - Copies the values from the specified object into this dictionary, overwriting existing values if keys are the same. - The dictionary. - - - Removes the first occurrence of the specified object from the model-state dictionary. - true if item was successfully removed the model-state dictionary; otherwise, false. This method also returns false if item is not found in the model-state dictionary. - The object to remove from the model-state dictionary. - - - Removes the element that has the specified key from the model-state dictionary. - true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the model-state dictionary. - The key of the element to remove. - - - Sets the value for the specified key by using the specified value provider dictionary. - The key. - The value. - - - Returns an enumerator that iterates through a collection. - An IEnumerator object that can be used to iterate through the collection. - - - Attempts to gets the value that is associated with the specified key. - true if the object contains an element that has the specified key; otherwise, false. - The key of the value to get. - The value associated with the specified key. - - - Gets a collection that contains the values in the dictionary. - A collection that contains the values of the model-state dictionary. - - - Collection of functions that can produce a parameter binding for a given parameter. - - - Initializes a new instance of the class. - - - Adds function to the end of the collection. The function added is a wrapper around funcInner that checks that parameterType matches typeMatch. - type to match against HttpParameterDescriptor.ParameterType - inner function that is invoked if type match succeeds - - - Insert a function at the specified index in the collection. /// The function added is a wrapper around funcInner that checks that parameterType matches typeMatch. - index to insert at. - type to match against HttpParameterDescriptor.ParameterType - inner function that is invoked if type match succeeds - - - Execute each binding function in order until one of them returns a non-null binding. - the first non-null binding produced for the parameter. Of null if no binding is produced. - parameter to bind. - - - Maps a browser request to an array. - The type of the array. - - - Initializes a new instance of the class. - - - Indicates whether the model is binded. - true if the specified model is binded; otherwise, false. - The action context. - The binding context. - - - Converts the collection to an array. - true in all cases. - The action context. - The binding context. - The new collection. - - - Provides a model binder for arrays. - - - Initializes a new instance of the class. - - - Returns a model binder for arrays. - A model binder object or null if the attempt to get a model binder is unsuccessful. - The configuration. - The type of model. - - - Maps a browser request to a collection. - The type of the collection. - - - Initializes a new instance of the class. - - - Binds the model by using the specified execution context and binding context. - true if model binding is successful; otherwise, false. - The action context. - The binding context. - - - Provides a way for derived classes to manipulate the collection before returning it from the binder. - true in all cases. - The action context. - The binding context. - The new collection. - - - Provides a model binder for a collection. - - - Initializes a new instance of the class. - - - Retrieves a model binder for a collection. - The model binder. - The configuration of the model. - The type of the model. - - - Represents a data transfer object (DTO) for a complex model. - - - Initializes a new instance of the class. - The model metadata. - The collection of property metadata. - - - Gets or sets the model metadata of the . - The model metadata of the . - - - Gets or sets the collection of property metadata of the . - The collection of property metadata of the . - - - Gets or sets the results of the . - The results of the . - - - Represents a model binder for object. - - - Initializes a new instance of the class. - - - Determines whether the specified model is binded. - true if the specified model is binded; otherwise, false. - The action context. - The binding context. - - - Represents a complex model that invokes a model binder provider. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - The model binder. - The configuration. - The type of the model to retrieve. - - - Represents the result for object. - - - Initializes a new instance of the class. - The object model. - The validation node. - - - Gets or sets the model for this object. - The model for this object. - - - Gets or sets the for this object. - The for this object. - - - Represents an that delegates to one of a collection of instances. - - - Initializes a new instance of the class. - An enumeration of binders. - - - Initializes a new instance of the class. - An array of binders. - - - Indicates whether the specified model is binded. - true if the model is binded; otherwise, false. - The action context. - The binding context. - - - Represents the class for composite model binder providers. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - A collection of - - - Gets the binder for the model. - The binder for the model. - The binder configuration. - The type of the model. - - - Gets the providers for the composite model binder. - The collection of providers. - - - Maps a browser request to a dictionary data object. - The type of the key. - The type of the value. - - - Initializes a new instance of the class. - - - Converts the collection to a dictionary. - true in all cases. - The action context. - The binding context. - The new collection. - - - Provides a model binder for a dictionary. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - The associated model binder. - The configuration to use. - The type of model. - - - Maps a browser request to a key/value pair data object. - The type of the key. - The type of the value. - - - Initializes a new instance of the class. - - - Binds the model by using the specified execution context and binding context. - true if model binding is successful; otherwise, false. - The action context. - The binding context. - - - Provides a model binder for a collection of key/value pairs. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - The associated model binder. - The configuration. - The type of model. - - - Maps a browser request to a mutable data object. - - - Initializes a new instance of the class. - - - Binds the model by using the specified action context and binding context. - true if binding is successful; otherwise, false. - The action context. - The binding context. - - - Retrieves a value that indicates whether a property can be updated. - true if the property can be updated; otherwise, false. - The metadata for the property to be evaluated. - - - Creates an instance of the model. - The newly created model object. - The action context. - The binding context. - - - Creates a model instance if an instance does not yet exist in the binding context. - The action context. - The binding context. - - - Retrieves metadata for properties of the model. - The metadata for properties of the model. - The action context. - The binding context. - - - Sets the value of a specified property. - The action context. - The binding context. - The metadata for the property to set. - The validation information about the property. - The validator for the model. - - - Provides a model binder for mutable objects. - - - Initializes a new instance of the class. - - - Retrieves the model binder for the specified type. - The model binder. - The configuration. - The type of the model to retrieve. - - - Provides a simple model binder for this model binding class. - - - Initializes a new instance of the class. - The model type. - The model binder factory. - - - Initializes a new instance of the class by using the specified model type and the model binder. - The model type. - The model binder. - - - Returns a model binder by using the specified execution context and binding context. - The model binder, or null if the attempt to get a model binder is unsuccessful. - The configuration. - The model type. - - - Gets the type of the model. - The type of the model. - - - Gets or sets a value that specifies whether the prefix check should be suppressed. - true if the prefix check should be suppressed; otherwise, false. - - - Maps a browser request to a data object. This type is used when model binding requires conversions using a .NET Framework type converter. - - - Initializes a new instance of the class. - - - Binds the model by using the specified controller context and binding context. - true if model binding is successful; otherwise, false. - The action context. - The binding context. - - - Provides a model binder for a model that requires type conversion. - - - Initializes a new instance of the class. - - - Retrieve a model binder for a model that requires type conversion. - The model binder, or Nothing if the type cannot be converted or there is no value to convert. - The configuration of the binder. - The type of the model. - - - Maps a browser request to a data object. This class is used when model binding does not require type conversion. - - - Initializes a new instance of the class. - - - Binds the model by using the specified execution context and binding context. - true if model binding is successful; otherwise, false. - The action context. - The binding context. - - - Provides a model binder for a model that does not require type conversion. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - The associated model binder. - The configuration. - The type of model. - - - Represents an action result that returns response and performs content negotiation on an see with . - - - Initializes a new instance of the class. - The user-visible error message. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class. - The user-visible error message. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content negotiator to handle content negotiation. - Returns . - - - Returns . - - - Gets the formatters to use to negotiate and format the content. - Returns . - - - Gets the user-visible error message. - Returns . - - - Gets the request message which led to this result. - Returns . - - - Represents an action result that returns an empty response. - - - Initializes a new instance of the class. - The request message which led to this result. - - - Initializes a new instance of the class. - The controller from which to obtain the dependencies needed for execution. - - - Asynchronously executes the request. - The task that completes the execute operation. - The cancellation token. - - - Gets the request message which led to this result. - The request message which led to this result. - - - Represents an action result that returns an empty HttpStatusCode.Conflict response. - - - Initializes a new instance of the class. - The request message which led to this result. - - - Initializes a new instance of the class. - The controller from which to obtain the dependencies needed for execution. - - - Executes asynchronously the operation of the conflict result. - Asynchronously executes the specified task. - The cancellation token. - - - Gets the request message which led to this result. - The HTTP request message which led to this result. - - - Represents an action result that performs route generation and content negotiation and returns a response when content negotiation succeeds. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The content value to negotiate and format in the entity body. - The controller from which to obtain the dependencies needed for execution. - - - Initializes a new instance of the class with the values provided. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The content value to negotiate and format in the entity body. - The factory to use to generate the route URL. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Gets the content value to negotiate and format in the entity body. - - - Gets the content negotiator to handle content negotiation. - - - - Gets the formatters to use to negotiate and format the content. - - - Gets the request message which led to this result. - - - Gets the name of the route to use for generating the URL. - - - Gets the route data to use for generating the URL. - - - Gets the factory to use to generate the route URL. - - - Represents an action result that performs content negotiation and returns a response when it succeeds. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The content value to negotiate and format in the entity body. - The location at which the content has been created. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class with the values provided. - The location at which the content has been created. - The content value to negotiate and format in the entity body. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content value to negotiate and format in the entity body. - The content value to negotiate and format in the entity body. - - - Gets the content negotiator to handle content negotiation. - The content negotiator to handle content negotiation. - - - Executes asynchronously the operation of the created negotiated content result. - Asynchronously executes a return value. - The cancellation token. - - - Gets the formatters to use to negotiate and format the content. - The formatters to use to negotiate and format the content. - - - Gets the location at which the content has been created. - The location at which the content has been created. - - - Gets the request message which led to this result. - The HTTP request message which led to this result. - - - Represents an action result that returns a response and performs content negotiation on an  based on an . - - - Initializes a new instance of the class. - The exception to include in the error. - true if the error should include exception messages; otherwise, false . - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class. - The exception to include in the error. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content negotiator to handle content negotiation. - Returns . - - - Gets the exception to include in the error. - Returns . - - - Returns . - - - Gets the formatters to use to negotiate and format the content. - Returns . - - - Gets a value indicating whether the error should include exception messages. - Returns . - - - Gets the request message which led to this result. - Returns . - - - Represents an action result that returns formatted content. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The HTTP status code for the response message. - The content value to format in the entity body. - The formatter to use to format the content. - The value for the Content-Type header, or to have the formatter pick a default value. - The request message which led to this result. - - - Initializes a new instance of the class with the values provided. - The HTTP status code for the response message. - The content value to format in the entity body. - The formatter to use to format the content. - The value for the Content-Type header, or to have the formatter pick a default value. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content value to format in the entity body. - - - - Gets the formatter to use to format the content. - - - Gets the value for the Content-Type header, or to have the formatter pick a default value. - - - Gets the request message which led to this result. - - - Gets the HTTP status code for the response message. - - - Represents an action result that returns an empty response. - - - Initializes a new instance of the class. - The request message which led to this result. - - - Initializes a new instance of the class. - The controller from which to obtain the dependencies needed for execution. - - - Returns . - - - Gets the request message which led to this result. - Returns . - - - Represents an action result that returns a response and performs content negotiation on an based on a . - - - Initializes a new instance of the class. - The model state to include in the error. - true if the error should include exception messages; otherwise, false. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class. - The model state to include in the error. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content negotiator to handle content negotiation. - The content negotiator to handle content negotiation. - - - Creates a response message asynchronously. - A task that, when completed, contains the response message. - The token to monitor for cancellation requests. - - - Gets the formatters to use to negotiate and format the content. - The formatters to use to negotiate and format the content. - - - Gets a value indicating whether the error should include exception messages. - true if the error should include exception messages; otherwise, false. - - - Gets the model state to include in the error. - The model state to include in the error. - - - Gets the request message which led to this result. - The request message which led to this result. - - - Represents an action result that returns an response with JSON data. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The content value to serialize in the entity body. - The serializer settings. - The content encoding. - The request message which led to this result. - - - Initializes a new instance of the class with the values provided. - The content value to serialize in the entity body. - The serializer settings. - The content encoding. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content value to serialize in the entity body. - The content value to serialize in the entity body. - - - Gets the content encoding. - The content encoding. - - - Creates a response message asynchronously. - A task that, when completed, contains the response message. - The token to monitor for cancellation requests. - - - Gets the request message which led to this result. - The request message which led to this result. - - - Gets the serializer settings. - The serializer settings. - - - Represents an action result that performs content negotiation. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The HTTP status code for the response message. - The content value to negotiate and format in the entity body. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class with the values provided. - The HTTP status code for the response message. - The content value to negotiate and format in the entity body. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content value to negotiate and format in the entity body. - The content value to negotiate and format in the entity body. - - - Gets the content negotiator to handle content negotiation. - The content negotiator to handle content negotiation. - - - Executes asynchronously an HTTP negotiated content results. - Asynchronously executes an HTTP negotiated content results. - The cancellation token. - - - Gets the formatters to use to negotiate and format the content. - The formatters to use to negotiate and format the content. - - - Gets the request message which led to this result. - The HTTP request message which led to this result. - - - Gets the HTTP status code for the response message. - The HTTP status code for the response message. - - - Represents an action result that returns an empty response. - - - Initializes a new instance of the class. - The request message which led to this result. - - - Initializes a new instance of the class. - The controller from which to obtain the dependencies needed for execution. - - - - Gets the request message which led to this result. - - - Represents an action result that performs content negotiation and returns an HttpStatusCode.OK response when it succeeds. - The type of content in the entity body. - - - Initializes a new instance of the class with the values provided. - The content value to negotiate and format in the entity body. - The content negotiator to handle content negotiation. - The request message which led to this result. - The formatters to use to negotiate and format the content. - - - Initializes a new instance of the class with the values provided. - The content value to negotiate and format in the entity body. - The controller from which to obtain the dependencies needed for execution. - - - Gets the content value to negotiate and format in the entity body. - - - Gets the content negotiator to handle content negotiation. - - - - Gets the formatters to use to negotiate and format the content. - - - Gets the request message which led to this result. - - - Represents an action result that returns an empty HttpStatusCode.OK response. - - - Initializes a new instance of the class. - The request message which led to this result. - - - Initializes a new instance of the class. - The controller from which to obtain the dependencies needed for execution. - - - Executes asynchronously. - Returns the task. - The cancellation token. - - - Gets a HTTP request message for the results. - A HTTP request message for the results. - - - Represents an action result for a <see cref="F:System.Net.HttpStatusCode.Redirect"/>. - - - Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectResult"/> class with the values provided. - The location to which to redirect. - The request message which led to this result. - - - Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectResult"/> class with the values provided. - The location to which to redirect. - The controller from which to obtain the dependencies needed for execution. - - - Returns . - - - Gets the location at which the content has been created. - Returns . - - - Gets the request message which led to this result. - Returns . - - - Represents an action result that performs route generation and returns a <see cref="F:System.Net.HttpStatusCode.Redirect"/> response. - - - Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectToRouteResult"/> class with the values provided. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The controller from which to obtain the dependencies needed for execution. - - - Initializes a new instance of the <see cref="T:System.Web.Http.Results.RedirectToRouteResult"/> class with the values provided. - The name of the route to use for generating the URL. - The route data to use for generating the URL. - The factory to use to generate the route URL. - The request message which led to this result. - - - Returns . - - - Gets the request message which led to this result. - Returns . - - - Gets the name of the route to use for generating the URL. - Returns . - - - Gets the route data to use for generating the URL. - Returns . - - - Gets the factory to use to generate the route URL. - Returns . - - - Represents an action result that returns a specified response message. - - - Initializes a new instance of the class. - The response message. - - - - Gets the response message. - - - Represents an action result that returns a specified HTTP status code. - - - Initializes a new instance of the class. - The HTTP status code for the response message. - The request message which led to this result. - - - Initializes a new instance of the class. - The HTTP status code for the response message. - The controller from which to obtain the dependencies needed for execution. - - - Creates a response message asynchronously. - A task that, when completed, contains the response message. - The token to monitor for cancellation requests. - - - Gets the request message which led to this result. - The request message which led to this result. - - - Gets the HTTP status code for the response message. - The HTTP status code for the response message. - - - Represents an action result that returns an response. - - - Initializes a new instance of the class. - The WWW-Authenticate challenges. - The request message which led to this result. - - - Initializes a new instance of the class. - The WWW-Authenticate challenges. - The controller from which to obtain the dependencies needed for execution. - - - Gets the WWW-Authenticate challenges. - Returns . - - - Returns . - - - Gets the request message which led to this result. - Returns . - - - A default implementation of . - - - - Creates instances based on the provided factories and action. The route entries provide direct routing to the provided action. - A set of route entries. - The action descriptor. - The direct route factories. - The constraint resolver. - - - Gets a set of route factories for the given action descriptor. - A set of route factories. - The action descriptor. - - - Creates instances based on the provided factories, controller and actions. The route entries provided direct routing to the provided controller and can reach the set of provided actions. - A set of route entries. - The controller descriptor. - The action descriptors. - The direct route factories. - The constraint resolver. - - - Gets route factories for the given controller descriptor. - A set of route factories. - The controller descriptor. - - - Gets direct routes for the given controller descriptor and action descriptors based on attributes. - A set of route entries. - The controller descriptor. - The action descriptors for all actions. - The constraint resolver. - - - Gets the route prefix from the provided controller. - The route prefix or null. - The controller descriptor. - - - The default implementation of . Resolves constraints by parsing a constraint key and constraint arguments, using a map to resolve the constraint type, and calling an appropriate constructor for the constraint type. - - - Initializes a new instance of the class. - - - Gets the mutable dictionary that maps constraint keys to a particular constraint type. - The mutable dictionary that maps constraint keys to a particular constraint type. - - - Resolves the inline constraint. - The the inline constraint was resolved to. - The inline constraint to resolve. - - - Represents a context that supports creating a direct route. - - - Initializes a new instance of the class. - The route prefix, if any, defined by the controller. - The action descriptors to which to create a route. - The inline constraint resolver. - A value indicating whether the route is configured at the action or controller level. - - - Gets the action descriptors to which to create a route. - The action descriptors to which to create a route. - - - Creates a route builder that can build a route matching this context. - A route builder that can build a route matching this context. - The route template. - - - Creates a route builder that can build a route matching this context. - A route builder that can build a route matching this context. - The route template. - The inline constraint resolver to use, if any; otherwise, null. - - - Gets the inline constraint resolver. - The inline constraint resolver. - - - Gets the route prefix, if any, defined by the controller. - The route prefix, if any, defined by the controller. - - - Gets a value indicating whether the route is configured at the action or controller level. - true when the route is configured at the action level; otherwise false (if the route is configured at the controller level). - - - Enables you to define which HTTP verbs are allowed when ASP.NET routing determines whether a URL matches a route. - - - Initializes a new instance of the class by using the HTTP verbs that are allowed for the route. - The HTTP verbs that are valid for the route. - - - Gets or sets the collection of allowed HTTP verbs for the route. - A collection of allowed HTTP verbs for the route. - - - Determines whether the request was made with an HTTP verb that is one of the allowed verbs for the route. - When ASP.NET routing is processing a request, true if the request was made by using an allowed HTTP verb; otherwise, false. When ASP.NET routing is constructing a URL, true if the supplied values contain an HTTP verb that matches one of the allowed HTTP verbs; otherwise, false. The default is true. - The request that is being checked to determine whether it matches the URL. - The object that is being checked to determine whether it matches the URL. - The name of the parameter that is being checked. - An object that contains the parameters for a route. - An object that indicates whether the constraint check is being performed when an incoming request is processed or when a URL is generated. - - - Determines whether the request was made with an HTTP verb that is one of the allowed verbs for the route. - When ASP.NET routing is processing a request, true if the request was made by using an allowed HTTP verb; otherwise, false. When ASP.NET routing is constructing a URL, true if the supplied values contain an HTTP verb that matches one of the allowed HTTP verbs; otherwise, false. The default is true. - The request that is being checked to determine whether it matches the URL. - The object that is being checked to determine whether it matches the URL. - The name of the parameter that is being checked. - An object that contains the parameters for a route. - An object that indicates whether the constraint check is being performed when an incoming request is processed or when a URL is generated. - - - Represents a route class for self-host (i.e. hosted outside of ASP.NET). - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The route template. - - - Initializes a new instance of the class. - The route template. - The default values for the route parameters. - - - Initializes a new instance of the class. - The route template. - The default values for the route parameters. - The constraints for the route parameters. - - - Initializes a new instance of the class. - The route template. - The default values for the route parameters. - The constraints for the route parameters. - Any additional tokens for the route parameters. - - - Initializes a new instance of the class. - The route template. - The default values for the route parameters. - The constraints for the route parameters. - Any additional tokens for the route parameters. - The message handler that will be the recipient of the request. - - - Gets the constraints for the route parameters. - The constraints for the route parameters. - - - Gets any additional data tokens not used directly to determine whether a route matches an incoming . - Any additional data tokens not used directly to determine whether a route matches an incoming . - - - Gets the default values for route parameters if not provided by the incoming . - The default values for route parameters if not provided by the incoming . - - - Determines whether this route is a match for the incoming request by looking up the for the route. - The for a route if matches; otherwise null. - The virtual path root. - The HTTP request. - - - Attempts to generate a URI that represents the values passed in based on current values from the and new values using the specified . - A instance or null if URI cannot be generated. - The HTTP request message. - The route values. - - - Gets or sets the http route handler. - The http route handler. - - - Specifies the HTTP route key. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The HTTP request. - The constraints for the route parameters. - The name of the parameter. - The list of parameter values. - One of the enumeration values of the enumeration. - - - Gets the route template describing the URI pattern to match against. - The route template describing the URI pattern to match against. - - - Encapsulates information regarding the HTTP route. - - - Initializes a new instance of the class. - An object that defines the route. - - - Initializes a new instance of the class. - An object that defines the route. - The value. - - - Gets the object that represents the route. - the object that represents the route. - - - Gets a collection of URL parameter values and default values for the route. - An object that contains values that are parsed from the URL and from default values. - - - Removes all optional parameters that do not have a value from the route data. - - - If a route is really a union of other routes, return the set of sub routes. - Returns the set of sub routes contained within this route. - A union route data. - - - Removes all optional parameters that do not have a value from the route data. - The route data, to be mutated in-place. - - - Specifies an enumeration of route direction. - - - The UriGeneration direction. - - - The UriResolution direction. - - - Represents a route class for self-host of specified key/value pairs. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The dictionary. - - - Initializes a new instance of the class. - The key value. - - - Presents the data regarding the HTTP virtual path. - - - Initializes a new instance of the class. - The route of the virtual path. - The URL that was created from the route definition. - - - Gets or sets the route of the virtual path.. - The route of the virtual path. - - - Gets or sets the URL that was created from the route definition. - The URL that was created from the route definition. - - - Defines a builder that creates direct routes to actions (attribute routes). - - - Gets the action descriptors to which to create a route. - The action descriptors to which to create a route. - - - Creates a route entry based on the current property values. - The route entry created. - - - Gets or sets the route constraints. - The route constraints. - - - Gets or sets the route data tokens. - The route data tokens. - - - Gets or sets the route defaults. - The route defaults. - - - Gets or sets the route name, if any; otherwise null. - The route name, if any; otherwise null. - - - Gets or sets the route order. - The route order. - - - Gets or sets the route precedence. - The route precedence. - - - Gets a value indicating whether the route is configured at the action or controller level. - true when the route is configured at the action level; otherwise false (if the route is configured at the controller level). - - - Gets or sets the route template. - The route template. - - - Defines a factory that creates a route directly to a set of action descriptors (an attribute route). - - - Creates a direct route entry. - The direct route entry. - The context to use to create the route. - - - Defines a provider for routes that directly target action descriptors (attribute routes). - - - Gets the direct routes for a controller. - A set of route entries for the controller. - The controller descriptor. - The action descriptors. - The inline constraint resolver. - - - - defines the interface for a route expressing how to map an incoming to a particular controller and action. - - - Gets the constraints for the route parameters. - The constraints for the route parameters. - - - Gets any additional data tokens not used directly to determine whether a route matches an incoming . - The additional data tokens. - - - Gets the default values for route parameters if not provided by the incoming . - The default values for route parameters. - - - Determine whether this route is a match for the incoming request by looking up the <see cref="!:IRouteData" /> for the route. - The <see cref="!:RouteData" /> for a route if matches; otherwise null. - The virtual path root. - The request. - - - Gets a virtual path data based on the route and the values provided. - The virtual path data. - The request message. - The values. - - - Gets the message handler that will be the recipient of the request. - The message handler. - - - Gets the route template describing the URI pattern to match against. - The route template. - - - Represents a base class route constraint. - - - Determines whether this instance equals a specified route. - True if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Provides information about a route. - - - Gets the object that represents the route. - The object that represents the route. - - - Gets a collection of URL parameter values and default values for the route. - The values that are parsed from the URL and from default values. - - - Provides information for defining a route. - - - Gets the name of the route to generate. - - - Gets the order of the route relative to other routes. - - - Gets the route template describing the URI pattern to match against. - - - Defines the properties for HTTP route. - - - Gets the HTTP route. - The HTTP route. - - - Gets the URI that represents the virtual path of the current HTTP route. - The URI that represents the virtual path of the current HTTP route. - - - Defines an abstraction for resolving inline constraints as instances of . - - - Resolves the inline constraint. - The the inline constraint was resolved to. - The inline constraint to resolve. - - - Defines a route prefix. - - - Gets the route prefix. - The route prefix. - - - Represents a named route. - - - Initializes a new instance of the class. - The route name, if any; otherwise, null. - The route. - - - Gets the route name, if any; otherwise, null. - The route name, if any; otherwise, null. - - - Gets the route. - The route. - - - Represents an attribute route that may contain custom constraints. - - - Initializes a new instance of the class. - The route template. - - - Gets the route constraints, if any; otherwise null. - The route constraints, if any; otherwise null. - - - Creates the route entry - The created route entry. - The context. - - - Gets the route data tokens, if any; otherwise null. - The route data tokens, if any; otherwise null. - - - Gets the route defaults, if any; otherwise null. - The route defaults, if any; otherwise null. - - - Gets or sets the route name, if any; otherwise null. - The route name, if any; otherwise null. - - - Gets or sets the route order. - The route order. - - - Gets the route template. - The route template. - - - Represents a handler that specifies routing should not handle requests for a route template. When a route provides this class as a handler, requests matching against the route will be ignored. - - - Initializes a new instance of the class. - - - Represents a factory for creating URLs. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The HTTP request for this instance. - - - Creates an absolute URL using the specified path. - The generated URL. - The URL path, which may be a relative URL, a rooted URL, or a virtual path. - - - Returns a link for the specified route. - A link for the specified route. - The name of the route. - An object that contains the parameters for a route. - - - Returns a link for the specified route. - A link for the specified route. - The name of the route. - A route value. - - - Gets or sets the of the current instance. - The of the current instance. - - - Returns the route for the . - The route for the . - The name of the route. - A list of route values. - - - Returns the route for the . - The route for the . - The name of the route. - The route values. - - - Constrains a route parameter to contain only lowercase or uppercase letters A through Z in the English alphabet. - - - Initializes a new instance of the class. - - - Constrains a route parameter to represent only Boolean values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route by several child constraints. - - - Initializes a new instance of the class. - The child constraints that must match for this constraint to match. - - - Gets the child constraints that must match for this constraint to match. - The child constraints that must match for this constraint to match. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route of direction. - - - Constrains a route parameter to represent only decimal values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only 64-bit floating-point values. - - - - - Constrains a route parameter to represent only 32-bit floating-point values. - - - - - Constrains a route parameter to represent only values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to represent only 32-bit integer values. - - - Initializes a new instance of the class. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constrains a route parameter to be a string of a given length or within a given range of lengths. - - - - Initializes a new instance of the class that constrains a route parameter to be a string of a given length. - The minimum length of the route parameter. - The maximum length of the route parameter. - - - Gets the length of the route parameter, if one is set. - - - - Gets the maximum length of the route parameter, if one is set. - - - Gets the minimum length of the route parameter, if one is set. - - - Constrains a route parameter to represent only 64-bit integer values. - - - - - Constrains a route parameter to be a string with a maximum length. - - - Initializes a new instance of the class. - The maximum length. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the maximum length of the route parameter. - The maximum length of the route parameter. - - - Constrains a route parameter to be an integer with a maximum value. - - - - - Gets the maximum value of the route parameter. - - - Constrains a route parameter to be a string with a maximum length. - - - Initializes a new instance of the class. - The minimum length. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the minimum length of the route parameter. - The minimum length of the route parameter. - - - Constrains a route parameter to be a long with a minimum value. - - - Initializes a new instance of the class. - The minimum value of the route parameter. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the minimum value of the route parameter. - The minimum value of the route parameter. - - - Constrains a route by an inner constraint that doesn't fail when an optional parameter is set to its default value. - - - Initializes a new instance of the class. - The inner constraint to match if the parameter is not an optional parameter without a value - - - Gets the inner constraint to match if the parameter is not an optional parameter without a value. - The inner constraint to match if the parameter is not an optional parameter without a value. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Constraints a route parameter to be an integer within a given range of values. - - - Initializes a new instance of the class. - The minimum value. - The maximum value. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the maximum value of the route parameter. - The maximum value of the route parameter. - - - Gets the minimum value of the route parameter. - The minimum value of the route parameter. - - - Constrains a route parameter to match a regular expression. - - - Initializes a new instance of the class. - The pattern. - - - Determines whether this instance equals a specified route. - true if this instance equals a specified route; otherwise, false. - The request. - The route to compare. - The name of the parameter. - A list of parameter values. - The route direction. - - - Gets the regular expression pattern to match. - The regular expression pattern to match. - - - Provides a method for retrieving the innermost object of an object that might be wrapped by an <see cref="T:System.Web.Http.Services.IDecorator`1" />. - - - Gets the innermost object which does not implement <see cref="T:System.Web.Http.Services.IDecorator`1" />. - Object which needs to be unwrapped. - - - - Represents a container for service instances used by the . Note that this container only supports known types, and methods to get or set arbitrary service types will throw when called. For creation of arbitrary types, please use instead. The supported types for this container are: Passing any type which is not on this to any method on this interface will cause an to be thrown. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified object. - The object. - - - Removes a single-instance service from the default services. - The type of the service. - - - Gets a service of the specified type. - The first instance of the service, or null if the service is not found. - The type of service. - - - Gets the list of service objects for a given service type, and validates the service type. - The list of service objects of the specified type. - The service type. - - - Gets the list of service objects for a given service type. - The list of service objects of the specified type, or an empty list if the service is not found. - The type of service. - - - Queries whether a service type is single-instance. - true if the service type has at most one instance, or false if the service type supports multiple instances. - The service type. - - - Replaces a single-instance service object. - The service type. - The service object that replaces the previous instance. - - - Removes the cached values for a single service type. - The service type. - - - Defines a decorator that exposes the inner decorated object. - This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see . - - - Gets the inner object. - - - Represents a performance tracing class to log method entry/exit and duration. - - - Initializes the class with a specified configuration. - The configuration. - - - Represents the trace writer. - - - Invokes the specified traceAction to allow setting values in a new if and only if tracing is permitted at the given category and level. - The current . It may be null but doing so will prevent subsequent trace analysis from correlating the trace to a particular request. - The logical category for the trace. Users can define their own. - The at which to write this trace. - The action to invoke if tracing is enabled. The caller is expected to fill in the fields of the given in this action. - - - Represents an extension methods for . - - - Provides a set of methods and properties that help debug your code with the specified writer, request, category and exception. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - - - Provides a set of methods and properties that help debug your code with the specified writer, request, category, exception, message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - The format of the message. - The message argument. - - - Provides a set of methods and properties that help debug your code with the specified writer, request, category, exception, message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The format of the message. - The message argument. - - - Displays an error message in the list with the specified writer, request, category and exception. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - - - Displays an error message in the list with the specified writer, request, category, exception, message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The exception. - The format of the message. - The argument in the message. - - - Displays an error message in the list with the specified writer, request, category, message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The format of the message. - The argument in the message. - - - Displays an error message in the class with the specified writer, request, category and exception. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The exception that appears during execution. - - - Displays an error message in the class with the specified writer, request, category and exception, message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The exception. - The format of the message. - The message argument. - - - Displays an error message in the class with the specified writer, request, category and message format and argument. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The format of the message. - The message argument. - - - Displays the details in the . - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - - - Displays the details in the . - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - The format of the message. - The message argument. - - - Displays the details in the . - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The format of the message. - The message argument. - - - Indicates the trace listeners in the Listeners collection. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The trace level. - The error occurred during execution. - - - Indicates the trace listeners in the Listeners collection. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The trace level. - The error occurred during execution. - The format of the message. - The message argument. - - - Indicates the trace listeners in the Listeners collection. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The of the trace. - The format of the message. - The message argument. - - - Traces both a begin and an end trace around a specified operation. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The of the trace. - The name of the object performing the operation. It may be null. - The name of the operation being performed. It may be null. - The to invoke prior to performing the operation, allowing the given to be filled in. It may be null. - An <see cref="T:System.Func`1" /> that returns the that will perform the operation. - The to invoke after successfully performing the operation, allowing the given to be filled in. It may be null. - The to invoke if an error was encountered performing the operation, allowing the given to be filled in. It may be null. - - - Traces both a begin and an end trace around a specified operation. - The returned by the operation. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The of the trace. - The name of the object performing the operation. It may be null. - The name of the operation being performed. It may be null. - The to invoke prior to performing the operation, allowing the given to be filled in. It may be null. - An <see cref="T:System.Func`1" /> that returns the that will perform the operation. - The to invoke after successfully performing the operation, allowing the given to be filled in. The result of the completed task will also be passed to this action. This action may be null. - The to invoke if an error was encountered performing the operation, allowing the given to be filled in. It may be null. - The type of result produced by the . - - - Traces both a begin and an end trace around a specified operation. - The returned by the operation. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The of the trace. - The name of the object performing the operation. It may be null. - The name of the operation being performed. It may be null. - The to invoke prior to performing the operation, allowing the given to be filled in. It may be null. - An <see cref="T:System.Func`1" /> that returns the that will perform the operation. - The to invoke after successfully performing the operation, allowing the given to be filled in. It may be null. - The to invoke if an error was encountered performing the operation, allowing the given to be filled in. It may be null. - - - Indicates the warning level of execution. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - - - Indicates the warning level of execution. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The error occurred during execution. - The format of the message. - The message argument. - - - Indicates the warning level of execution. - The . - The with which to associate the trace. It may be null. - The logical category of the trace. - The format of the message. - The message argument. - - - Specifies an enumeration of tracing categories. - - - An action category. - - - The controllers category. - - - The filters category. - - - The formatting category. - - - The message handlers category. - - - The model binding category. - - - The request category. - - - The routing category. - - - Specifies the kind of tracing operation. - - - Trace marking the beginning of some operation. - - - Trace marking the end of some operation. - - - Single trace, not part of a Begin/End trace pair. - - - Specifies an enumeration of tracing level. - - - Trace level for debugging traces. - - - Trace level for error traces. - - - Trace level for fatal traces. - - - Trace level for informational traces. - - - Tracing is disabled. - - - Trace level for warning traces. - - - Represents a trace record. - - - Initializes a new instance of the class. - The message request. - The trace category. - The trace level. - - - Gets or sets the tracing category. - The tracing category. - - - Gets or sets the exception. - The exception. - - - Gets or sets the kind of trace. - The kind of trace. - - - Gets or sets the tracing level. - The tracing level. - - - Gets or sets the message. - The message. - - - Gets or sets the logical operation name being performed. - The logical operation name being performed. - - - Gets or sets the logical name of the object performing the operation. - The logical name of the object performing the operation. - - - Gets the optional user-defined properties. - The optional user-defined properties. - - - Gets the from the record. - The from the record. - - - Gets the correlation ID from the . - The correlation ID from the . - - - Gets or sets the associated with the . - The associated with the . - - - Gets the of this trace (via ). - The of this trace (via ). - - - Represents a class used to recursively validate an object. - - - Initializes a new instance of the class. - - - Determines whether instances of a particular type should be validated. - true if the type should be validated; false otherwise. - The type to validate. - - - Determines whether the is valid and adds any validation errors to the 's . - true if model is valid, false otherwise. - The model to be validated. - The to use for validation. - The used to provide model metadata. - The within which the model is being validated. - The to append to the key for any validation errors. - - - Represents an interface for the validation of the models - - - Determines whether the model is valid and adds any validation errors to the actionContext's - trueif model is valid, false otherwise. - The model to be validated. - The to use for validation. - The used to provide the model metadata. - The within which the model is being validated. - The to append to the key for any validation errors. - - - This logs formatter errors to the provided . - - - Initializes a new instance of the class. - The model state. - The prefix. - - - Logs the specified model error. - The error path. - The error message. - - - Logs the specified model error. - The error path. - The error message. - - - Provides data for the event. - - - Initializes a new instance of the class. - The action context. - The parent node. - - - Gets or sets the context for an action. - The context for an action. - - - Gets or sets the parent of this node. - The parent of this node. - - - Provides data for the event. - - - Initializes a new instance of the class. - The action context. - The parent node. - - - Gets or sets the context for an action. - The context for an action. - - - Gets or sets the parent of this node. - The parent of this node. - - - Provides a container for model validation information. - - - Initializes a new instance of the class, using the model metadata and state key. - The model metadata. - The model state key. - - - Initializes a new instance of the class, using the model metadata, the model state key, and child model-validation nodes. - The model metadata. - The model state key. - The model child nodes. - - - Gets or sets the child nodes. - The child nodes. - - - Combines the current instance with a specified instance. - The model validation node to combine with the current instance. - - - Gets or sets the model metadata. - The model metadata. - - - Gets or sets the model state key. - The model state key. - - - Gets or sets a value that indicates whether validation should be suppressed. - true if validation should be suppressed; otherwise, false. - - - Validates the model using the specified execution context. - The action context. - - - Validates the model using the specified execution context and parent node. - The action context. - The parent node. - - - Gets or sets a value that indicates whether all properties of the model should be validated. - true if all properties of the model should be validated, or false if validation should be skipped. - - - Occurs when the model has been validated. - - - Occurs when the model is being validated. - - - Represents the selection of required members by checking for any required ModelValidators associated with the member. - - - Initializes a new instance of the class. - The metadata provider. - The validator providers. - - - Indicates whether the member is required for validation. - true if the member is required for validation; otherwise, false. - The member. - - - Provides a container for a validation result. - - - Initializes a new instance of the class. - - - Gets or sets the name of the member. - The name of the member. - - - Gets or sets the validation result message. - The validation result message. - - - Provides a base class for implementing validation logic. - - - Initializes a new instance of the class. - The validator providers. - - - Returns a composite model validator for the model. - A composite model validator for the model. - An enumeration of validator providers. - - - Gets a value that indicates whether a model property is required. - true if the model property is required; otherwise, false. - - - Validates a specified object. - A list of validation results. - The metadata. - The container. - - - Gets or sets an enumeration of validator providers. - An enumeration of validator providers. - - - Provides a list of validators for a model. - - - Initializes a new instance of the class. - - - Gets a list of validators associated with this . - The list of validators. - The metadata. - The validator providers. - - - Provides an abstract class for classes that implement a validation provider. - - - Initializes a new instance of the class. - - - Gets a type descriptor for the specified type. - A type descriptor for the specified type. - The type of the validation provider. - - - Gets the validators for the model using the metadata and validator providers. - The validators for the model. - The metadata. - An enumeration of validator providers. - - - Gets the validators for the model using the metadata, the validator providers, and a list of attributes. - The validators for the model. - The metadata. - An enumeration of validator providers. - The list of attributes. - - - Represents the method that creates a instance. - - - Represents an implementation of which providers validators for attributes which derive from . It also provides a validator for types which implement . To support client side validation, you can either register adapters through the static methods on this class, or by having your validation attributes implement . The logic to support IClientValidatable is implemented in . - - - Initializes a new instance of the class. - - - Gets the validators for the model using the specified metadata, validator provider and attributes. - The validators for the model. - The metadata. - The validator providers. - The attributes. - - - Registers an adapter to provide client-side validation. - The type of the validation attribute. - The type of the adapter. - - - Registers an adapter factory for the validation provider. - The type of the attribute. - The factory that will be used to create the object for the specified attribute. - - - Registers the default adapter. - The type of the adapter. - - - Registers the default adapter factory. - The factory that will be used to create the object for the default adapter. - - - Registers the default adapter type for objects which implement . The adapter type must derive from and it must contain a public constructor which takes two parameters of types and . - The type of the adapter. - - - Registers the default adapter factory for objects which implement . - The factory. - - - Registers an adapter type for the given modelType, which must implement . The adapter type must derive from and it must contain a public constructor which takes two parameters of types and . - The model type. - The type of the adapter. - - - Registers an adapter factory for the given modelType, which must implement . - The model type. - The factory. - - - Provides a factory for validators that are based on . - - - Represents a validator provider for data member model. - - - Initializes a new instance of the class. - - - Gets the validators for the model. - The validators for the model. - The metadata. - An enumerator of validator providers. - A list of attributes. - - - An implementation of which provides validators that throw exceptions when the model is invalid. - - - Initializes a new instance of the class. - - - Gets a list of validators associated with this . - The list of validators. - The metadata. - The validator providers. - The list of attributes. - - - Represents the provider for the required member model validator. - - - Initializes a new instance of the class. - The required member selector. - - - Gets the validator for the member model. - The validator for the member model. - The metadata. - The validator providers - - - Provides a model validator. - - - Initializes a new instance of the class. - The validator providers. - The validation attribute for the model. - - - Gets or sets the validation attribute for the model validator. - The validation attribute for the model validator. - - - Gets a value that indicates whether model validation is required. - true if model validation is required; otherwise, false. - - - Validates the model and returns the validation errors if any. - A list of validation error messages for the model, or an empty list if no errors have occurred. - The model metadata. - The container for the model. - - - A to represent an error. This validator will always throw an exception regardless of the actual model value. - - - Initializes a new instance of the class. - The list of model validator providers. - The error message for the exception. - - - Validates a specified object. - A list of validation results. - The metadata. - The container. - - - Represents the for required members. - - - Initializes a new instance of the class. - The validator providers. - - - Gets or sets a value that instructs the serialization engine that the member must be presents when validating. - true if the member is required; otherwise, false. - - - Validates the object. - A list of validation results. - The metadata. - The container. - - - Provides an object adapter that can be validated. - - - Initializes a new instance of the class. - The validation provider. - - - Validates the specified object. - A list of validation results. - The metadata. - The container. - - - Represents the base class for value providers whose values come from a collection that implements the interface. - - - Retrieves the keys from the specified . - The keys from the specified . - The prefix. - - - Represents an interface that is implemented by any that supports the creation of a to access the of an incoming . - - - Defines the methods that are required for a value provider in ASP.NET MVC. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Retrieves a value object using the specified key. - The value object for the specified key, or null if the key is not found. - The key of the value object to retrieve. - - - This attribute is used to specify a custom . - - - Initializes a new instance of the . - The type of the model binder. - - - Initializes a new instance of the . - An array of model binder types. - - - Gets the value provider factories. - A collection of value provider factories. - A configuration object. - - - Gets the types of object returned by the value provider factory. - A collection of types. - - - Represents a factory for creating value-provider objects. - - - Initializes a new instance of the class. - - - Returns a value-provider object for the specified controller context. - A value-provider object. - An object that encapsulates information about the current HTTP request. - - - Represents the result of binding a value (such as from a form post or query string) to an action-method argument property, or to the argument itself. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The raw value. - The attempted value. - The culture. - - - Gets or sets the raw value that is converted to a string for display. - The raw value that is converted to a string for display. - - - Converts the value that is encapsulated by this result to the specified type. - The converted value. - The target type. - - - Converts the value that is encapsulated by this result to the specified type by using the specified culture information. - The converted value. - The target type. - The culture to use in the conversion. - - - Gets or sets the culture. - The culture. - - - Gets or set the raw value that is supplied by the value provider. - The raw value that is supplied by the value provider. - - - Represents a value provider whose values come from a list of value providers that implements the interface. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The list of value providers. - - - Determines whether the collection contains the specified . - true if the collection contains the specified ; otherwise, false. - The prefix to search for. - - - Retrieves the keys from the specified . - The keys from the specified . - The prefix from which keys are retrieved. - - - Retrieves a value object using the specified . - The value object for the specified . - The key of the value object to retrieve. - - - Inserts an element into the collection at the specified index. - The zero-based index at which should be inserted. - The object to insert. - - - Replaces the element at the specified index. - The zero-based index of the element to replace. - The new value for the element at the specified index. - - - Represents a factory for creating a list of value-provider objects. - - - Initializes a new instance of the class. - The collection of value-provider factories. - - - Retrieves a list of value-provider objects for the specified controller context. - The list of value-provider objects for the specified controller context. - An object that encapsulates information about the current HTTP request. - - - A value provider for name/value pairs. - - - - Initializes a new instance of the class. - The name/value pairs for the provider. - The culture used for the name/value pairs. - - - Initializes a new instance of the class, using a function delegate to provide the name/value pairs. - A function delegate that returns a collection of name/value pairs. - The culture used for the name/value pairs. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Gets the keys from a prefix. - The keys. - The prefix. - - - Retrieves a value object using the specified key. - The value object for the specified key. - The key of the value object to retrieve. - - - Represents a value provider for query strings that are contained in a object. - - - Initializes a new instance of the class. - An object that encapsulates information about the current HTTP request. - An object that contains information about the target culture. - - - Represents a class that is responsible for creating a new instance of a query-string value-provider object. - - - Initializes a new instance of the class. - - - Retrieves a value-provider object for the specified controller context. - A query-string value-provider object. - An object that encapsulates information about the current HTTP request. - - - Represents a value provider for route data that is contained in an object that implements the IDictionary(Of TKey, TValue) interface. - - - Initializes a new instance of the class. - An object that contain information about the HTTP request. - An object that contains information about the target culture. - - - Represents a factory for creating route-data value provider objects. - - - Initializes a new instance of the class. - - - Retrieves a value-provider object for the specified controller context. - A value-provider object. - An object that encapsulates information about the current HTTP request. - - - \ No newline at end of file diff --git a/src/NSwag.Integration.Tests/VersionMissmatchTest/nswag.json b/src/NSwag.Integration.Tests/VersionMissmatchTest/nswag.json deleted file mode 100644 index 4e9b0ec1c5..0000000000 --- a/src/NSwag.Integration.Tests/VersionMissmatchTest/nswag.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "swaggerGenerator": { - "webApiToSwagger": { - "assemblyPaths": [ - "input/NSwag.VersionMissmatchTest.exe" - ], - "referencePaths": [], - "isAspNetCore": false, - "useBindingRedirects": false, - "controllerNames": [ - "NSwag.VersionMissmatchTest.FooController" - ], - "defaultUrlTemplate": "api/{controller}/{id?}", - "defaultPropertyNameHandling": "Default", - "defaultEnumHandling": "Integer", - "flattenInheritanceHierarchy": false, - "generateKnownTypes": true, - "generateXmlObjects": false, - "addMissingPathParameters": false, - "infoTitle": "Web API Swagger specification", - "infoVersion": "1.0.0", - "output": "output/swagger.json" - } - }, - "codeGenerators": {} -} \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/ApplicationInsights.config b/src/NSwag.Integration.TypeScriptWeb/ApplicationInsights.config deleted file mode 100644 index 56d4b46555..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/ApplicationInsights.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/NSwag.Integration.TypeScriptWeb.csproj b/src/NSwag.Integration.TypeScriptWeb/NSwag.Integration.TypeScriptWeb.csproj deleted file mode 100644 index 57919481ce..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/NSwag.Integration.TypeScriptWeb.csproj +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - - Debug - AnyCPU - - - 2.0 - {987EDAA3-9D9D-4F88-87C6-B81AE8213FCF} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - NSwag.Integration.TypeScriptWeb - NSwag.Integration.TypeScriptWeb - v4.5.1 - true - - - - - - - - 2.2 - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - ES6 - None - True - True - CommonJS - False - - scripts/build - True - True - False - False - False - False - False - False - False - False - False - True - - - - - pdbonly - true - bin\ - TRACE - prompt - 4 - ES6 - None - True - CommonJS - False - - scripts/build - True - True - True - True - True - True - True - True - True - False - False - True - - - - - pdbonly - true - bin\ - TRACE - prompt - 4 - ES6 - None - True - CommonJS - False - - scripts/build - True - True - False - False - False - False - False - False - False - False - False - True - - - - - - ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll - True - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - - - - Web.config - Designer - - - Web.config - - - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - true - bin\ - DEBUG;TRACE - full - x64 - prompt - MinimumRecommendedRules.ruleset - - - bin\ - TRACE - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - - - - - - - - - - True - True - 3165 - / - http://localhost:3165/ - False - False - - - False - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - npm i - - - \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/Properties/AssemblyInfo.cs b/src/NSwag.Integration.TypeScriptWeb/Properties/AssemblyInfo.cs deleted file mode 100644 index bff87e8c90..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NSwag.Integration.TypeScriptWeb")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NSwag.Integration.TypeScriptWeb")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("987edaa3-9d9d-4f88-87c6-b81ae8213fcf")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/NSwag.Integration.TypeScriptWeb/Web.Debug.config b/src/NSwag.Integration.TypeScriptWeb/Web.Debug.config deleted file mode 100644 index 2e302f9f95..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/Web.Debug.config +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/Web.Release.config b/src/NSwag.Integration.TypeScriptWeb/Web.Release.config deleted file mode 100644 index c35844462b..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/Web.Release.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/Web.config b/src/NSwag.Integration.TypeScriptWeb/Web.config deleted file mode 100644 index 8890afedb6..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/Web.config +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/package-lock.json b/src/NSwag.Integration.TypeScriptWeb/package-lock.json deleted file mode 100644 index 2780378fc5..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/package-lock.json +++ /dev/null @@ -1,392 +0,0 @@ -{ - "name": "nswag-integration-typescriptweb", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "nswag-integration-typescriptweb", - "license": "MIT", - "dependencies": { - "@angular/common": "^2.4.8", - "@angular/core": "^2.4.8", - "@angular/http": "^2.4.8", - "@angular/platform-browser": "^2.4.8", - "aurelia-fetch-client": "^1.1.1", - "aurelia-framework": "^1.1.0", - "rxjs": "^5.2.0", - "zone.js": "^0.7.7" - }, - "devDependencies": { - "@types/angular": "^1.6.7", - "@types/jasmine": "^2.5.43", - "@types/jquery": "^2.0.40", - "@types/knockout": "^3.4.39", - "typescript": "^2.2.1" - } - }, - "node_modules/@angular/common": { - "version": "2.4.10", - "resolved": "https://registry.npmjs.org/@angular/common/-/common-2.4.10.tgz", - "integrity": "sha1-o6aC0iKPow7CPdDrV8joh/uiaZc=", - "peerDependencies": { - "@angular/core": "2.4.10" - } - }, - "node_modules/@angular/core": { - "version": "2.4.10", - "resolved": "https://registry.npmjs.org/@angular/core/-/core-2.4.10.tgz", - "integrity": "sha1-C4MgplBlll2ZhkWx9c0892m0Qeo=", - "peerDependencies": { - "rxjs": "^5.0.1", - "zone.js": "^0.7.2" - } - }, - "node_modules/@angular/http": { - "version": "2.4.10", - "resolved": "https://registry.npmjs.org/@angular/http/-/http-2.4.10.tgz", - "integrity": "sha1-/2vq3ls5yYnr8jk8SbNO69Q+lVU=", - "deprecated": "Package no longer supported. Use @angular/common instead, see https://angular.io/guide/deprecations#angularhttp", - "peerDependencies": { - "@angular/core": "2.4.10", - "@angular/platform-browser": "2.4.10", - "rxjs": "^5.0.1" - } - }, - "node_modules/@angular/platform-browser": { - "version": "2.4.10", - "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-2.4.10.tgz", - "integrity": "sha1-y/JWCBSPtP/vlsxQBbpdez4JOQY=", - "peerDependencies": { - "@angular/common": "2.4.10", - "@angular/core": "2.4.10" - } - }, - "node_modules/@types/angular": { - "version": "1.6.32", - "resolved": "https://registry.npmjs.org/@types/angular/-/angular-1.6.32.tgz", - "integrity": "sha512-xpx7oFBN2oQEwtD80m+aI8wpejzGvlgkgzYD+MpxFTyJtlbwUUUIaJEaEJOtgtF/9Fndt3q6W1qNGf7vO2AUjw==", - "dev": true - }, - "node_modules/@types/jasmine": { - "version": "2.5.54", - "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-2.5.54.tgz", - "integrity": "sha512-B9YofFbUljs19g5gBKUYeLIulsh31U5AK70F41BImQRHEZQGm4GcN922UvnYwkduMqbC/NH+9fruWa/zrqvHIg==", - "dev": true - }, - "node_modules/@types/jquery": { - "version": "2.0.48", - "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-2.0.48.tgz", - "integrity": "sha512-nNLzUrVjaRV/Ds1eHZLYTd7IZxs38cwwLSaqMJj8OTXY8xNUbxSK69bi9cMLvQ7dm/IBeQ1wHwQ0S1uYa0rd2w==", - "dev": true - }, - "node_modules/@types/knockout": { - "version": "3.4.45", - "resolved": "https://registry.npmjs.org/@types/knockout/-/knockout-3.4.45.tgz", - "integrity": "sha512-RgzIhwDtvem3rHxmyMokAEGsPk/b0npoKUgGkIKXiEj89B1TXXbWd1fC8BPxV/CyPg5kLD5QKK24MzXdU6DDvQ==", - "dev": true - }, - "node_modules/aurelia-binding": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/aurelia-binding/-/aurelia-binding-1.2.2.tgz", - "integrity": "sha1-9A2hsxqmgEbTKqBbz69b0/PklxY=", - "dependencies": { - "aurelia-logging": "^1.0.0", - "aurelia-metadata": "^1.0.0", - "aurelia-pal": "^1.0.0", - "aurelia-task-queue": "^1.0.0" - } - }, - "node_modules/aurelia-dependency-injection": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/aurelia-dependency-injection/-/aurelia-dependency-injection-1.3.2.tgz", - "integrity": "sha1-X5yl3t5qHMxyoIOMmA3z3+eRh1Y=", - "dependencies": { - "aurelia-metadata": "^1.0.0", - "aurelia-pal": "^1.0.0" - } - }, - "node_modules/aurelia-fetch-client": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/aurelia-fetch-client/-/aurelia-fetch-client-1.1.3.tgz", - "integrity": "sha1-O2pLi53kgJ6Za9oSmfBYOMOQewo=" - }, - "node_modules/aurelia-framework": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/aurelia-framework/-/aurelia-framework-1.1.4.tgz", - "integrity": "sha1-TcYwscSCAxZ0ZuXfKHiAP/Qd/2U=", - "dependencies": { - "aurelia-binding": "^1.0.0", - "aurelia-dependency-injection": "^1.0.0", - "aurelia-loader": "^1.0.0", - "aurelia-logging": "^1.0.0", - "aurelia-metadata": "^1.0.0", - "aurelia-pal": "^1.0.0", - "aurelia-path": "^1.0.0", - "aurelia-task-queue": "^1.0.0", - "aurelia-templating": "^1.0.0" - } - }, - "node_modules/aurelia-loader": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/aurelia-loader/-/aurelia-loader-1.0.0.tgz", - "integrity": "sha1-t4wqKBOqjkQSRyN91m/WLl1OGeo=", - "dependencies": { - "aurelia-metadata": "^1.0.0", - "aurelia-path": "^1.0.0" - } - }, - "node_modules/aurelia-logging": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/aurelia-logging/-/aurelia-logging-1.3.1.tgz", - "integrity": "sha1-s0rnWTcroIdAqxIjOom60VSH/pg=" - }, - "node_modules/aurelia-metadata": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/aurelia-metadata/-/aurelia-metadata-1.0.3.tgz", - "integrity": "sha1-Ho1Z2hiOKHGorXSbpCyoUISj8w4=", - "dependencies": { - "aurelia-pal": "^1.0.0" - } - }, - "node_modules/aurelia-pal": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/aurelia-pal/-/aurelia-pal-1.4.0.tgz", - "integrity": "sha1-EUjyVshUwOAgoKj0Zcv0pu6vkYg=" - }, - "node_modules/aurelia-path": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/aurelia-path/-/aurelia-path-1.1.7.tgz", - "integrity": "sha512-D6/Tz8jE8b2+Y8Pt6P/fxF6xfJGef+TA6YEljzo1kEzyzbxIvwfqc7pK6i/XGY3LowlumPqrhxkfMjPxLpFIcA==" - }, - "node_modules/aurelia-task-queue": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aurelia-task-queue/-/aurelia-task-queue-1.2.0.tgz", - "integrity": "sha1-kjOsMOwQtiARO7qzcCSijmH1mGU=", - "dependencies": { - "aurelia-pal": "^1.0.0" - } - }, - "node_modules/aurelia-templating": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/aurelia-templating/-/aurelia-templating-1.4.2.tgz", - "integrity": "sha1-R5zkdwWglf1jbgl1yct5y+5+18s=", - "dependencies": { - "aurelia-binding": "^1.0.0", - "aurelia-dependency-injection": "^1.0.0", - "aurelia-loader": "^1.0.0", - "aurelia-logging": "^1.0.0", - "aurelia-metadata": "^1.0.0", - "aurelia-pal": "^1.0.0", - "aurelia-path": "^1.0.0", - "aurelia-task-queue": "^1.1.0" - } - }, - "node_modules/rxjs": { - "version": "5.4.3", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.4.3.tgz", - "integrity": "sha512-fSNi+y+P9ss+EZuV0GcIIqPUK07DEaMRUtLJvdcvMyFjc9dizuDjere+A4V7JrLGnm9iCc+nagV/4QdMTkqC4A==", - "dependencies": { - "symbol-observable": "^1.0.1" - }, - "engines": { - "npm": ">=2.0.0" - } - }, - "node_modules/symbol-observable": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.4.tgz", - "integrity": "sha1-Kb9hXUqnEhvdiYsi1LP5vE4qoD0=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/typescript": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.4.2.tgz", - "integrity": "sha1-+DlfhdRZJ2BnyYiqQYN6j4KHCEQ=", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/zone.js": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.7.8.tgz", - "integrity": "sha1-Tz/og01EWX8mOQU6D6Q43zT//e0=" - } - }, - "dependencies": { - "@angular/common": { - "version": "2.4.10", - "resolved": "https://registry.npmjs.org/@angular/common/-/common-2.4.10.tgz", - "integrity": "sha1-o6aC0iKPow7CPdDrV8joh/uiaZc=", - "requires": {} - }, - "@angular/core": { - "version": "2.4.10", - "resolved": "https://registry.npmjs.org/@angular/core/-/core-2.4.10.tgz", - "integrity": "sha1-C4MgplBlll2ZhkWx9c0892m0Qeo=", - "requires": {} - }, - "@angular/http": { - "version": "2.4.10", - "resolved": "https://registry.npmjs.org/@angular/http/-/http-2.4.10.tgz", - "integrity": "sha1-/2vq3ls5yYnr8jk8SbNO69Q+lVU=", - "requires": {} - }, - "@angular/platform-browser": { - "version": "2.4.10", - "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-2.4.10.tgz", - "integrity": "sha1-y/JWCBSPtP/vlsxQBbpdez4JOQY=", - "requires": {} - }, - "@types/angular": { - "version": "1.6.32", - "resolved": "https://registry.npmjs.org/@types/angular/-/angular-1.6.32.tgz", - "integrity": "sha512-xpx7oFBN2oQEwtD80m+aI8wpejzGvlgkgzYD+MpxFTyJtlbwUUUIaJEaEJOtgtF/9Fndt3q6W1qNGf7vO2AUjw==", - "dev": true - }, - "@types/jasmine": { - "version": "2.5.54", - "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-2.5.54.tgz", - "integrity": "sha512-B9YofFbUljs19g5gBKUYeLIulsh31U5AK70F41BImQRHEZQGm4GcN922UvnYwkduMqbC/NH+9fruWa/zrqvHIg==", - "dev": true - }, - "@types/jquery": { - "version": "2.0.48", - "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-2.0.48.tgz", - "integrity": "sha512-nNLzUrVjaRV/Ds1eHZLYTd7IZxs38cwwLSaqMJj8OTXY8xNUbxSK69bi9cMLvQ7dm/IBeQ1wHwQ0S1uYa0rd2w==", - "dev": true - }, - "@types/knockout": { - "version": "3.4.45", - "resolved": "https://registry.npmjs.org/@types/knockout/-/knockout-3.4.45.tgz", - "integrity": "sha512-RgzIhwDtvem3rHxmyMokAEGsPk/b0npoKUgGkIKXiEj89B1TXXbWd1fC8BPxV/CyPg5kLD5QKK24MzXdU6DDvQ==", - "dev": true - }, - "aurelia-binding": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/aurelia-binding/-/aurelia-binding-1.2.2.tgz", - "integrity": "sha1-9A2hsxqmgEbTKqBbz69b0/PklxY=", - "requires": { - "aurelia-logging": "^1.0.0", - "aurelia-metadata": "^1.0.0", - "aurelia-pal": "^1.0.0", - "aurelia-task-queue": "^1.0.0" - } - }, - "aurelia-dependency-injection": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/aurelia-dependency-injection/-/aurelia-dependency-injection-1.3.2.tgz", - "integrity": "sha1-X5yl3t5qHMxyoIOMmA3z3+eRh1Y=", - "requires": { - "aurelia-metadata": "^1.0.0", - "aurelia-pal": "^1.0.0" - } - }, - "aurelia-fetch-client": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/aurelia-fetch-client/-/aurelia-fetch-client-1.1.3.tgz", - "integrity": "sha1-O2pLi53kgJ6Za9oSmfBYOMOQewo=" - }, - "aurelia-framework": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/aurelia-framework/-/aurelia-framework-1.1.4.tgz", - "integrity": "sha1-TcYwscSCAxZ0ZuXfKHiAP/Qd/2U=", - "requires": { - "aurelia-binding": "^1.0.0", - "aurelia-dependency-injection": "^1.0.0", - "aurelia-loader": "^1.0.0", - "aurelia-logging": "^1.0.0", - "aurelia-metadata": "^1.0.0", - "aurelia-pal": "^1.0.0", - "aurelia-path": "^1.0.0", - "aurelia-task-queue": "^1.0.0", - "aurelia-templating": "^1.0.0" - } - }, - "aurelia-loader": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/aurelia-loader/-/aurelia-loader-1.0.0.tgz", - "integrity": "sha1-t4wqKBOqjkQSRyN91m/WLl1OGeo=", - "requires": { - "aurelia-metadata": "^1.0.0", - "aurelia-path": "^1.0.0" - } - }, - "aurelia-logging": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/aurelia-logging/-/aurelia-logging-1.3.1.tgz", - "integrity": "sha1-s0rnWTcroIdAqxIjOom60VSH/pg=" - }, - "aurelia-metadata": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/aurelia-metadata/-/aurelia-metadata-1.0.3.tgz", - "integrity": "sha1-Ho1Z2hiOKHGorXSbpCyoUISj8w4=", - "requires": { - "aurelia-pal": "^1.0.0" - } - }, - "aurelia-pal": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/aurelia-pal/-/aurelia-pal-1.4.0.tgz", - "integrity": "sha1-EUjyVshUwOAgoKj0Zcv0pu6vkYg=" - }, - "aurelia-path": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/aurelia-path/-/aurelia-path-1.1.7.tgz", - "integrity": "sha512-D6/Tz8jE8b2+Y8Pt6P/fxF6xfJGef+TA6YEljzo1kEzyzbxIvwfqc7pK6i/XGY3LowlumPqrhxkfMjPxLpFIcA==" - }, - "aurelia-task-queue": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aurelia-task-queue/-/aurelia-task-queue-1.2.0.tgz", - "integrity": "sha1-kjOsMOwQtiARO7qzcCSijmH1mGU=", - "requires": { - "aurelia-pal": "^1.0.0" - } - }, - "aurelia-templating": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/aurelia-templating/-/aurelia-templating-1.4.2.tgz", - "integrity": "sha1-R5zkdwWglf1jbgl1yct5y+5+18s=", - "requires": { - "aurelia-binding": "^1.0.0", - "aurelia-dependency-injection": "^1.0.0", - "aurelia-loader": "^1.0.0", - "aurelia-logging": "^1.0.0", - "aurelia-metadata": "^1.0.0", - "aurelia-pal": "^1.0.0", - "aurelia-path": "^1.0.0", - "aurelia-task-queue": "^1.1.0" - } - }, - "rxjs": { - "version": "5.4.3", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.4.3.tgz", - "integrity": "sha512-fSNi+y+P9ss+EZuV0GcIIqPUK07DEaMRUtLJvdcvMyFjc9dizuDjere+A4V7JrLGnm9iCc+nagV/4QdMTkqC4A==", - "requires": { - "symbol-observable": "^1.0.1" - } - }, - "symbol-observable": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.4.tgz", - "integrity": "sha1-Kb9hXUqnEhvdiYsi1LP5vE4qoD0=" - }, - "typescript": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.4.2.tgz", - "integrity": "sha1-+DlfhdRZJ2BnyYiqQYN6j4KHCEQ=", - "dev": true - }, - "zone.js": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.7.8.tgz", - "integrity": "sha1-Tz/og01EWX8mOQU6D6Q43zT//e0=" - } - } -} diff --git a/src/NSwag.Integration.TypeScriptWeb/package.json b/src/NSwag.Integration.TypeScriptWeb/package.json deleted file mode 100644 index 6a1a7b9094..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "nswag-integration-typescriptweb", - "version": "", - "repository": { - "type": "git", - "url": "git+https://github.com/RicoSuter/NSwag.git" - }, - "description": "Test generated TypeScript compilation", - "license": "MIT", - "devDependencies": { - "@types/angular": "^1.6.7", - "@types/jasmine": "^2.5.43", - "@types/jquery": "^2.0.40", - "@types/knockout": "^3.4.39", - "typescript": "^2.2.1" - }, - "dependencies": { - "aurelia-framework": "^1.1.0", - "aurelia-fetch-client": "^1.1.1", - "@angular/common": "^2.4.8", - "@angular/core": "^2.4.8", - "@angular/http": "^2.4.8", - "@angular/platform-browser": "^2.4.8", - "rxjs": "^5.2.0", - "zone.js": "^0.7.7" - } -} diff --git a/src/NSwag.Integration.TypeScriptWeb/packages.config b/src/NSwag.Integration.TypeScriptWeb/packages.config deleted file mode 100644 index d8a1b1b6ed..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAngular.extensions.ts b/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAngular.extensions.ts deleted file mode 100644 index ed6767d273..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAngular.extensions.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Observable } from 'rxjs/Observable'; // ignore -import { Response, RequestOptionsArgs } from '@angular/http'; // ignore - -export class MyBaseClass { - protected transformOptions(options: RequestOptionsArgs) { - return Promise.resolve(options); - } - - protected transformResult(url: string, response: Response, processor: (response: Response) => any): Observable { - return processor(response); - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAngular.ts b/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAngular.ts deleted file mode 100644 index 57c157a932..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAngular.ts +++ /dev/null @@ -1,1739 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -//---------------------- -// -// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- -// ReSharper disable InconsistentNaming - -import { mergeMap as _observableMergeMap, catchError as _observableCatch } from 'rxjs/operators'; -import { Observable, from as _observableFrom, throwError as _observableThrow, of as _observableOf } from 'rxjs'; -import { Injectable, Inject, Optional, OpaqueToken } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpResponse, HttpResponseBase } from '@angular/common/http'; - -export const API_BASE_URL = new OpaqueToken('API_BASE_URL'); - -export class MyBaseClass { - protected transformOptions(options: RequestOptionsArgs) { - return Promise.resolve(options); - } - - protected transformResult(url: string, response: Response, processor: (response: Response) => any): Observable { - return processor(response); - } -} - -@Injectable() -export class GeoClient extends MyBaseClass { - private http: HttpClient; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(@Inject(HttpClient) http: HttpClient, @Optional() @Inject(API_BASE_URL) baseUrl?: string) { - super(); - this.http = http; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "http://localhost:13452"; - } - - fromBodyTest(location?: GeoPoint | null | undefined): Observable { - let url_ = this.baseUrl + "/api/Geo/FromBodyTest"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(location); - - let options_ : any = { - body: content_, - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Content-Type": "application/json", - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processFromBodyTest(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processFromBodyTest(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processFromBodyTest(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - if (status === 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return _observableOf(null); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - fromUriTest(latitude?: number | undefined, longitude?: number | undefined): Observable { - let url_ = this.baseUrl + "/api/Geo/FromUriTest?"; - if (latitude === null) - throw new Error("The parameter 'latitude' cannot be null."); - else if (latitude !== undefined) - url_ += "Latitude=" + encodeURIComponent("" + latitude) + "&"; - if (longitude === null) - throw new Error("The parameter 'longitude' cannot be null."); - else if (longitude !== undefined) - url_ += "Longitude=" + encodeURIComponent("" + longitude) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ : any = { - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processFromUriTest(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processFromUriTest(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processFromUriTest(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - if (status === 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return _observableOf(null); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - addPolygon(points?: GeoPoint[] | null | undefined): Observable { - let url_ = this.baseUrl + "/api/Geo/AddPolygon"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(points); - - let options_ : any = { - body: content_, - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Content-Type": "application/json", - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processAddPolygon(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processAddPolygon(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processAddPolygon(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - if (status === 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return _observableOf(null); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - filter(currentStates?: string[] | null | undefined): Observable { - let url_ = this.baseUrl + "/api/Geo/Filter?"; - if (currentStates !== undefined && currentStates !== null) - currentStates && currentStates.forEach(item => { url_ += "currentStates=" + encodeURIComponent("" + item) + "&"; }); - url_ = url_.replace(/[?&]$/, ""); - - let options_ : any = { - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processFilter(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processFilter(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processFilter(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - if (status === 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return _observableOf(null); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - reverse(values?: string[] | null | undefined): Observable { - let url_ = this.baseUrl + "/api/Geo/Reverse?"; - if (values !== undefined && values !== null) - values && values.forEach(item => { url_ += "values=" + encodeURIComponent("" + item) + "&"; }); - url_ = url_.replace(/[?&]$/, ""); - - let options_ : any = { - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Accept": "application/json" - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processReverse(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processReverse(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processReverse(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - if (status === 200) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : jsonParse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(item); - } - else { - result200 = null; - } - return _observableOf(result200); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - refresh(): Observable { - let url_ = this.baseUrl + "/api/Geo/Refresh"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ : any = { - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processRefresh(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processRefresh(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processRefresh(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - if (status === 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return _observableOf(null); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - uploadFile(file?: FileParameter | null | undefined): Observable { - let url_ = this.baseUrl + "/api/Geo/UploadFile"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = new FormData(); - if (file !== null && file !== undefined) - content_.append("file", file.data, file.fileName ? file.fileName : "file"); - - let options_ : any = { - body: content_, - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Accept": "application/json" - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processUploadFile(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processUploadFile(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processUploadFile(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - if (status === 200) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : jsonParse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return _observableOf(result200); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - uploadFiles(files?: FileParameter[] | null | undefined): Observable { - let url_ = this.baseUrl + "/api/Geo/UploadFiles"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = new FormData(); - if (files !== null && files !== undefined) - files.forEach(item_ => content_.append("files", item_.data, item_.fileName ? item_.fileName : "files") ); - - let options_ : any = { - body: content_, - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processUploadFiles(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processUploadFiles(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processUploadFiles(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - if (status === 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return _observableOf(null); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - saveItems(request?: GenericRequestOfAddressAndPerson | null | undefined): Observable { - let url_ = this.baseUrl + "/api/Geo/SaveItems"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(request); - - let options_ : any = { - body: content_, - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Content-Type": "application/json", - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processSaveItems(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processSaveItems(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processSaveItems(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - let _mappings: { source: any, target: any }[] = []; - if (status === 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return _observableOf(null); - })); - } else if (status === 450) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - let result450: any = null; - let resultData450 = _responseText === "" ? null : jsonParse(_responseText, this.jsonParseReviver); - result450 = Exception.fromJS(resultData450, _mappings); - return throwException("A custom error occured.", status, _responseText, _headers, result450); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - getUploadedFile(id: number, override?: boolean | undefined): Observable { - let url_ = this.baseUrl + "/api/Geo/GetUploadedFile/{id}?"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - if (override === null) - throw new Error("The parameter 'override' cannot be null."); - else if (override !== undefined) - url_ += "override=" + encodeURIComponent("" + override) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ : any = { - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Accept": "application/json" - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("get", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processGetUploadedFile(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processGetUploadedFile(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processGetUploadedFile(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - if (status === 200 || status === 206) { - const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined; - const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined; - const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined; - return _observableOf({ fileName: fileName, data: responseBlob, status: status, headers: _headers }); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - postDouble(value?: number | null | undefined): Observable { - let url_ = this.baseUrl + "/api/Geo/PostDouble?"; - if (value !== undefined && value !== null) - url_ += "value=" + encodeURIComponent("" + value) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ : any = { - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Accept": "application/json" - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processPostDouble(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processPostDouble(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processPostDouble(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - if (status === 200) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : jsonParse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return _observableOf(result200); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } -} - -@Injectable() -export class PersonsClient extends MyBaseClass { - private http: HttpClient; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(@Inject(HttpClient) http: HttpClient, @Optional() @Inject(API_BASE_URL) baseUrl?: string) { - super(); - this.http = http; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "http://localhost:13452"; - } - - getAll(): Observable { - let url_ = this.baseUrl + "/api/Persons"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ : any = { - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Accept": "application/json" - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("get", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processGetAll(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processGetAll(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processGetAll(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - let _mappings: { source: any, target: any }[] = []; - if (status === 200) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : jsonParse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item, _mappings)); - } - else { - result200 = null; - } - return _observableOf(result200); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - add(person?: Person | null | undefined): Observable { - let url_ = this.baseUrl + "/api/Persons"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(person); - - let options_ : any = { - body: content_, - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Content-Type": "application/json", - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processAdd(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processAdd(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processAdd(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - if (status === 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return _observableOf(null); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - find(gender: Gender): Observable { - let url_ = this.baseUrl + "/api/Persons/find/{gender}"; - if (gender === undefined || gender === null) - throw new Error("The parameter 'gender' must be defined."); - url_ = url_.replace("{gender}", encodeURIComponent("" + gender)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ : any = { - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Accept": "application/json" - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processFind(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processFind(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processFind(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - let _mappings: { source: any, target: any }[] = []; - if (status === 200) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : jsonParse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item, _mappings)); - } - else { - result200 = null; - } - return _observableOf(result200); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - findOptional(gender: Gender | null): Observable { - let url_ = this.baseUrl + "/api/Persons/find2?"; - if (gender === undefined) - throw new Error("The parameter 'gender' must be defined."); - else if(gender !== null) - url_ += "gender=" + encodeURIComponent("" + gender) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ : any = { - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Accept": "application/json" - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processFindOptional(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processFindOptional(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processFindOptional(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - let _mappings: { source: any, target: any }[] = []; - if (status === 200) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : jsonParse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item, _mappings)); - } - else { - result200 = null; - } - return _observableOf(result200); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - get(id: string): Observable { - let url_ = this.baseUrl + "/api/Persons/{id}"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ : any = { - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Accept": "application/json" - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("get", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processGet(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processGet(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processGet(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - let _mappings: { source: any, target: any }[] = []; - if (status === 500) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - let result500: any = null; - let resultData500 = _responseText === "" ? null : jsonParse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500, _mappings); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - })); - } else if (status === 200) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : jsonParse(_responseText, this.jsonParseReviver); - result200 = resultData200 ? Person.fromJS(resultData200, _mappings) : null; - return _observableOf(result200); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - delete(id: string): Observable { - let url_ = this.baseUrl + "/api/Persons/{id}"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ : any = { - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("delete", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processDelete(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processDelete(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processDelete(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - if (status === 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return _observableOf(null); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - transform(person?: Person | null | undefined): Observable { - let url_ = this.baseUrl + "/api/Persons/transform"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(person); - - let options_ : any = { - body: content_, - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Content-Type": "application/json", - "Accept": "application/json" - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processTransform(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processTransform(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processTransform(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - let _mappings: { source: any, target: any }[] = []; - if (status === 200) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : jsonParse(_responseText, this.jsonParseReviver); - result200 = resultData200 ? Person.fromJS(resultData200, _mappings) : null; - return _observableOf(result200); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - throw(id: string): Observable { - let url_ = this.baseUrl + "/api/Persons/Throw?"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined and cannot be null."); - else - url_ += "id=" + encodeURIComponent("" + id) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ : any = { - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Accept": "application/json" - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processThrow(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processThrow(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processThrow(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - let _mappings: { source: any, target: any }[] = []; - if (status === 200) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : jsonParse(_responseText, this.jsonParseReviver); - result200 = Person.fromJS(resultData200, _mappings); - return _observableOf(result200); - })); - } else if (status === 500) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - let result500: any = null; - let resultData500 = _responseText === "" ? null : jsonParse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500, _mappings); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - /** - * Gets the name of a person. - * @param id The person ID. - * @return The person's name. - */ - getName(id: string): Observable { - let url_ = this.baseUrl + "/api/Persons/{id}/Name"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ : any = { - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Accept": "application/json" - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("get", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processGetName(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processGetName(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processGetName(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - let _mappings: { source: any, target: any }[] = []; - if (status === 200) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : jsonParse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return _observableOf(result200); - })); - } else if (status === 500) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - let result500: any = null; - let resultData500 = _responseText === "" ? null : jsonParse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500, _mappings); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - addXml(person?: string | null | undefined): Observable { - let url_ = this.baseUrl + "/api/Persons/AddXml"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = person; - - let options_ : any = { - body: content_, - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Content-Type": "application/xml", - "Accept": "application/json" - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processAddXml(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processAddXml(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processAddXml(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - if (status === 200) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : jsonParse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return _observableOf(result200); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } - - upload(data?: Blob | null | undefined): Observable { - let url_ = this.baseUrl + "/api/Persons/upload"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = data; - - let options_ : any = { - body: content_, - observe: "response", - responseType: "blob", - headers: new HttpHeaders({ - "Content-Type": "application/octet-stream", - "Accept": "application/json" - }) - }; - - return _observableFrom(this.transformOptions(options_)).pipe(_observableMergeMap(transformedOptions_ => { - return this.http.request("post", url_, transformedOptions_); - })).pipe(_observableMergeMap((response_: any) => { - return this.transformResult(url_, response_, (r) => this.processUpload(r)); - })).pipe(_observableCatch((response_: any) => { - if (response_ instanceof HttpResponseBase) { - try { - return this.transformResult(url_, response_, (r) => this.processUpload(r)); - } catch (e) { - return >_observableThrow(e); - } - } else - return >_observableThrow(response_); - })); - } - - protected processUpload(response: HttpResponseBase): Observable { - const status = response.status; - const responseBlob = - response instanceof HttpResponse ? response.body : - (response).error instanceof Blob ? (response).error : undefined; - - let _headers: any = {}; if (response.headers) { for (let key of response.headers.keys()) { _headers[key] = response.headers.get(key); }} - if (status === 200) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : jsonParse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return _observableOf(result200); - })); - } else if (status !== 200 && status !== 204) { - return blobToText(responseBlob).pipe(_observableMergeMap(_responseText => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - })); - } - return _observableOf(null); - } -} - -export class GeoPoint implements IGeoPoint { - latitude: number; - longitude: number; - - constructor(data?: IGeoPoint) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any, _mappings?: any) { - if (_data) { - this.latitude = _data["Latitude"]; - this.longitude = _data["Longitude"]; - } - } - - static fromJS(data: any, _mappings?: any): GeoPoint | null { - data = typeof data === 'object' ? data : {}; - return createInstance(data, _mappings, GeoPoint); - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Latitude"] = this.latitude; - data["Longitude"] = this.longitude; - return data; - } -} - -export interface IGeoPoint { - latitude: number; - longitude: number; -} - -export class Exception implements IException { - message: string | undefined; - innerException: Exception | undefined; - stackTrace: string | undefined; - source: string | undefined; - - constructor(data?: IException) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any, _mappings?: any) { - if (_data) { - this.message = _data["Message"]; - this.innerException = _data["InnerException"] ? Exception.fromJS(_data["InnerException"], _mappings) : undefined; - this.stackTrace = _data["StackTrace"]; - this.source = _data["Source"]; - } - } - - static fromJS(data: any, _mappings?: any): Exception | null { - data = typeof data === 'object' ? data : {}; - return createInstance(data, _mappings, Exception); - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Message"] = this.message; - data["InnerException"] = this.innerException ? this.innerException.toJSON() : undefined; - data["StackTrace"] = this.stackTrace; - data["Source"] = this.source; - return data; - } -} - -export interface IException { - message: string | undefined; - innerException: Exception | undefined; - stackTrace: string | undefined; - source: string | undefined; -} - -export class GenericRequestOfAddressAndPerson implements IGenericRequestOfAddressAndPerson { - item1: Address | undefined; - item2: Person | undefined; - - constructor(data?: IGenericRequestOfAddressAndPerson) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any, _mappings?: any) { - if (_data) { - this.item1 = _data["Item1"] ? Address.fromJS(_data["Item1"], _mappings) : undefined; - this.item2 = _data["Item2"] ? Person.fromJS(_data["Item2"], _mappings) : undefined; - } - } - - static fromJS(data: any, _mappings?: any): GenericRequestOfAddressAndPerson | null { - data = typeof data === 'object' ? data : {}; - return createInstance(data, _mappings, GenericRequestOfAddressAndPerson); - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Item1"] = this.item1 ? this.item1.toJSON() : undefined; - data["Item2"] = this.item2 ? this.item2.toJSON() : undefined; - return data; - } -} - -export interface IGenericRequestOfAddressAndPerson { - item1: Address | undefined; - item2: Person | undefined; -} - -export class Address implements IAddress { - isPrimary: boolean; - city: string | undefined; - - constructor(data?: IAddress) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any, _mappings?: any) { - if (_data) { - this.isPrimary = _data["IsPrimary"]; - this.city = _data["City"]; - } - } - - static fromJS(data: any, _mappings?: any): Address | null { - data = typeof data === 'object' ? data : {}; - return createInstance
(data, _mappings, Address); - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["IsPrimary"] = this.isPrimary; - data["City"] = this.city; - return data; - } -} - -export interface IAddress { - isPrimary: boolean; - city: string | undefined; -} - -export class Person implements IPerson { - id: string; - /** Gets or sets the first name. */ - firstName: string; - /** Gets or sets the last name. */ - lastName: string; - gender: Gender; - dateOfBirth: Date; - weight: number; - height: number; - age: number; - averageSleepTime: string; - address: Address; - children: Person[]; - skills: { [key: string]: SkillLevel; } | undefined; - - protected _discriminator: string; - - constructor(data?: IPerson) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - if (!data) { - this.address = new Address(); - this.children = []; - } - this._discriminator = "Person"; - } - - init(_data?: any, _mappings?: any) { - if (_data) { - this.id = _data["Id"]; - this.firstName = _data["FirstName"]; - this.lastName = _data["LastName"]; - this.gender = _data["Gender"]; - this.dateOfBirth = _data["DateOfBirth"] ? new Date(_data["DateOfBirth"].toString()) : undefined; - this.weight = _data["Weight"]; - this.height = _data["Height"]; - this.age = _data["Age"]; - this.averageSleepTime = _data["AverageSleepTime"]; - this.address = _data["Address"] ? Address.fromJS(_data["Address"], _mappings) : new Address(); - if (Array.isArray(_data["Children"])) { - this.children = [] as any; - for (let item of _data["Children"]) - this.children.push(Person.fromJS(item, _mappings)); - } - if (_data["Skills"]) { - this.skills = {} as any; - for (let key in _data["Skills"]) { - if (_data["Skills"].hasOwnProperty(key)) - (this.skills)[key] = _data["Skills"][key]; - } - } - } - } - - static fromJS(data: any, _mappings?: any): Person | null { - data = typeof data === 'object' ? data : {}; - if (data["discriminator"] === "Teacher") - return createInstance(data, _mappings, Teacher); - return createInstance(data, _mappings, Person); - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["discriminator"] = this._discriminator; - data["Id"] = this.id; - data["FirstName"] = this.firstName; - data["LastName"] = this.lastName; - data["Gender"] = this.gender; - data["DateOfBirth"] = this.dateOfBirth ? this.dateOfBirth.toISOString() : undefined; - data["Weight"] = this.weight; - data["Height"] = this.height; - data["Age"] = this.age; - data["AverageSleepTime"] = this.averageSleepTime; - data["Address"] = this.address ? this.address.toJSON() : undefined; - if (Array.isArray(this.children)) { - data["Children"] = []; - for (let item of this.children) - data["Children"].push(item.toJSON()); - } - if (this.skills) { - data["Skills"] = {}; - for (let key in this.skills) { - if (this.skills.hasOwnProperty(key)) - (data["Skills"])[key] = this.skills[key]; - } - } - return data; - } -} - -export interface IPerson { - id: string; - /** Gets or sets the first name. */ - firstName: string; - /** Gets or sets the last name. */ - lastName: string; - gender: Gender; - dateOfBirth: Date; - weight: number; - height: number; - age: number; - averageSleepTime: string; - address: Address; - children: Person[]; - skills: { [key: string]: SkillLevel; } | undefined; -} - -export enum Gender { - Male = "Male", - Female = "Female", -} - -export enum SkillLevel { - Low = 0, - Medium = 1, - Height = 2, -} - -export class Teacher extends Person implements ITeacher { - course: string | undefined; - skillLevel: SkillLevel; - - constructor(data?: ITeacher) { - super(data); - if (!data) { - this.skillLevel = SkillLevel.Medium; - } - this._discriminator = "Teacher"; - } - - init(_data?: any, _mappings?: any) { - super.init(_data); - if (_data) { - this.course = _data["Course"]; - this.skillLevel = _data["SkillLevel"] !== undefined ? _data["SkillLevel"] : SkillLevel.Medium; - } - } - - static fromJS(data: any, _mappings?: any): Teacher | null { - data = typeof data === 'object' ? data : {}; - return createInstance(data, _mappings, Teacher); - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Course"] = this.course; - data["SkillLevel"] = this.skillLevel; - super.toJSON(data); - return data; - } -} - -export interface ITeacher extends IPerson { - course: string | undefined; - skillLevel: SkillLevel; -} - -export class PersonNotFoundException extends Exception implements IPersonNotFoundException { - id: string; - - constructor(data?: IPersonNotFoundException) { - super(data); - } - - init(_data?: any, _mappings?: any) { - super.init(_data); - if (_data) { - this.id = _data["id"]; - } - } - - static fromJS(data: any, _mappings?: any): PersonNotFoundException | null { - data = typeof data === 'object' ? data : {}; - return createInstance(data, _mappings, PersonNotFoundException); - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["id"] = this.id; - super.toJSON(data); - return data; - } -} - -export interface IPersonNotFoundException extends IException { - id: string; -} - -function jsonParse(json: any, reviver?: any) { - json = JSON.parse(json, reviver); - - var byid: any = {}; - var refs: any = []; - json = (function recurse(obj: any, prop?: any, parent?: any) { - if (typeof obj !== 'object' || !obj) - return obj; - - if ("$ref" in obj) { - let ref = obj.$ref; - if (ref in byid) - return byid[ref]; - refs.push([parent, prop, ref]); - return undefined; - } else if ("$id" in obj) { - let id = obj.$id; - delete obj.$id; - if ("$values" in obj) - obj = obj.$values; - byid[id] = obj; - } - - if (Array.isArray(obj)) { - obj = obj.map((v, i) => recurse(v, i, obj)); - } else { - for (var p in obj) { - if (obj.hasOwnProperty(p) && obj[p] && typeof obj[p] === 'object') - obj[p] = recurse(obj[p], p, obj); - } - } - - return obj; - })(json); - - for (let i = 0; i < refs.length; i++) { - const ref = refs[i]; - ref[0][ref[1]] = byid[ref[2]]; - } - - return json; -} - -function createInstance(data: any, mappings: any, type: any): T | null { - if (!mappings) - mappings = []; - if (!data) - return null; - - const mappingIndexName = "__mappingIndex"; - if (data[mappingIndexName]) - return mappings[data[mappingIndexName]].target; - - data[mappingIndexName] = mappings.length; - - let result: any = new type(); - mappings.push({ source: data, target: result }); - result.init(data, mappings); - return result; -} - -export interface FileParameter { - data: any; - fileName: string; -} - -export interface FileResponse { - data: Blob; - status: number; - fileName?: string; - headers?: { [name: string]: any }; -} - -export class SwaggerException extends Error { - message: string; - status: number; - response: string; - headers: { [key: string]: any; }; - result: any; - - constructor(message: string, status: number, response: string, headers: { [key: string]: any; }, result: any) { - super(); - - this.message = message; - this.status = status; - this.response = response; - this.headers = headers; - this.result = result; - } - - protected isSwaggerException = true; - - static isSwaggerException(obj: any): obj is SwaggerException { - return obj.isSwaggerException === true; - } -} - -function throwException(message: string, status: number, response: string, headers: { [key: string]: any; }, result?: any): Observable { - if (result !== null && result !== undefined) - return _observableThrow(result); - else - return _observableThrow(new SwaggerException(message, status, response, headers, null)); -} - -function blobToText(blob: any): Observable { - return new Observable((observer: any) => { - if (!blob) { - observer.next(""); - observer.complete(); - } else { - let reader = new FileReader(); - reader.onload = event => { - observer.next((event.target).result); - observer.complete(); - }; - reader.readAsText(blob); - } - }); -} \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAngularJS.ts b/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAngularJS.ts deleted file mode 100644 index a26e89f936..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAngularJS.ts +++ /dev/null @@ -1,1446 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -//---------------------- -// -// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- -// ReSharper disable InconsistentNaming - -import * as ng from 'angular'; - -export class GeoClient { - private baseUrl: string | undefined = undefined; - private http: ng.IHttpService; - private q: ng.IQService; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor($http: ng.IHttpService, $q: ng.IQService, baseUrl?: string) { - this.http = $http; - this.q = $q; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "http://localhost:13452"; - } - - fromBodyTest(location: GeoPoint | null | undefined): ng.IPromise { - let url_ = this.baseUrl + "/api/Geo/FromBodyTest"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(location); - - var options_ = { - url: url_, - method: "POST", - data: content_, - transformResponse: [], - headers: { - "Content-Type": "application/json", - } - }; - - return this.http(options_).then((_response) => { - return this.processFromBodyTest(_response); - }, (_response) => { - if (_response.status) - return this.processFromBodyTest(_response); - throw _response; - }); - } - - protected processFromBodyTest(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = response.data; - return this.q.resolve(null); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - fromUriTest(latitude: number | undefined, longitude: number | undefined): ng.IPromise { - let url_ = this.baseUrl + "/api/Geo/FromUriTest?"; - if (latitude === null) - throw new Error("The parameter 'latitude' cannot be null."); - else if (latitude !== undefined) - url_ += "Latitude=" + encodeURIComponent("" + latitude) + "&"; - if (longitude === null) - throw new Error("The parameter 'longitude' cannot be null."); - else if (longitude !== undefined) - url_ += "Longitude=" + encodeURIComponent("" + longitude) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - var options_ = { - url: url_, - method: "POST", - transformResponse: [], - headers: { - } - }; - - return this.http(options_).then((_response) => { - return this.processFromUriTest(_response); - }, (_response) => { - if (_response.status) - return this.processFromUriTest(_response); - throw _response; - }); - } - - protected processFromUriTest(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = response.data; - return this.q.resolve(null); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - addPolygon(points: GeoPoint[] | null | undefined): ng.IPromise { - let url_ = this.baseUrl + "/api/Geo/AddPolygon"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(points); - - var options_ = { - url: url_, - method: "POST", - data: content_, - transformResponse: [], - headers: { - "Content-Type": "application/json", - } - }; - - return this.http(options_).then((_response) => { - return this.processAddPolygon(_response); - }, (_response) => { - if (_response.status) - return this.processAddPolygon(_response); - throw _response; - }); - } - - protected processAddPolygon(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = response.data; - return this.q.resolve(null); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - filter(currentStates: string[] | null | undefined): ng.IPromise { - let url_ = this.baseUrl + "/api/Geo/Filter?"; - if (currentStates !== undefined && currentStates !== null) - currentStates && currentStates.forEach(item => { url_ += "currentStates=" + encodeURIComponent("" + item) + "&"; }); - url_ = url_.replace(/[?&]$/, ""); - - var options_ = { - url: url_, - method: "POST", - transformResponse: [], - headers: { - } - }; - - return this.http(options_).then((_response) => { - return this.processFilter(_response); - }, (_response) => { - if (_response.status) - return this.processFilter(_response); - throw _response; - }); - } - - protected processFilter(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = response.data; - return this.q.resolve(null); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - reverse(values: string[] | null | undefined): ng.IPromise { - let url_ = this.baseUrl + "/api/Geo/Reverse?"; - if (values !== undefined && values !== null) - values && values.forEach(item => { url_ += "values=" + encodeURIComponent("" + item) + "&"; }); - url_ = url_.replace(/[?&]$/, ""); - - var options_ = { - url: url_, - method: "POST", - transformResponse: [], - headers: { - "Accept": "application/json" - } - }; - - return this.http(options_).then((_response) => { - return this.processReverse(_response); - }, (_response) => { - if (_response.status) - return this.processReverse(_response); - throw _response; - }); - } - - protected processReverse(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(item); - } - else { - result200 = null; - } - return this.q.resolve(result200); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - refresh(): ng.IPromise { - let url_ = this.baseUrl + "/api/Geo/Refresh"; - url_ = url_.replace(/[?&]$/, ""); - - var options_ = { - url: url_, - method: "POST", - transformResponse: [], - headers: { - } - }; - - return this.http(options_).then((_response) => { - return this.processRefresh(_response); - }, (_response) => { - if (_response.status) - return this.processRefresh(_response); - throw _response; - }); - } - - protected processRefresh(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = response.data; - return this.q.resolve(null); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - uploadFile(file: FileParameter | null | undefined): ng.IPromise { - let url_ = this.baseUrl + "/api/Geo/UploadFile"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = new FormData(); - if (file !== null && file !== undefined) - content_.append("file", file.data, file.fileName ? file.fileName : "file"); - - var options_ = { - url: url_, - method: "POST", - data: content_, - transformResponse: [], - headers: { - "Accept": "application/json" - } - }; - - return this.http(options_).then((_response) => { - return this.processUploadFile(_response); - }, (_response) => { - if (_response.status) - return this.processUploadFile(_response); - throw _response; - }); - } - - protected processUploadFile(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return this.q.resolve(result200); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - uploadFiles(files: FileParameter[] | null | undefined): ng.IPromise { - let url_ = this.baseUrl + "/api/Geo/UploadFiles"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = new FormData(); - if (files !== null && files !== undefined) - files.forEach(item_ => content_.append("files", item_.data, item_.fileName ? item_.fileName : "files") ); - - var options_ = { - url: url_, - method: "POST", - data: content_, - transformResponse: [], - headers: { - } - }; - - return this.http(options_).then((_response) => { - return this.processUploadFiles(_response); - }, (_response) => { - if (_response.status) - return this.processUploadFiles(_response); - throw _response; - }); - } - - protected processUploadFiles(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = response.data; - return this.q.resolve(null); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - saveItems(request: GenericRequestOfAddressAndPerson | null | undefined): ng.IPromise { - let url_ = this.baseUrl + "/api/Geo/SaveItems"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(request); - - var options_ = { - url: url_, - method: "POST", - data: content_, - transformResponse: [], - headers: { - "Content-Type": "application/json", - } - }; - - return this.http(options_).then((_response) => { - return this.processSaveItems(_response); - }, (_response) => { - if (_response.status) - return this.processSaveItems(_response); - throw _response; - }); - } - - protected processSaveItems(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = response.data; - return this.q.resolve(null); - - } else if (status === 450) { - const _responseText = response.data; - let result450: any = null; - let resultData450 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result450 = Exception.fromJS(resultData450); - return throwException(this.q, "A custom error occured.", status, _responseText, _headers, result450); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - getUploadedFile(id: number, override: boolean | undefined): ng.IPromise { - let url_ = this.baseUrl + "/api/Geo/GetUploadedFile/{id}?"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - if (override === null) - throw new Error("The parameter 'override' cannot be null."); - else if (override !== undefined) - url_ += "override=" + encodeURIComponent("" + override) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - var options_ = { - url: url_, - method: "GET", - responseType: "arraybuffer", - transformResponse: [], - headers: { - "Accept": "application/json" - } - }; - - return this.http(options_).then((_response) => { - return this.processGetUploadedFile(_response); - }, (_response) => { - if (_response.status) - return this.processGetUploadedFile(_response); - throw _response; - }); - } - - protected processGetUploadedFile(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 200 || status === 206) { - const contentDisposition = response.headers ? response.headers("content-disposition") : undefined; - const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined; - const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined; - return this.q.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers }); - } else if (status !== 200 && status !== 204) { - return blobToText(new Blob([response.data]), this.q).then(_responseText => { - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return this.q.resolve(null); - } - - postDouble(value: number | null | undefined): ng.IPromise { - let url_ = this.baseUrl + "/api/Geo/PostDouble?"; - if (value !== undefined && value !== null) - url_ += "value=" + encodeURIComponent("" + value) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - var options_ = { - url: url_, - method: "POST", - transformResponse: [], - headers: { - "Accept": "application/json" - } - }; - - return this.http(options_).then((_response) => { - return this.processPostDouble(_response); - }, (_response) => { - if (_response.status) - return this.processPostDouble(_response); - throw _response; - }); - } - - protected processPostDouble(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return this.q.resolve(result200); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } -} - -export class PersonsClient { - private baseUrl: string | undefined = undefined; - private http: ng.IHttpService; - private q: ng.IQService; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor($http: ng.IHttpService, $q: ng.IQService, baseUrl?: string) { - this.http = $http; - this.q = $q; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "http://localhost:13452"; - } - - getAll(): ng.IPromise { - let url_ = this.baseUrl + "/api/Persons"; - url_ = url_.replace(/[?&]$/, ""); - - var options_ = { - url: url_, - method: "GET", - transformResponse: [], - headers: { - "Accept": "application/json" - } - }; - - return this.http(options_).then((_response) => { - return this.processGetAll(_response); - }, (_response) => { - if (_response.status) - return this.processGetAll(_response); - throw _response; - }); - } - - protected processGetAll(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return this.q.resolve(result200); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - add(person: Person | null | undefined): ng.IPromise { - let url_ = this.baseUrl + "/api/Persons"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(person); - - var options_ = { - url: url_, - method: "POST", - data: content_, - transformResponse: [], - headers: { - "Content-Type": "application/json", - } - }; - - return this.http(options_).then((_response) => { - return this.processAdd(_response); - }, (_response) => { - if (_response.status) - return this.processAdd(_response); - throw _response; - }); - } - - protected processAdd(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = response.data; - return this.q.resolve(null); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - find(gender: Gender): ng.IPromise { - let url_ = this.baseUrl + "/api/Persons/find/{gender}"; - if (gender === undefined || gender === null) - throw new Error("The parameter 'gender' must be defined."); - url_ = url_.replace("{gender}", encodeURIComponent("" + gender)); - url_ = url_.replace(/[?&]$/, ""); - - var options_ = { - url: url_, - method: "POST", - transformResponse: [], - headers: { - "Accept": "application/json" - } - }; - - return this.http(options_).then((_response) => { - return this.processFind(_response); - }, (_response) => { - if (_response.status) - return this.processFind(_response); - throw _response; - }); - } - - protected processFind(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return this.q.resolve(result200); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - findOptional(gender: Gender | null): ng.IPromise { - let url_ = this.baseUrl + "/api/Persons/find2?"; - if (gender === undefined) - throw new Error("The parameter 'gender' must be defined."); - else if(gender !== null) - url_ += "gender=" + encodeURIComponent("" + gender) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - var options_ = { - url: url_, - method: "POST", - transformResponse: [], - headers: { - "Accept": "application/json" - } - }; - - return this.http(options_).then((_response) => { - return this.processFindOptional(_response); - }, (_response) => { - if (_response.status) - return this.processFindOptional(_response); - throw _response; - }); - } - - protected processFindOptional(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return this.q.resolve(result200); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - get(id: string): ng.IPromise { - let url_ = this.baseUrl + "/api/Persons/{id}"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - var options_ = { - url: url_, - method: "GET", - transformResponse: [], - headers: { - "Accept": "application/json" - } - }; - - return this.http(options_).then((_response) => { - return this.processGet(_response); - }, (_response) => { - if (_response.status) - return this.processGet(_response); - throw _response; - }); - } - - protected processGet(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException(this.q, "A server side error occurred.", status, _responseText, _headers, result500); - - } else if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 ? Person.fromJS(resultData200) : null; - return this.q.resolve(result200); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - delete(id: string): ng.IPromise { - let url_ = this.baseUrl + "/api/Persons/{id}"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - var options_ = { - url: url_, - method: "DELETE", - transformResponse: [], - headers: { - } - }; - - return this.http(options_).then((_response) => { - return this.processDelete(_response); - }, (_response) => { - if (_response.status) - return this.processDelete(_response); - throw _response; - }); - } - - protected processDelete(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = response.data; - return this.q.resolve(null); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - transform(person: Person | null | undefined): ng.IPromise { - let url_ = this.baseUrl + "/api/Persons/transform"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(person); - - var options_ = { - url: url_, - method: "POST", - data: content_, - transformResponse: [], - headers: { - "Content-Type": "application/json", - "Accept": "application/json" - } - }; - - return this.http(options_).then((_response) => { - return this.processTransform(_response); - }, (_response) => { - if (_response.status) - return this.processTransform(_response); - throw _response; - }); - } - - protected processTransform(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 ? Person.fromJS(resultData200) : null; - return this.q.resolve(result200); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - throw(id: string): ng.IPromise { - let url_ = this.baseUrl + "/api/Persons/Throw?"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined and cannot be null."); - else - url_ += "id=" + encodeURIComponent("" + id) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - var options_ = { - url: url_, - method: "POST", - transformResponse: [], - headers: { - "Accept": "application/json" - } - }; - - return this.http(options_).then((_response) => { - return this.processThrow(_response); - }, (_response) => { - if (_response.status) - return this.processThrow(_response); - throw _response; - }); - } - - protected processThrow(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = Person.fromJS(resultData200); - return this.q.resolve(result200); - - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException(this.q, "A server side error occurred.", status, _responseText, _headers, result500); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - /** - * Gets the name of a person. - * @param id The person ID. - * @return The person's name. - */ - getName(id: string): ng.IPromise { - let url_ = this.baseUrl + "/api/Persons/{id}/Name"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - var options_ = { - url: url_, - method: "GET", - transformResponse: [], - headers: { - "Accept": "application/json" - } - }; - - return this.http(options_).then((_response) => { - return this.processGetName(_response); - }, (_response) => { - if (_response.status) - return this.processGetName(_response); - throw _response; - }); - } - - protected processGetName(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return this.q.resolve(result200); - - } else if (status === 500) { - const _responseText = response.data; - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException(this.q, "A server side error occurred.", status, _responseText, _headers, result500); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - addXml(person: string | null | undefined): ng.IPromise { - let url_ = this.baseUrl + "/api/Persons/AddXml"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = person; - - var options_ = { - url: url_, - method: "POST", - data: content_, - transformResponse: [], - headers: { - "Content-Type": "application/xml", - "Accept": "application/json" - } - }; - - return this.http(options_).then((_response) => { - return this.processAddXml(_response); - }, (_response) => { - if (_response.status) - return this.processAddXml(_response); - throw _response; - }); - } - - protected processAddXml(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return this.q.resolve(result200); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } - - upload(data: Blob | null | undefined): ng.IPromise { - let url_ = this.baseUrl + "/api/Persons/upload"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = data; - - var options_ = { - url: url_, - method: "POST", - data: content_, - transformResponse: [], - headers: { - "Content-Type": "application/octet-stream", - "Accept": "application/json" - } - }; - - return this.http(options_).then((_response) => { - return this.processUpload(_response); - }, (_response) => { - if (_response.status) - return this.processUpload(_response); - throw _response; - }); - } - - protected processUpload(response: any): ng.IPromise { - const status = response.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = response.data; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return this.q.resolve(result200); - - } else if (status !== 200 && status !== 204) { - const _responseText = response.data; - return throwException(this.q, "An unexpected server error occurred.", status, _responseText, _headers); - } - return this.q.resolve(null); - } -} - -export class GeoPoint implements IGeoPoint { - latitude: number; - longitude: number; - - constructor(data?: IGeoPoint) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.latitude = _data["Latitude"]; - this.longitude = _data["Longitude"]; - } - } - - static fromJS(data: any): GeoPoint { - data = typeof data === 'object' ? data : {}; - let result = new GeoPoint(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Latitude"] = this.latitude; - data["Longitude"] = this.longitude; - return data; - } -} - -export interface IGeoPoint { - latitude: number; - longitude: number; -} - -export class Exception implements IException { - message: string | undefined; - innerException: Exception | undefined; - stackTrace: string | undefined; - source: string | undefined; - - constructor(data?: IException) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.message = _data["Message"]; - this.innerException = _data["InnerException"] ? Exception.fromJS(_data["InnerException"]) : undefined; - this.stackTrace = _data["StackTrace"]; - this.source = _data["Source"]; - } - } - - static fromJS(data: any): Exception { - data = typeof data === 'object' ? data : {}; - let result = new Exception(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Message"] = this.message; - data["InnerException"] = this.innerException ? this.innerException.toJSON() : undefined; - data["StackTrace"] = this.stackTrace; - data["Source"] = this.source; - return data; - } -} - -export interface IException { - message: string | undefined; - innerException: Exception | undefined; - stackTrace: string | undefined; - source: string | undefined; -} - -export class GenericRequestOfAddressAndPerson implements IGenericRequestOfAddressAndPerson { - item1: Address | undefined; - item2: Person | undefined; - - constructor(data?: IGenericRequestOfAddressAndPerson) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.item1 = _data["Item1"] ? Address.fromJS(_data["Item1"]) : undefined; - this.item2 = _data["Item2"] ? Person.fromJS(_data["Item2"]) : undefined; - } - } - - static fromJS(data: any): GenericRequestOfAddressAndPerson { - data = typeof data === 'object' ? data : {}; - let result = new GenericRequestOfAddressAndPerson(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Item1"] = this.item1 ? this.item1.toJSON() : undefined; - data["Item2"] = this.item2 ? this.item2.toJSON() : undefined; - return data; - } -} - -export interface IGenericRequestOfAddressAndPerson { - item1: Address | undefined; - item2: Person | undefined; -} - -export class Address implements IAddress { - isPrimary: boolean; - city: string | undefined; - - constructor(data?: IAddress) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.isPrimary = _data["IsPrimary"]; - this.city = _data["City"]; - } - } - - static fromJS(data: any): Address { - data = typeof data === 'object' ? data : {}; - let result = new Address(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["IsPrimary"] = this.isPrimary; - data["City"] = this.city; - return data; - } -} - -export interface IAddress { - isPrimary: boolean; - city: string | undefined; -} - -export class Person implements IPerson { - id: string; - /** Gets or sets the first name. */ - firstName: string; - /** Gets or sets the last name. */ - lastName: string; - gender: Gender; - dateOfBirth: Date; - weight: number; - height: number; - age: number; - averageSleepTime: string; - address: Address; - children: Person[]; - skills: { [key: string]: SkillLevel; } | undefined; - - protected _discriminator: string; - - constructor(data?: IPerson) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - if (!data) { - this.address = new Address(); - this.children = []; - } - this._discriminator = "Person"; - } - - init(_data?: any) { - if (_data) { - this.id = _data["Id"]; - this.firstName = _data["FirstName"]; - this.lastName = _data["LastName"]; - this.gender = _data["Gender"]; - this.dateOfBirth = _data["DateOfBirth"] ? new Date(_data["DateOfBirth"].toString()) : undefined; - this.weight = _data["Weight"]; - this.height = _data["Height"]; - this.age = _data["Age"]; - this.averageSleepTime = _data["AverageSleepTime"]; - this.address = _data["Address"] ? Address.fromJS(_data["Address"]) : new Address(); - if (Array.isArray(_data["Children"])) { - this.children = [] as any; - for (let item of _data["Children"]) - this.children.push(Person.fromJS(item)); - } - if (_data["Skills"]) { - this.skills = {} as any; - for (let key in _data["Skills"]) { - if (_data["Skills"].hasOwnProperty(key)) - (this.skills)[key] = _data["Skills"][key]; - } - } - } - } - - static fromJS(data: any): Person { - data = typeof data === 'object' ? data : {}; - if (data["discriminator"] === "Teacher") { - let result = new Teacher(); - result.init(data); - return result; - } - let result = new Person(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["discriminator"] = this._discriminator; - data["Id"] = this.id; - data["FirstName"] = this.firstName; - data["LastName"] = this.lastName; - data["Gender"] = this.gender; - data["DateOfBirth"] = this.dateOfBirth ? this.dateOfBirth.toISOString() : undefined; - data["Weight"] = this.weight; - data["Height"] = this.height; - data["Age"] = this.age; - data["AverageSleepTime"] = this.averageSleepTime; - data["Address"] = this.address ? this.address.toJSON() : undefined; - if (Array.isArray(this.children)) { - data["Children"] = []; - for (let item of this.children) - data["Children"].push(item.toJSON()); - } - if (this.skills) { - data["Skills"] = {}; - for (let key in this.skills) { - if (this.skills.hasOwnProperty(key)) - (data["Skills"])[key] = this.skills[key]; - } - } - return data; - } -} - -export interface IPerson { - id: string; - /** Gets or sets the first name. */ - firstName: string; - /** Gets or sets the last name. */ - lastName: string; - gender: Gender; - dateOfBirth: Date; - weight: number; - height: number; - age: number; - averageSleepTime: string; - address: Address; - children: Person[]; - skills: { [key: string]: SkillLevel; } | undefined; -} - -export enum Gender { - Male = "Male", - Female = "Female", -} - -export enum SkillLevel { - Low = 0, - Medium = 1, - Height = 2, -} - -export class Teacher extends Person implements ITeacher { - course: string | undefined; - skillLevel: SkillLevel; - - constructor(data?: ITeacher) { - super(data); - if (!data) { - this.skillLevel = SkillLevel.Medium; - } - this._discriminator = "Teacher"; - } - - init(_data?: any) { - super.init(_data); - if (_data) { - this.course = _data["Course"]; - this.skillLevel = _data["SkillLevel"] !== undefined ? _data["SkillLevel"] : SkillLevel.Medium; - } - } - - static fromJS(data: any): Teacher { - data = typeof data === 'object' ? data : {}; - let result = new Teacher(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Course"] = this.course; - data["SkillLevel"] = this.skillLevel; - super.toJSON(data); - return data; - } -} - -export interface ITeacher extends IPerson { - course: string | undefined; - skillLevel: SkillLevel; -} - -export class PersonNotFoundException extends Exception implements IPersonNotFoundException { - id: string; - - constructor(data?: IPersonNotFoundException) { - super(data); - } - - init(_data?: any) { - super.init(_data); - if (_data) { - this.id = _data["id"]; - } - } - - static fromJS(data: any): PersonNotFoundException { - data = typeof data === 'object' ? data : {}; - let result = new PersonNotFoundException(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["id"] = this.id; - super.toJSON(data); - return data; - } -} - -export interface IPersonNotFoundException extends IException { - id: string; -} - -export interface FileParameter { - data: any; - fileName: string; -} - -export interface FileResponse { - data: Blob; - status: number; - fileName?: string; - headers?: { [name: string]: any }; -} - -export class SwaggerException extends Error { - message: string; - status: number; - response: string; - headers: { [key: string]: any; }; - result: any; - - constructor(message: string, status: number, response: string, headers: { [key: string]: any; }, result: any) { - super(); - - this.message = message; - this.status = status; - this.response = response; - this.headers = headers; - this.result = result; - } - - protected isSwaggerException = true; - - static isSwaggerException(obj: any): obj is SwaggerException { - return obj.isSwaggerException === true; - } -} - -function throwException(q: ng.IQService, message: string, status: number, response: string, headers: { [key: string]: any; }, result?: any): ng.IPromise { - if (result !== null && result !== undefined) - return q.reject(result); - else - return q.reject(new SwaggerException(message, status, response, headers, null)); -} - -function blobToText(blob: Blob, q: ng.IQService): ng.IPromise { - return new q((resolve) => { - let reader = new FileReader(); - reader.onload = event => resolve((event.target).result); - reader.readAsText(blob); - }); -} \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAurelia.ts b/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAurelia.ts deleted file mode 100644 index a92f5aabdf..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAurelia.ts +++ /dev/null @@ -1,1303 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -//---------------------- -// -// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- -// ReSharper disable InconsistentNaming - -import { inject } from 'aurelia-framework'; -import { HttpClient, RequestInit } from 'aurelia-fetch-client'; - -@inject(String, HttpClient) -export class GeoClient { - private http: { fetch(url: RequestInfo, init?: RequestInit): Promise }; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { - this.http = http ? http : window; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "http://localhost:13452"; - } - - fromBodyTest(location: GeoPoint | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/FromBodyTest"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(location); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/json", - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processFromBodyTest(_response); - }); - } - - protected processFromBodyTest(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - fromUriTest(latitude: number | undefined, longitude: number | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/FromUriTest?"; - if (latitude === null) - throw new Error("The parameter 'latitude' cannot be null."); - else if (latitude !== undefined) - url_ += "Latitude=" + encodeURIComponent("" + latitude) + "&"; - if (longitude === null) - throw new Error("The parameter 'longitude' cannot be null."); - else if (longitude !== undefined) - url_ += "Longitude=" + encodeURIComponent("" + longitude) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "POST", - headers: { - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processFromUriTest(_response); - }); - } - - protected processFromUriTest(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - addPolygon(points: GeoPoint[] | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/AddPolygon"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(points); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/json", - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processAddPolygon(_response); - }); - } - - protected processAddPolygon(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - filter(currentStates: string[] | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/Filter?"; - if (currentStates !== undefined && currentStates !== null) - currentStates && currentStates.forEach(item => { url_ += "currentStates=" + encodeURIComponent("" + item) + "&"; }); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "POST", - headers: { - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processFilter(_response); - }); - } - - protected processFilter(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - reverse(values: string[] | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/Reverse?"; - if (values !== undefined && values !== null) - values && values.forEach(item => { url_ += "values=" + encodeURIComponent("" + item) + "&"; }); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "POST", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processReverse(_response); - }); - } - - protected processReverse(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(item); - } - else { - result200 = null; - } - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - refresh(): Promise { - let url_ = this.baseUrl + "/api/Geo/Refresh"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "POST", - headers: { - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processRefresh(_response); - }); - } - - protected processRefresh(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - uploadFile(file: FileParameter | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/UploadFile"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = new FormData(); - if (file !== null && file !== undefined) - content_.append("file", file.data, file.fileName ? file.fileName : "file"); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processUploadFile(_response); - }); - } - - protected processUploadFile(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - uploadFiles(files: FileParameter[] | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/UploadFiles"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = new FormData(); - if (files !== null && files !== undefined) - files.forEach(item_ => content_.append("files", item_.data, item_.fileName ? item_.fileName : "files") ); - - let options_ = { - body: content_, - method: "POST", - headers: { - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processUploadFiles(_response); - }); - } - - protected processUploadFiles(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - saveItems(request: GenericRequestOfAddressAndPerson | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/SaveItems"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(request); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/json", - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processSaveItems(_response); - }); - } - - protected processSaveItems(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status === 450) { - return response.text().then((_responseText) => { - let result450: any = null; - let resultData450 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result450 = Exception.fromJS(resultData450); - return throwException("A custom error occured.", status, _responseText, _headers, result450); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - getUploadedFile(id: number, override: boolean | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/GetUploadedFile/{id}?"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - if (override === null) - throw new Error("The parameter 'override' cannot be null."); - else if (override !== undefined) - url_ += "override=" + encodeURIComponent("" + override) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processGetUploadedFile(_response); - }); - } - - protected processGetUploadedFile(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200 || status === 206) { - const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined; - const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined; - const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined; - return response.blob().then(blob => { return { fileName: fileName, data: blob, status: status, headers: _headers }; }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - postDouble(value: number | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/PostDouble?"; - if (value !== undefined && value !== null) - url_ += "value=" + encodeURIComponent("" + value) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "POST", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processPostDouble(_response); - }); - } - - protected processPostDouble(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } -} - -@inject(String, HttpClient) -export class PersonsClient { - private http: { fetch(url: RequestInfo, init?: RequestInit): Promise }; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { - this.http = http ? http : window; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "http://localhost:13452"; - } - - getAll(): Promise { - let url_ = this.baseUrl + "/api/Persons"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processGetAll(_response); - }); - } - - protected processGetAll(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - add(person: Person | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Persons"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(person); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/json", - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processAdd(_response); - }); - } - - protected processAdd(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - find(gender: Gender): Promise { - let url_ = this.baseUrl + "/api/Persons/find/{gender}"; - if (gender === undefined || gender === null) - throw new Error("The parameter 'gender' must be defined."); - url_ = url_.replace("{gender}", encodeURIComponent("" + gender)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "POST", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processFind(_response); - }); - } - - protected processFind(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - findOptional(gender: Gender | null): Promise { - let url_ = this.baseUrl + "/api/Persons/find2?"; - if (gender === undefined) - throw new Error("The parameter 'gender' must be defined."); - else if(gender !== null) - url_ += "gender=" + encodeURIComponent("" + gender) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "POST", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processFindOptional(_response); - }); - } - - protected processFindOptional(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - get(id: string): Promise { - let url_ = this.baseUrl + "/api/Persons/{id}"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processGet(_response); - }); - } - - protected processGet(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 500) { - return response.text().then((_responseText) => { - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - }); - } else if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 ? Person.fromJS(resultData200) : null; - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - delete(id: string): Promise { - let url_ = this.baseUrl + "/api/Persons/{id}"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "DELETE", - headers: { - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processDelete(_response); - }); - } - - protected processDelete(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - transform(person: Person | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Persons/transform"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(person); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/json", - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processTransform(_response); - }); - } - - protected processTransform(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 ? Person.fromJS(resultData200) : null; - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - throw(id: string): Promise { - let url_ = this.baseUrl + "/api/Persons/Throw?"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined and cannot be null."); - else - url_ += "id=" + encodeURIComponent("" + id) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "POST", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processThrow(_response); - }); - } - - protected processThrow(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = Person.fromJS(resultData200); - return result200; - }); - } else if (status === 500) { - return response.text().then((_responseText) => { - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Gets the name of a person. - * @param id The person ID. - * @return The person's name. - */ - getName(id: string): Promise { - let url_ = this.baseUrl + "/api/Persons/{id}/Name"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processGetName(_response); - }); - } - - protected processGetName(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - }); - } else if (status === 500) { - return response.text().then((_responseText) => { - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - addXml(person: string | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Persons/AddXml"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = person; - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/xml", - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processAddXml(_response); - }); - } - - protected processAddXml(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - upload(data: Blob | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Persons/upload"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = data; - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/octet-stream", - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processUpload(_response); - }); - } - - protected processUpload(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } -} - -export class GeoPoint implements IGeoPoint { - latitude: number; - longitude: number; - - constructor(data?: IGeoPoint) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.latitude = _data["Latitude"]; - this.longitude = _data["Longitude"]; - } - } - - static fromJS(data: any): GeoPoint { - data = typeof data === 'object' ? data : {}; - let result = new GeoPoint(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Latitude"] = this.latitude; - data["Longitude"] = this.longitude; - return data; - } -} - -export interface IGeoPoint { - latitude: number; - longitude: number; -} - -export class Exception implements IException { - message: string | undefined; - innerException: Exception | undefined; - stackTrace: string | undefined; - source: string | undefined; - - constructor(data?: IException) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.message = _data["Message"]; - this.innerException = _data["InnerException"] ? Exception.fromJS(_data["InnerException"]) : undefined; - this.stackTrace = _data["StackTrace"]; - this.source = _data["Source"]; - } - } - - static fromJS(data: any): Exception { - data = typeof data === 'object' ? data : {}; - let result = new Exception(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Message"] = this.message; - data["InnerException"] = this.innerException ? this.innerException.toJSON() : undefined; - data["StackTrace"] = this.stackTrace; - data["Source"] = this.source; - return data; - } -} - -export interface IException { - message: string | undefined; - innerException: Exception | undefined; - stackTrace: string | undefined; - source: string | undefined; -} - -export class GenericRequestOfAddressAndPerson implements IGenericRequestOfAddressAndPerson { - item1: Address | undefined; - item2: Person | undefined; - - constructor(data?: IGenericRequestOfAddressAndPerson) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.item1 = _data["Item1"] ? Address.fromJS(_data["Item1"]) : undefined; - this.item2 = _data["Item2"] ? Person.fromJS(_data["Item2"]) : undefined; - } - } - - static fromJS(data: any): GenericRequestOfAddressAndPerson { - data = typeof data === 'object' ? data : {}; - let result = new GenericRequestOfAddressAndPerson(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Item1"] = this.item1 ? this.item1.toJSON() : undefined; - data["Item2"] = this.item2 ? this.item2.toJSON() : undefined; - return data; - } -} - -export interface IGenericRequestOfAddressAndPerson { - item1: Address | undefined; - item2: Person | undefined; -} - -export class Address implements IAddress { - isPrimary: boolean; - city: string | undefined; - - constructor(data?: IAddress) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.isPrimary = _data["IsPrimary"]; - this.city = _data["City"]; - } - } - - static fromJS(data: any): Address { - data = typeof data === 'object' ? data : {}; - let result = new Address(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["IsPrimary"] = this.isPrimary; - data["City"] = this.city; - return data; - } -} - -export interface IAddress { - isPrimary: boolean; - city: string | undefined; -} - -export class Person implements IPerson { - id: string; - /** Gets or sets the first name. */ - firstName: string; - /** Gets or sets the last name. */ - lastName: string; - gender: Gender; - dateOfBirth: Date; - weight: number; - height: number; - age: number; - averageSleepTime: string; - address: Address; - children: Person[]; - skills: { [key: string]: SkillLevel; } | undefined; - - protected _discriminator: string; - - constructor(data?: IPerson) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - if (!data) { - this.address = new Address(); - this.children = []; - } - this._discriminator = "Person"; - } - - init(_data?: any) { - if (_data) { - this.id = _data["Id"]; - this.firstName = _data["FirstName"]; - this.lastName = _data["LastName"]; - this.gender = _data["Gender"]; - this.dateOfBirth = _data["DateOfBirth"] ? new Date(_data["DateOfBirth"].toString()) : undefined; - this.weight = _data["Weight"]; - this.height = _data["Height"]; - this.age = _data["Age"]; - this.averageSleepTime = _data["AverageSleepTime"]; - this.address = _data["Address"] ? Address.fromJS(_data["Address"]) : new Address(); - if (Array.isArray(_data["Children"])) { - this.children = [] as any; - for (let item of _data["Children"]) - this.children.push(Person.fromJS(item)); - } - if (_data["Skills"]) { - this.skills = {} as any; - for (let key in _data["Skills"]) { - if (_data["Skills"].hasOwnProperty(key)) - (this.skills)[key] = _data["Skills"][key]; - } - } - } - } - - static fromJS(data: any): Person { - data = typeof data === 'object' ? data : {}; - if (data["discriminator"] === "Teacher") { - let result = new Teacher(); - result.init(data); - return result; - } - let result = new Person(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["discriminator"] = this._discriminator; - data["Id"] = this.id; - data["FirstName"] = this.firstName; - data["LastName"] = this.lastName; - data["Gender"] = this.gender; - data["DateOfBirth"] = this.dateOfBirth ? this.dateOfBirth.toISOString() : undefined; - data["Weight"] = this.weight; - data["Height"] = this.height; - data["Age"] = this.age; - data["AverageSleepTime"] = this.averageSleepTime; - data["Address"] = this.address ? this.address.toJSON() : undefined; - if (Array.isArray(this.children)) { - data["Children"] = []; - for (let item of this.children) - data["Children"].push(item.toJSON()); - } - if (this.skills) { - data["Skills"] = {}; - for (let key in this.skills) { - if (this.skills.hasOwnProperty(key)) - (data["Skills"])[key] = this.skills[key]; - } - } - return data; - } -} - -export interface IPerson { - id: string; - /** Gets or sets the first name. */ - firstName: string; - /** Gets or sets the last name. */ - lastName: string; - gender: Gender; - dateOfBirth: Date; - weight: number; - height: number; - age: number; - averageSleepTime: string; - address: Address; - children: Person[]; - skills: { [key: string]: SkillLevel; } | undefined; -} - -export enum Gender { - Male = "Male", - Female = "Female", -} - -export enum SkillLevel { - Low = 0, - Medium = 1, - Height = 2, -} - -export class Teacher extends Person implements ITeacher { - course: string | undefined; - skillLevel: SkillLevel; - - constructor(data?: ITeacher) { - super(data); - if (!data) { - this.skillLevel = SkillLevel.Medium; - } - this._discriminator = "Teacher"; - } - - init(_data?: any) { - super.init(_data); - if (_data) { - this.course = _data["Course"]; - this.skillLevel = _data["SkillLevel"] !== undefined ? _data["SkillLevel"] : SkillLevel.Medium; - } - } - - static fromJS(data: any): Teacher { - data = typeof data === 'object' ? data : {}; - let result = new Teacher(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Course"] = this.course; - data["SkillLevel"] = this.skillLevel; - super.toJSON(data); - return data; - } -} - -export interface ITeacher extends IPerson { - course: string | undefined; - skillLevel: SkillLevel; -} - -export class PersonNotFoundException extends Exception implements IPersonNotFoundException { - id: string; - - constructor(data?: IPersonNotFoundException) { - super(data); - } - - init(_data?: any) { - super.init(_data); - if (_data) { - this.id = _data["id"]; - } - } - - static fromJS(data: any): PersonNotFoundException { - data = typeof data === 'object' ? data : {}; - let result = new PersonNotFoundException(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["id"] = this.id; - super.toJSON(data); - return data; - } -} - -export interface IPersonNotFoundException extends IException { - id: string; -} - -export interface FileParameter { - data: any; - fileName: string; -} - -export interface FileResponse { - data: Blob; - status: number; - fileName?: string; - headers?: { [name: string]: any }; -} - -export class SwaggerException extends Error { - message: string; - status: number; - response: string; - headers: { [key: string]: any; }; - result: any; - - constructor(message: string, status: number, response: string, headers: { [key: string]: any; }, result: any) { - super(); - - this.message = message; - this.status = status; - this.response = response; - this.headers = headers; - this.result = result; - } - - protected isSwaggerException = true; - - static isSwaggerException(obj: any): obj is SwaggerException { - return obj.isSwaggerException === true; - } -} - -function throwException(message: string, status: number, response: string, headers: { [key: string]: any; }, result?: any): any { - if (result !== null && result !== undefined) - throw result; - else - throw new SwaggerException(message, status, response, headers, null); -} \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsFetch.extensions.ts b/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsFetch.extensions.ts deleted file mode 100644 index ba1b119116..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsFetch.extensions.ts +++ /dev/null @@ -1,8 +0,0 @@ -import * as generated from "./serviceClientsFetch"; - -class GeoClient extends generated.GeoClient { - constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { - super(baseUrl, http); // ignore - //this.jsonParseReviver = (key: string, value: any) => value; - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsFetch.ts b/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsFetch.ts deleted file mode 100644 index 1c81d090d5..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsFetch.ts +++ /dev/null @@ -1,1298 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -//---------------------- -// -// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- -// ReSharper disable InconsistentNaming - -export class GeoClient { - private http: { fetch(url: RequestInfo, init?: RequestInit): Promise }; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - - constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { - //this.jsonParseReviver = (key: string, value: any) => value; - } - - fromBodyTest(location: GeoPoint | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/FromBodyTest"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(location); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/json", - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processFromBodyTest(_response); - }); - } - - protected processFromBodyTest(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - fromUriTest(latitude: number | undefined, longitude: number | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/FromUriTest?"; - if (latitude === null) - throw new Error("The parameter 'latitude' cannot be null."); - else if (latitude !== undefined) - url_ += "Latitude=" + encodeURIComponent("" + latitude) + "&"; - if (longitude === null) - throw new Error("The parameter 'longitude' cannot be null."); - else if (longitude !== undefined) - url_ += "Longitude=" + encodeURIComponent("" + longitude) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "POST", - headers: { - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processFromUriTest(_response); - }); - } - - protected processFromUriTest(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - addPolygon(points: GeoPoint[] | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/AddPolygon"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(points); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/json", - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processAddPolygon(_response); - }); - } - - protected processAddPolygon(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - filter(currentStates: string[] | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/Filter?"; - if (currentStates !== undefined && currentStates !== null) - currentStates && currentStates.forEach(item => { url_ += "currentStates=" + encodeURIComponent("" + item) + "&"; }); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "POST", - headers: { - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processFilter(_response); - }); - } - - protected processFilter(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - reverse(values: string[] | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/Reverse?"; - if (values !== undefined && values !== null) - values && values.forEach(item => { url_ += "values=" + encodeURIComponent("" + item) + "&"; }); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "POST", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processReverse(_response); - }); - } - - protected processReverse(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(item); - } - else { - result200 = null; - } - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - refresh(): Promise { - let url_ = this.baseUrl + "/api/Geo/Refresh"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "POST", - headers: { - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processRefresh(_response); - }); - } - - protected processRefresh(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - uploadFile(file: FileParameter | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/UploadFile"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = new FormData(); - if (file !== null && file !== undefined) - content_.append("file", file.data, file.fileName ? file.fileName : "file"); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processUploadFile(_response); - }); - } - - protected processUploadFile(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - uploadFiles(files: FileParameter[] | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/UploadFiles"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = new FormData(); - if (files !== null && files !== undefined) - files.forEach(item_ => content_.append("files", item_.data, item_.fileName ? item_.fileName : "files") ); - - let options_ = { - body: content_, - method: "POST", - headers: { - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processUploadFiles(_response); - }); - } - - protected processUploadFiles(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - saveItems(request: GenericRequestOfAddressAndPerson | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/SaveItems"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(request); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/json", - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processSaveItems(_response); - }); - } - - protected processSaveItems(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status === 450) { - return response.text().then((_responseText) => { - let result450: any = null; - let resultData450 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result450 = Exception.fromJS(resultData450); - return throwException("A custom error occured.", status, _responseText, _headers, result450); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - getUploadedFile(id: number, override: boolean | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/GetUploadedFile/{id}?"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - if (override === null) - throw new Error("The parameter 'override' cannot be null."); - else if (override !== undefined) - url_ += "override=" + encodeURIComponent("" + override) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processGetUploadedFile(_response); - }); - } - - protected processGetUploadedFile(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200 || status === 206) { - const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined; - const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined; - const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined; - return response.blob().then(blob => { return { fileName: fileName, data: blob, status: status, headers: _headers }; }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - postDouble(value: number | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Geo/PostDouble?"; - if (value !== undefined && value !== null) - url_ += "value=" + encodeURIComponent("" + value) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "POST", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processPostDouble(_response); - }); - } - - protected processPostDouble(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } -} - -export class PersonsClient { - private http: { fetch(url: RequestInfo, init?: RequestInit): Promise }; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { - this.http = http ? http : window; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "http://localhost:13452"; - } - - getAll(): Promise { - let url_ = this.baseUrl + "/api/Persons"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processGetAll(_response); - }); - } - - protected processGetAll(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - add(person: Person | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Persons"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(person); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/json", - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processAdd(_response); - }); - } - - protected processAdd(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - find(gender: Gender): Promise { - let url_ = this.baseUrl + "/api/Persons/find/{gender}"; - if (gender === undefined || gender === null) - throw new Error("The parameter 'gender' must be defined."); - url_ = url_.replace("{gender}", encodeURIComponent("" + gender)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "POST", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processFind(_response); - }); - } - - protected processFind(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - findOptional(gender: Gender | null): Promise { - let url_ = this.baseUrl + "/api/Persons/find2?"; - if (gender === undefined) - throw new Error("The parameter 'gender' must be defined."); - else if(gender !== null) - url_ += "gender=" + encodeURIComponent("" + gender) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "POST", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processFindOptional(_response); - }); - } - - protected processFindOptional(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - get(id: string): Promise { - let url_ = this.baseUrl + "/api/Persons/{id}"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processGet(_response); - }); - } - - protected processGet(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 500) { - return response.text().then((_responseText) => { - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - }); - } else if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 ? Person.fromJS(resultData200) : null; - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - delete(id: string): Promise { - let url_ = this.baseUrl + "/api/Persons/{id}"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "DELETE", - headers: { - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processDelete(_response); - }); - } - - protected processDelete(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 204) { - return response.text().then((_responseText) => { - return; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - transform(person: Person | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Persons/transform"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(person); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/json", - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processTransform(_response); - }); - } - - protected processTransform(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 ? Person.fromJS(resultData200) : null; - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - throw(id: string): Promise { - let url_ = this.baseUrl + "/api/Persons/Throw?"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined and cannot be null."); - else - url_ += "id=" + encodeURIComponent("" + id) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "POST", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processThrow(_response); - }); - } - - protected processThrow(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = Person.fromJS(resultData200); - return result200; - }); - } else if (status === 500) { - return response.text().then((_responseText) => { - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Gets the name of a person. - * @param id The person ID. - * @return The person's name. - */ - getName(id: string): Promise { - let url_ = this.baseUrl + "/api/Persons/{id}/Name"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processGetName(_response); - }); - } - - protected processGetName(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - }); - } else if (status === 500) { - return response.text().then((_responseText) => { - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - addXml(person: string | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Persons/AddXml"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = person; - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/xml", - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processAddXml(_response); - }); - } - - protected processAddXml(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - upload(data: Blob | null | undefined): Promise { - let url_ = this.baseUrl + "/api/Persons/upload"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = data; - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/octet-stream", - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processUpload(_response); - }); - } - - protected processUpload(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } -} - -export class GeoPoint implements IGeoPoint { - latitude: number; - longitude: number; - - constructor(data?: IGeoPoint) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.latitude = _data["Latitude"]; - this.longitude = _data["Longitude"]; - } - } - - static fromJS(data: any): GeoPoint { - data = typeof data === 'object' ? data : {}; - let result = new GeoPoint(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Latitude"] = this.latitude; - data["Longitude"] = this.longitude; - return data; - } -} - -export interface IGeoPoint { - latitude: number; - longitude: number; -} - -export class Exception implements IException { - message: string | undefined; - innerException: Exception | undefined; - stackTrace: string | undefined; - source: string | undefined; - - constructor(data?: IException) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.message = _data["Message"]; - this.innerException = _data["InnerException"] ? Exception.fromJS(_data["InnerException"]) : undefined; - this.stackTrace = _data["StackTrace"]; - this.source = _data["Source"]; - } - } - - static fromJS(data: any): Exception { - data = typeof data === 'object' ? data : {}; - let result = new Exception(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Message"] = this.message; - data["InnerException"] = this.innerException ? this.innerException.toJSON() : undefined; - data["StackTrace"] = this.stackTrace; - data["Source"] = this.source; - return data; - } -} - -export interface IException { - message: string | undefined; - innerException: Exception | undefined; - stackTrace: string | undefined; - source: string | undefined; -} - -export class GenericRequestOfAddressAndPerson implements IGenericRequestOfAddressAndPerson { - item1: Address | undefined; - item2: Person | undefined; - - constructor(data?: IGenericRequestOfAddressAndPerson) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.item1 = _data["Item1"] ? Address.fromJS(_data["Item1"]) : undefined; - this.item2 = _data["Item2"] ? Person.fromJS(_data["Item2"]) : undefined; - } - } - - static fromJS(data: any): GenericRequestOfAddressAndPerson { - data = typeof data === 'object' ? data : {}; - let result = new GenericRequestOfAddressAndPerson(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Item1"] = this.item1 ? this.item1.toJSON() : undefined; - data["Item2"] = this.item2 ? this.item2.toJSON() : undefined; - return data; - } -} - -export interface IGenericRequestOfAddressAndPerson { - item1: Address | undefined; - item2: Person | undefined; -} - -export class Address implements IAddress { - isPrimary: boolean; - city: string | undefined; - - constructor(data?: IAddress) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.isPrimary = _data["IsPrimary"]; - this.city = _data["City"]; - } - } - - static fromJS(data: any): Address { - data = typeof data === 'object' ? data : {}; - let result = new Address(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["IsPrimary"] = this.isPrimary; - data["City"] = this.city; - return data; - } -} - -export interface IAddress { - isPrimary: boolean; - city: string | undefined; -} - -export class Person implements IPerson { - id: string; - /** Gets or sets the first name. */ - firstName: string; - /** Gets or sets the last name. */ - lastName: string; - gender: Gender; - dateOfBirth: Date; - weight: number; - height: number; - age: number; - averageSleepTime: string; - address: Address; - children: Person[]; - skills: { [key: string]: SkillLevel; } | undefined; - - protected _discriminator: string; - - constructor(data?: IPerson) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - if (!data) { - this.address = new Address(); - this.children = []; - } - this._discriminator = "Person"; - } - - init(_data?: any) { - if (_data) { - this.id = _data["Id"]; - this.firstName = _data["FirstName"]; - this.lastName = _data["LastName"]; - this.gender = _data["Gender"]; - this.dateOfBirth = _data["DateOfBirth"] ? new Date(_data["DateOfBirth"].toString()) : undefined; - this.weight = _data["Weight"]; - this.height = _data["Height"]; - this.age = _data["Age"]; - this.averageSleepTime = _data["AverageSleepTime"]; - this.address = _data["Address"] ? Address.fromJS(_data["Address"]) : new Address(); - if (Array.isArray(_data["Children"])) { - this.children = [] as any; - for (let item of _data["Children"]) - this.children.push(Person.fromJS(item)); - } - if (_data["Skills"]) { - this.skills = {} as any; - for (let key in _data["Skills"]) { - if (_data["Skills"].hasOwnProperty(key)) - (this.skills)[key] = _data["Skills"][key]; - } - } - } - } - - static fromJS(data: any): Person { - data = typeof data === 'object' ? data : {}; - if (data["discriminator"] === "Teacher") { - let result = new Teacher(); - result.init(data); - return result; - } - let result = new Person(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["discriminator"] = this._discriminator; - data["Id"] = this.id; - data["FirstName"] = this.firstName; - data["LastName"] = this.lastName; - data["Gender"] = this.gender; - data["DateOfBirth"] = this.dateOfBirth ? this.dateOfBirth.toISOString() : undefined; - data["Weight"] = this.weight; - data["Height"] = this.height; - data["Age"] = this.age; - data["AverageSleepTime"] = this.averageSleepTime; - data["Address"] = this.address ? this.address.toJSON() : undefined; - if (Array.isArray(this.children)) { - data["Children"] = []; - for (let item of this.children) - data["Children"].push(item.toJSON()); - } - if (this.skills) { - data["Skills"] = {}; - for (let key in this.skills) { - if (this.skills.hasOwnProperty(key)) - (data["Skills"])[key] = this.skills[key]; - } - } - return data; - } -} - -export interface IPerson { - id: string; - /** Gets or sets the first name. */ - firstName: string; - /** Gets or sets the last name. */ - lastName: string; - gender: Gender; - dateOfBirth: Date; - weight: number; - height: number; - age: number; - averageSleepTime: string; - address: Address; - children: Person[]; - skills: { [key: string]: SkillLevel; } | undefined; -} - -export enum Gender { - Male = "Male", - Female = "Female", -} - -export enum SkillLevel { - Low = 0, - Medium = 1, - Height = 2, -} - -export class Teacher extends Person implements ITeacher { - course: string | undefined; - skillLevel: SkillLevel; - - constructor(data?: ITeacher) { - super(data); - if (!data) { - this.skillLevel = SkillLevel.Medium; - } - this._discriminator = "Teacher"; - } - - init(_data?: any) { - super.init(_data); - if (_data) { - this.course = _data["Course"]; - this.skillLevel = _data["SkillLevel"] !== undefined ? _data["SkillLevel"] : SkillLevel.Medium; - } - } - - static fromJS(data: any): Teacher { - data = typeof data === 'object' ? data : {}; - let result = new Teacher(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Course"] = this.course; - data["SkillLevel"] = this.skillLevel; - super.toJSON(data); - return data; - } -} - -export interface ITeacher extends IPerson { - course: string | undefined; - skillLevel: SkillLevel; -} - -export class PersonNotFoundException extends Exception implements IPersonNotFoundException { - id: string; - - constructor(data?: IPersonNotFoundException) { - super(data); - } - - init(_data?: any) { - super.init(_data); - if (_data) { - this.id = _data["id"]; - } - } - - static fromJS(data: any): PersonNotFoundException { - data = typeof data === 'object' ? data : {}; - let result = new PersonNotFoundException(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["id"] = this.id; - super.toJSON(data); - return data; - } -} - -export interface IPersonNotFoundException extends IException { - id: string; -} - -export interface FileParameter { - data: any; - fileName: string; -} - -export interface FileResponse { - data: Blob; - status: number; - fileName?: string; - headers?: { [name: string]: any }; -} - -export class SwaggerException extends Error { - message: string; - status: number; - response: string; - headers: { [key: string]: any; }; - result: any; - - constructor(message: string, status: number, response: string, headers: { [key: string]: any; }, result: any) { - super(); - - this.message = message; - this.status = status; - this.response = response; - this.headers = headers; - this.result = result; - } - - protected isSwaggerException = true; - - static isSwaggerException(obj: any): obj is SwaggerException { - return obj.isSwaggerException === true; - } -} - -function throwException(message: string, status: number, response: string, headers: { [key: string]: any; }, result?: any): any { - if (result !== null && result !== undefined) - throw result; - else - throw new SwaggerException(message, status, response, headers, null); -} \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryCallbacks.ts b/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryCallbacks.ts deleted file mode 100644 index 81927790fb..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryCallbacks.ts +++ /dev/null @@ -1,1692 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -//---------------------- -// -// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- -// ReSharper disable InconsistentNaming - -import * as jQuery from 'jquery'; - -export class GeoClient { - baseUrl: string; - beforeSend: any = undefined; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string) { - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "http://localhost:13452"; - } - - fromBodyTest(location: GeoPoint | null | undefined, onSuccess?: () => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Geo/FromBodyTest"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(location); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/json", - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processFromBodyTestWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processFromBodyTestWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processFromBodyTestWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processFromBodyTest(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processFromBodyTest(xhr: any): void { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - fromUriTest(latitude: number | undefined, longitude: number | undefined, onSuccess?: () => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Geo/FromUriTest?"; - if (latitude === null) - throw new Error("The parameter 'latitude' cannot be null."); - else if (latitude !== undefined) - url_ += "Latitude=" + encodeURIComponent("" + latitude) + "&"; - if (longitude === null) - throw new Error("The parameter 'longitude' cannot be null."); - else if (longitude !== undefined) - url_ += "Longitude=" + encodeURIComponent("" + longitude) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processFromUriTestWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processFromUriTestWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processFromUriTestWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processFromUriTest(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processFromUriTest(xhr: any): void { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - addPolygon(points: GeoPoint[] | null | undefined, onSuccess?: () => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Geo/AddPolygon"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(points); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/json", - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processAddPolygonWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processAddPolygonWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processAddPolygonWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processAddPolygon(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processAddPolygon(xhr: any): void { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - filter(currentStates: string[] | null | undefined, onSuccess?: () => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Geo/Filter?"; - if (currentStates !== undefined && currentStates !== null) - currentStates && currentStates.forEach(item => { url_ += "currentStates=" + encodeURIComponent("" + item) + "&"; }); - url_ = url_.replace(/[?&]$/, ""); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processFilterWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processFilterWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processFilterWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processFilter(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processFilter(xhr: any): void { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - reverse(values: string[] | null | undefined, onSuccess?: (result: string[] | null) => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Geo/Reverse?"; - if (values !== undefined && values !== null) - values && values.forEach(item => { url_ += "values=" + encodeURIComponent("" + item) + "&"; }); - url_ = url_.replace(/[?&]$/, ""); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - "Accept": "application/json" - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processReverseWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processReverseWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processReverseWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processReverse(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processReverse(xhr: any): string[] | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(item); - } - else { - result200 = null; - } - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - refresh(onSuccess?: () => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Geo/Refresh"; - url_ = url_.replace(/[?&]$/, ""); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processRefreshWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processRefreshWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processRefreshWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processRefresh(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processRefresh(xhr: any): void { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - uploadFile(file: FileParameter | null | undefined, onSuccess?: (result: boolean) => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Geo/UploadFile"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = new FormData(); - if (file !== null && file !== undefined) - content_.append("file", file.data, file.fileName ? file.fileName : "file"); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - mimeType: "multipart/form-data", - contentType: false, - headers: { - "Accept": "application/json" - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processUploadFileWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processUploadFileWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processUploadFileWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processUploadFile(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processUploadFile(xhr: any): boolean | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - uploadFiles(files: FileParameter[] | null | undefined, onSuccess?: () => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Geo/UploadFiles"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = new FormData(); - if (files !== null && files !== undefined) - files.forEach(item_ => content_.append("files", item_.data, item_.fileName ? item_.fileName : "files") ); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - mimeType: "multipart/form-data", - contentType: false, - headers: { - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processUploadFilesWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processUploadFilesWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processUploadFilesWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processUploadFiles(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processUploadFiles(xhr: any): void { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - saveItems(request: GenericRequestOfAddressAndPerson | null | undefined, onSuccess?: () => void, onFail?: (exception: Exception | string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Geo/SaveItems"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(request); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/json", - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processSaveItemsWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processSaveItemsWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processSaveItemsWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processSaveItems(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processSaveItems(xhr: any): void { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status === 450) { - const _responseText = xhr.responseText; - let result450: any = null; - let resultData450 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result450 = Exception.fromJS(resultData450); - return throwException("A custom error occured.", status, _responseText, _headers, result450); - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - getUploadedFile(id: number, override: boolean | undefined, onSuccess?: (result: any | null) => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Geo/GetUploadedFile/{id}?"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - if (override === null) - throw new Error("The parameter 'override' cannot be null."); - else if (override !== undefined) - url_ += "override=" + encodeURIComponent("" + override) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "get", - dataType: "text", - headers: { - "Accept": "application/json" - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processGetUploadedFileWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processGetUploadedFileWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processGetUploadedFileWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processGetUploadedFile(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processGetUploadedFile(xhr: any): any | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200 || status === 206) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - postDouble(value: number | null | undefined, onSuccess?: (result: number | null) => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Geo/PostDouble?"; - if (value !== undefined && value !== null) - url_ += "value=" + encodeURIComponent("" + value) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - "Accept": "application/json" - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processPostDoubleWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processPostDoubleWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processPostDoubleWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processPostDouble(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processPostDouble(xhr: any): number | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } -} - -export class PersonsClient { - baseUrl: string; - beforeSend: any = undefined; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string) { - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "http://localhost:13452"; - } - - getAll(onSuccess?: (result: Person[] | null) => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Persons"; - url_ = url_.replace(/[?&]$/, ""); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "get", - dataType: "text", - headers: { - "Accept": "application/json" - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processGetAllWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processGetAllWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processGetAllWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processGetAll(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processGetAll(xhr: any): Person[] | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - add(person: Person | null | undefined, onSuccess?: () => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Persons"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(person); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/json", - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processAddWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processAddWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processAddWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processAdd(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processAdd(xhr: any): void { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - find(gender: Gender, onSuccess?: (result: Person[] | null) => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Persons/find/{gender}"; - if (gender === undefined || gender === null) - throw new Error("The parameter 'gender' must be defined."); - url_ = url_.replace("{gender}", encodeURIComponent("" + gender)); - url_ = url_.replace(/[?&]$/, ""); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - "Accept": "application/json" - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processFindWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processFindWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processFindWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processFind(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processFind(xhr: any): Person[] | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - findOptional(gender: Gender | null, onSuccess?: (result: Person[] | null) => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Persons/find2?"; - if (gender === undefined) - throw new Error("The parameter 'gender' must be defined."); - else if(gender !== null) - url_ += "gender=" + encodeURIComponent("" + gender) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - "Accept": "application/json" - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processFindOptionalWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processFindOptionalWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processFindOptionalWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processFindOptional(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processFindOptional(xhr: any): Person[] | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - get(id: string, onSuccess?: (result: Person | null) => void, onFail?: (exception: PersonNotFoundException | string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Persons/{id}"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "get", - dataType: "text", - headers: { - "Accept": "application/json" - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processGetWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processGetWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processGetWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processGet(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processGet(xhr: any): Person | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 500) { - const _responseText = xhr.responseText; - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - - } else if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 ? Person.fromJS(resultData200) : null; - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - delete(id: string, onSuccess?: () => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Persons/{id}"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "delete", - dataType: "text", - headers: { - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processDeleteWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processDeleteWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processDeleteWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processDelete(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processDelete(xhr: any): void { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - transform(person: Person | null | undefined, onSuccess?: (result: Person | null) => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Persons/transform"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(person); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/json", - "Accept": "application/json" - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processTransformWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processTransformWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processTransformWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processTransform(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processTransform(xhr: any): Person | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 ? Person.fromJS(resultData200) : null; - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - throw(id: string, onSuccess?: (result: Person) => void, onFail?: (exception: PersonNotFoundException | string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Persons/Throw?"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined and cannot be null."); - else - url_ += "id=" + encodeURIComponent("" + id) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - "Accept": "application/json" - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processThrowWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processThrowWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processThrowWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processThrow(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processThrow(xhr: any): Person | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = Person.fromJS(resultData200); - return result200; - - } else if (status === 500) { - const _responseText = xhr.responseText; - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - /** - * Gets the name of a person. - * @param id The person ID. - * @return The person's name. - */ - getName(id: string, onSuccess?: (result: string) => void, onFail?: (exception: PersonNotFoundException | string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Persons/{id}/Name"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "get", - dataType: "text", - headers: { - "Accept": "application/json" - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processGetNameWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processGetNameWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processGetNameWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processGetName(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processGetName(xhr: any): string | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status === 500) { - const _responseText = xhr.responseText; - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - addXml(person: string | null | undefined, onSuccess?: (result: string | null) => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Persons/AddXml"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = person; - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/xml", - "Accept": "application/json" - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processAddXmlWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processAddXmlWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processAddXmlWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processAddXml(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processAddXml(xhr: any): string | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - upload(data: Blob | null | undefined, onSuccess?: (result: string | null) => void, onFail?: (exception: string, reason: string) => void): JQueryXHR { - let url_ = this.baseUrl + "/api/Persons/upload"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = data; - - let jqXhr = jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/octet-stream", - "Accept": "application/json" - } - }); - - jqXhr.done((_data, _textStatus, xhr) => { - this.processUploadWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processUploadWithCallbacks(url_, xhr, onSuccess, onFail); - }); - - return jqXhr; - } - - private processUploadWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processUpload(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processUpload(xhr: any): string | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } -} - -export class GeoPoint implements IGeoPoint { - latitude: number; - longitude: number; - - constructor(data?: IGeoPoint) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.latitude = _data["Latitude"]; - this.longitude = _data["Longitude"]; - } - } - - static fromJS(data: any): GeoPoint { - data = typeof data === 'object' ? data : {}; - let result = new GeoPoint(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Latitude"] = this.latitude; - data["Longitude"] = this.longitude; - return data; - } -} - -export interface IGeoPoint { - latitude: number; - longitude: number; -} - -export class Exception implements IException { - message: string | undefined; - innerException: Exception | undefined; - stackTrace: string | undefined; - source: string | undefined; - - constructor(data?: IException) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.message = _data["Message"]; - this.innerException = _data["InnerException"] ? Exception.fromJS(_data["InnerException"]) : undefined; - this.stackTrace = _data["StackTrace"]; - this.source = _data["Source"]; - } - } - - static fromJS(data: any): Exception { - data = typeof data === 'object' ? data : {}; - let result = new Exception(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Message"] = this.message; - data["InnerException"] = this.innerException ? this.innerException.toJSON() : undefined; - data["StackTrace"] = this.stackTrace; - data["Source"] = this.source; - return data; - } -} - -export interface IException { - message: string | undefined; - innerException: Exception | undefined; - stackTrace: string | undefined; - source: string | undefined; -} - -export class GenericRequestOfAddressAndPerson implements IGenericRequestOfAddressAndPerson { - item1: Address | undefined; - item2: Person | undefined; - - constructor(data?: IGenericRequestOfAddressAndPerson) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.item1 = _data["Item1"] ? Address.fromJS(_data["Item1"]) : undefined; - this.item2 = _data["Item2"] ? Person.fromJS(_data["Item2"]) : undefined; - } - } - - static fromJS(data: any): GenericRequestOfAddressAndPerson { - data = typeof data === 'object' ? data : {}; - let result = new GenericRequestOfAddressAndPerson(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Item1"] = this.item1 ? this.item1.toJSON() : undefined; - data["Item2"] = this.item2 ? this.item2.toJSON() : undefined; - return data; - } -} - -export interface IGenericRequestOfAddressAndPerson { - item1: Address | undefined; - item2: Person | undefined; -} - -export class Address implements IAddress { - isPrimary: boolean; - city: string | undefined; - - constructor(data?: IAddress) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.isPrimary = _data["IsPrimary"]; - this.city = _data["City"]; - } - } - - static fromJS(data: any): Address { - data = typeof data === 'object' ? data : {}; - let result = new Address(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["IsPrimary"] = this.isPrimary; - data["City"] = this.city; - return data; - } -} - -export interface IAddress { - isPrimary: boolean; - city: string | undefined; -} - -export class Person implements IPerson { - id: string; - /** Gets or sets the first name. */ - firstName: string; - /** Gets or sets the last name. */ - lastName: string; - gender: Gender; - dateOfBirth: Date; - weight: number; - height: number; - age: number; - averageSleepTime: string; - address: Address; - children: Person[]; - skills: { [key: string]: SkillLevel; } | undefined; - - protected _discriminator: string; - - constructor(data?: IPerson) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - if (!data) { - this.address = new Address(); - this.children = []; - } - this._discriminator = "Person"; - } - - init(_data?: any) { - if (_data) { - this.id = _data["Id"]; - this.firstName = _data["FirstName"]; - this.lastName = _data["LastName"]; - this.gender = _data["Gender"]; - this.dateOfBirth = _data["DateOfBirth"] ? new Date(_data["DateOfBirth"].toString()) : undefined; - this.weight = _data["Weight"]; - this.height = _data["Height"]; - this.age = _data["Age"]; - this.averageSleepTime = _data["AverageSleepTime"]; - this.address = _data["Address"] ? Address.fromJS(_data["Address"]) : new Address(); - if (Array.isArray(_data["Children"])) { - this.children = [] as any; - for (let item of _data["Children"]) - this.children.push(Person.fromJS(item)); - } - if (_data["Skills"]) { - this.skills = {} as any; - for (let key in _data["Skills"]) { - if (_data["Skills"].hasOwnProperty(key)) - (this.skills)[key] = _data["Skills"][key]; - } - } - } - } - - static fromJS(data: any): Person { - data = typeof data === 'object' ? data : {}; - if (data["discriminator"] === "Teacher") { - let result = new Teacher(); - result.init(data); - return result; - } - let result = new Person(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["discriminator"] = this._discriminator; - data["Id"] = this.id; - data["FirstName"] = this.firstName; - data["LastName"] = this.lastName; - data["Gender"] = this.gender; - data["DateOfBirth"] = this.dateOfBirth ? this.dateOfBirth.toISOString() : undefined; - data["Weight"] = this.weight; - data["Height"] = this.height; - data["Age"] = this.age; - data["AverageSleepTime"] = this.averageSleepTime; - data["Address"] = this.address ? this.address.toJSON() : undefined; - if (Array.isArray(this.children)) { - data["Children"] = []; - for (let item of this.children) - data["Children"].push(item.toJSON()); - } - if (this.skills) { - data["Skills"] = {}; - for (let key in this.skills) { - if (this.skills.hasOwnProperty(key)) - (data["Skills"])[key] = this.skills[key]; - } - } - return data; - } -} - -export interface IPerson { - id: string; - /** Gets or sets the first name. */ - firstName: string; - /** Gets or sets the last name. */ - lastName: string; - gender: Gender; - dateOfBirth: Date; - weight: number; - height: number; - age: number; - averageSleepTime: string; - address: Address; - children: Person[]; - skills: { [key: string]: SkillLevel; } | undefined; -} - -export enum Gender { - Male = "Male", - Female = "Female", -} - -export enum SkillLevel { - Low = 0, - Medium = 1, - Height = 2, -} - -export class Teacher extends Person implements ITeacher { - course: string | undefined; - skillLevel: SkillLevel; - - constructor(data?: ITeacher) { - super(data); - if (!data) { - this.skillLevel = SkillLevel.Medium; - } - this._discriminator = "Teacher"; - } - - init(_data?: any) { - super.init(_data); - if (_data) { - this.course = _data["Course"]; - this.skillLevel = _data["SkillLevel"] !== undefined ? _data["SkillLevel"] : SkillLevel.Medium; - } - } - - static fromJS(data: any): Teacher { - data = typeof data === 'object' ? data : {}; - let result = new Teacher(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Course"] = this.course; - data["SkillLevel"] = this.skillLevel; - super.toJSON(data); - return data; - } -} - -export interface ITeacher extends IPerson { - course: string | undefined; - skillLevel: SkillLevel; -} - -export class PersonNotFoundException extends Exception implements IPersonNotFoundException { - id: string; - - constructor(data?: IPersonNotFoundException) { - super(data); - } - - init(_data?: any) { - super.init(_data); - if (_data) { - this.id = _data["id"]; - } - } - - static fromJS(data: any): PersonNotFoundException { - data = typeof data === 'object' ? data : {}; - let result = new PersonNotFoundException(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["id"] = this.id; - super.toJSON(data); - return data; - } -} - -export interface IPersonNotFoundException extends IException { - id: string; -} - -export interface FileParameter { - data: any; - fileName: string; -} - -export class SwaggerException extends Error { - message: string; - status: number; - response: string; - headers: { [key: string]: any; }; - result: any; - - constructor(message: string, status: number, response: string, headers: { [key: string]: any; }, result: any) { - super(); - - this.message = message; - this.status = status; - this.response = response; - this.headers = headers; - this.result = result; - } - - protected isSwaggerException = true; - - static isSwaggerException(obj: any): obj is SwaggerException { - return obj.isSwaggerException === true; - } -} - -function throwException(message: string, status: number, response: string, headers: { [key: string]: any; }, result?: any): any { - if (result !== null && result !== undefined) - throw result; - else - throw new SwaggerException(message, status, response, headers, null); -} \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryPromises.extensions.ts b/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryPromises.extensions.ts deleted file mode 100644 index af720269cd..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryPromises.extensions.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as generated from "./serviceClientsJQueryPromises"; - -class Person extends generated.Person { - get fullName() { - return this.firstName + " " + this.lastName; - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryPromises.ts b/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryPromises.ts deleted file mode 100644 index 6640c9a83a..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryPromises.ts +++ /dev/null @@ -1,1740 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -//---------------------- -// -// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- -// ReSharper disable InconsistentNaming - -import * as jQuery from 'jquery'; - -export class GeoClient { - baseUrl: string; - beforeSend: any = undefined; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string) { - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "http://localhost:13452"; - } - - fromBodyTest(location: GeoPoint | null | undefined) { - return new Promise((resolve, reject) => { - this.fromBodyTestWithCallbacks(location, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private fromBodyTestWithCallbacks(location: GeoPoint | null | undefined, onSuccess?: (result: void) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/FromBodyTest"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(location); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/json", - } - }).done((_data, _textStatus, xhr) => { - this.processFromBodyTestWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processFromBodyTestWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processFromBodyTestWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processFromBodyTest(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processFromBodyTest(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - fromUriTest(latitude: number | undefined, longitude: number | undefined) { - return new Promise((resolve, reject) => { - this.fromUriTestWithCallbacks(latitude, longitude, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private fromUriTestWithCallbacks(latitude: number | undefined, longitude: number | undefined, onSuccess?: (result: void) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/FromUriTest?"; - if (latitude === null) - throw new Error("The parameter 'latitude' cannot be null."); - else if (latitude !== undefined) - url_ += "Latitude=" + encodeURIComponent("" + latitude) + "&"; - if (longitude === null) - throw new Error("The parameter 'longitude' cannot be null."); - else if (longitude !== undefined) - url_ += "Longitude=" + encodeURIComponent("" + longitude) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - } - }).done((_data, _textStatus, xhr) => { - this.processFromUriTestWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processFromUriTestWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processFromUriTestWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processFromUriTest(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processFromUriTest(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - addPolygon(points: GeoPoint[] | null | undefined) { - return new Promise((resolve, reject) => { - this.addPolygonWithCallbacks(points, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private addPolygonWithCallbacks(points: GeoPoint[] | null | undefined, onSuccess?: (result: void) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/AddPolygon"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(points); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/json", - } - }).done((_data, _textStatus, xhr) => { - this.processAddPolygonWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processAddPolygonWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processAddPolygonWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processAddPolygon(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processAddPolygon(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - filter(currentStates: string[] | null | undefined) { - return new Promise((resolve, reject) => { - this.filterWithCallbacks(currentStates, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private filterWithCallbacks(currentStates: string[] | null | undefined, onSuccess?: (result: void) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/Filter?"; - if (currentStates !== undefined && currentStates !== null) - currentStates && currentStates.forEach(item => { url_ += "currentStates=" + encodeURIComponent("" + item) + "&"; }); - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - } - }).done((_data, _textStatus, xhr) => { - this.processFilterWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processFilterWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processFilterWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processFilter(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processFilter(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - reverse(values: string[] | null | undefined) { - return new Promise((resolve, reject) => { - this.reverseWithCallbacks(values, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private reverseWithCallbacks(values: string[] | null | undefined, onSuccess?: (result: string[] | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/Reverse?"; - if (values !== undefined && values !== null) - values && values.forEach(item => { url_ += "values=" + encodeURIComponent("" + item) + "&"; }); - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processReverseWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processReverseWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processReverseWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processReverse(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processReverse(xhr: any): string[] | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(item); - } - else { - result200 = null; - } - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - refresh() { - return new Promise((resolve, reject) => { - this.refreshWithCallbacks((result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private refreshWithCallbacks(onSuccess?: (result: void) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/Refresh"; - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - } - }).done((_data, _textStatus, xhr) => { - this.processRefreshWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processRefreshWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processRefreshWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processRefresh(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processRefresh(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - uploadFile(file: FileParameter | null | undefined) { - return new Promise((resolve, reject) => { - this.uploadFileWithCallbacks(file, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private uploadFileWithCallbacks(file: FileParameter | null | undefined, onSuccess?: (result: boolean) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/UploadFile"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = new FormData(); - if (file !== null && file !== undefined) - content_.append("file", file.data, file.fileName ? file.fileName : "file"); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - mimeType: "multipart/form-data", - contentType: false, - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processUploadFileWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processUploadFileWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processUploadFileWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processUploadFile(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processUploadFile(xhr: any): boolean | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - uploadFiles(files: FileParameter[] | null | undefined) { - return new Promise((resolve, reject) => { - this.uploadFilesWithCallbacks(files, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private uploadFilesWithCallbacks(files: FileParameter[] | null | undefined, onSuccess?: (result: void) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/UploadFiles"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = new FormData(); - if (files !== null && files !== undefined) - files.forEach(item_ => content_.append("files", item_.data, item_.fileName ? item_.fileName : "files") ); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - mimeType: "multipart/form-data", - contentType: false, - headers: { - } - }).done((_data, _textStatus, xhr) => { - this.processUploadFilesWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processUploadFilesWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processUploadFilesWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processUploadFiles(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processUploadFiles(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - saveItems(request: GenericRequestOfAddressAndPerson | null | undefined) { - return new Promise((resolve, reject) => { - this.saveItemsWithCallbacks(request, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private saveItemsWithCallbacks(request: GenericRequestOfAddressAndPerson | null | undefined, onSuccess?: (result: void) => void, onFail?: (exception: Exception | string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/SaveItems"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(request); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/json", - } - }).done((_data, _textStatus, xhr) => { - this.processSaveItemsWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processSaveItemsWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processSaveItemsWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processSaveItems(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processSaveItems(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status === 450) { - const _responseText = xhr.responseText; - let result450: any = null; - let resultData450 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result450 = Exception.fromJS(resultData450); - return throwException("A custom error occured.", status, _responseText, _headers, result450); - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - getUploadedFile(id: number, override: boolean | undefined) { - return new Promise((resolve, reject) => { - this.getUploadedFileWithCallbacks(id, override, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private getUploadedFileWithCallbacks(id: number, override: boolean | undefined, onSuccess?: (result: any | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/GetUploadedFile/{id}?"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - if (override === null) - throw new Error("The parameter 'override' cannot be null."); - else if (override !== undefined) - url_ += "override=" + encodeURIComponent("" + override) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "get", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processGetUploadedFileWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processGetUploadedFileWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processGetUploadedFileWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processGetUploadedFile(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processGetUploadedFile(xhr: any): any | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200 || status === 206) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - postDouble(value: number | null | undefined) { - return new Promise((resolve, reject) => { - this.postDoubleWithCallbacks(value, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private postDoubleWithCallbacks(value: number | null | undefined, onSuccess?: (result: number | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/PostDouble?"; - if (value !== undefined && value !== null) - url_ += "value=" + encodeURIComponent("" + value) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processPostDoubleWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processPostDoubleWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processPostDoubleWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processPostDouble(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processPostDouble(xhr: any): number | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } -} - -export class PersonsClient { - baseUrl: string; - beforeSend: any = undefined; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string) { - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "http://localhost:13452"; - } - - getAll() { - return new Promise((resolve, reject) => { - this.getAllWithCallbacks((result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private getAllWithCallbacks(onSuccess?: (result: Person[] | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons"; - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "get", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processGetAllWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processGetAllWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processGetAllWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processGetAll(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processGetAll(xhr: any): Person[] | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - add(person: Person | null | undefined) { - return new Promise((resolve, reject) => { - this.addWithCallbacks(person, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private addWithCallbacks(person: Person | null | undefined, onSuccess?: (result: void) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(person); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/json", - } - }).done((_data, _textStatus, xhr) => { - this.processAddWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processAddWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processAddWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processAdd(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processAdd(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - find(gender: Gender) { - return new Promise((resolve, reject) => { - this.findWithCallbacks(gender, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private findWithCallbacks(gender: Gender, onSuccess?: (result: Person[] | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/find/{gender}"; - if (gender === undefined || gender === null) - throw new Error("The parameter 'gender' must be defined."); - url_ = url_.replace("{gender}", encodeURIComponent("" + gender)); - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processFindWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processFindWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processFindWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processFind(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processFind(xhr: any): Person[] | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - findOptional(gender: Gender | null) { - return new Promise((resolve, reject) => { - this.findOptionalWithCallbacks(gender, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private findOptionalWithCallbacks(gender: Gender | null, onSuccess?: (result: Person[] | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/find2?"; - if (gender === undefined) - throw new Error("The parameter 'gender' must be defined."); - else if(gender !== null) - url_ += "gender=" + encodeURIComponent("" + gender) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processFindOptionalWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processFindOptionalWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processFindOptionalWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processFindOptional(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processFindOptional(xhr: any): Person[] | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - get(id: string) { - return new Promise((resolve, reject) => { - this.getWithCallbacks(id, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private getWithCallbacks(id: string, onSuccess?: (result: Person | null) => void, onFail?: (exception: PersonNotFoundException | string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/{id}"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "get", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processGetWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processGetWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processGetWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processGet(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processGet(xhr: any): Person | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 500) { - const _responseText = xhr.responseText; - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - - } else if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 ? Person.fromJS(resultData200) : null; - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - delete(id: string) { - return new Promise((resolve, reject) => { - this.deleteWithCallbacks(id, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private deleteWithCallbacks(id: string, onSuccess?: (result: void) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/{id}"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "delete", - dataType: "text", - headers: { - } - }).done((_data, _textStatus, xhr) => { - this.processDeleteWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processDeleteWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processDeleteWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processDelete(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processDelete(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - transform(person: Person | null | undefined) { - return new Promise((resolve, reject) => { - this.transformWithCallbacks(person, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private transformWithCallbacks(person: Person | null | undefined, onSuccess?: (result: Person | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/transform"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(person); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/json", - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processTransformWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processTransformWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processTransformWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processTransform(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processTransform(xhr: any): Person | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 ? Person.fromJS(resultData200) : null; - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - throw(id: string) { - return new Promise((resolve, reject) => { - this.throwWithCallbacks(id, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private throwWithCallbacks(id: string, onSuccess?: (result: Person) => void, onFail?: (exception: PersonNotFoundException | string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/Throw?"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined and cannot be null."); - else - url_ += "id=" + encodeURIComponent("" + id) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processThrowWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processThrowWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processThrowWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processThrow(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processThrow(xhr: any): Person | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = Person.fromJS(resultData200); - return result200; - - } else if (status === 500) { - const _responseText = xhr.responseText; - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - /** - * Gets the name of a person. - * @param id The person ID. - * @return The person's name. - */ - getName(id: string) { - return new Promise((resolve, reject) => { - this.getNameWithCallbacks(id, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private getNameWithCallbacks(id: string, onSuccess?: (result: string) => void, onFail?: (exception: PersonNotFoundException | string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/{id}/Name"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "get", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processGetNameWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processGetNameWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processGetNameWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processGetName(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processGetName(xhr: any): string | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status === 500) { - const _responseText = xhr.responseText; - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - addXml(person: string | null | undefined) { - return new Promise((resolve, reject) => { - this.addXmlWithCallbacks(person, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private addXmlWithCallbacks(person: string | null | undefined, onSuccess?: (result: string | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/AddXml"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = person; - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/xml", - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processAddXmlWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processAddXmlWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processAddXmlWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processAddXml(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processAddXml(xhr: any): string | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - upload(data: Blob | null | undefined) { - return new Promise((resolve, reject) => { - this.uploadWithCallbacks(data, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private uploadWithCallbacks(data: Blob | null | undefined, onSuccess?: (result: string | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/upload"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = data; - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/octet-stream", - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processUploadWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processUploadWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processUploadWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processUpload(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processUpload(xhr: any): string | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } -} - -export class GeoPoint implements IGeoPoint { - latitude: number; - longitude: number; - - constructor(data?: IGeoPoint) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.latitude = _data["Latitude"]; - this.longitude = _data["Longitude"]; - } - } - - static fromJS(data: any): GeoPoint { - data = typeof data === 'object' ? data : {}; - let result = new GeoPoint(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Latitude"] = this.latitude; - data["Longitude"] = this.longitude; - return data; - } -} - -export interface IGeoPoint { - latitude: number; - longitude: number; -} - -export class Exception implements IException { - message: string | undefined; - innerException: Exception | undefined; - stackTrace: string | undefined; - source: string | undefined; - - constructor(data?: IException) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.message = _data["Message"]; - this.innerException = _data["InnerException"] ? Exception.fromJS(_data["InnerException"]) : undefined; - this.stackTrace = _data["StackTrace"]; - this.source = _data["Source"]; - } - } - - static fromJS(data: any): Exception { - data = typeof data === 'object' ? data : {}; - let result = new Exception(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Message"] = this.message; - data["InnerException"] = this.innerException ? this.innerException.toJSON() : undefined; - data["StackTrace"] = this.stackTrace; - data["Source"] = this.source; - return data; - } -} - -export interface IException { - message: string | undefined; - innerException: Exception | undefined; - stackTrace: string | undefined; - source: string | undefined; -} - -export class GenericRequestOfAddressAndPerson implements IGenericRequestOfAddressAndPerson { - item1: Address | undefined; - item2: Person | undefined; - - constructor(data?: IGenericRequestOfAddressAndPerson) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.item1 = _data["Item1"] ? Address.fromJS(_data["Item1"]) : undefined; - this.item2 = _data["Item2"] ? Person.fromJS(_data["Item2"]) : undefined; - } - } - - static fromJS(data: any): GenericRequestOfAddressAndPerson { - data = typeof data === 'object' ? data : {}; - let result = new GenericRequestOfAddressAndPerson(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Item1"] = this.item1 ? this.item1.toJSON() : undefined; - data["Item2"] = this.item2 ? this.item2.toJSON() : undefined; - return data; - } -} - -export interface IGenericRequestOfAddressAndPerson { - item1: Address | undefined; - item2: Person | undefined; -} - -export class Address implements IAddress { - isPrimary: boolean; - city: string | undefined; - - constructor(data?: IAddress) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.isPrimary = _data["IsPrimary"]; - this.city = _data["City"]; - } - } - - static fromJS(data: any): Address { - data = typeof data === 'object' ? data : {}; - let result = new Address(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["IsPrimary"] = this.isPrimary; - data["City"] = this.city; - return data; - } -} - -export interface IAddress { - isPrimary: boolean; - city: string | undefined; -} - -export class Person implements IPerson { - id: string; - /** Gets or sets the first name. */ - firstName: string; - /** Gets or sets the last name. */ - lastName: string; - gender: Gender; - dateOfBirth: Date; - weight: number; - height: number; - age: number; - averageSleepTime: string; - address: Address; - children: Person[]; - skills: { [key: string]: SkillLevel; } | undefined; - - protected _discriminator: string; - - get fullName() { - return this.firstName + " " + this.lastName; - } - - constructor(data?: IPerson) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - if (!data) { - this.address = new Address(); - this.children = []; - } - this._discriminator = "Person"; - } - - init(_data?: any) { - if (_data) { - this.id = _data["Id"]; - this.firstName = _data["FirstName"]; - this.lastName = _data["LastName"]; - this.gender = _data["Gender"]; - this.dateOfBirth = _data["DateOfBirth"] ? new Date(_data["DateOfBirth"].toString()) : undefined; - this.weight = _data["Weight"]; - this.height = _data["Height"]; - this.age = _data["Age"]; - this.averageSleepTime = _data["AverageSleepTime"]; - this.address = _data["Address"] ? Address.fromJS(_data["Address"]) : new Address(); - if (Array.isArray(_data["Children"])) { - this.children = [] as any; - for (let item of _data["Children"]) - this.children.push(Person.fromJS(item)); - } - if (_data["Skills"]) { - this.skills = {} as any; - for (let key in _data["Skills"]) { - if (_data["Skills"].hasOwnProperty(key)) - (this.skills)[key] = _data["Skills"][key]; - } - } - } - } - - static fromJS(data: any): Person { - data = typeof data === 'object' ? data : {}; - if (data["discriminator"] === "Teacher") { - let result = new Teacher(); - result.init(data); - return result; - } - let result = new Person(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["discriminator"] = this._discriminator; - data["Id"] = this.id; - data["FirstName"] = this.firstName; - data["LastName"] = this.lastName; - data["Gender"] = this.gender; - data["DateOfBirth"] = this.dateOfBirth ? this.dateOfBirth.toISOString() : undefined; - data["Weight"] = this.weight; - data["Height"] = this.height; - data["Age"] = this.age; - data["AverageSleepTime"] = this.averageSleepTime; - data["Address"] = this.address ? this.address.toJSON() : undefined; - if (Array.isArray(this.children)) { - data["Children"] = []; - for (let item of this.children) - data["Children"].push(item.toJSON()); - } - if (this.skills) { - data["Skills"] = {}; - for (let key in this.skills) { - if (this.skills.hasOwnProperty(key)) - (data["Skills"])[key] = this.skills[key]; - } - } - return data; - } -} - -export interface IPerson { - id: string; - /** Gets or sets the first name. */ - firstName: string; - /** Gets or sets the last name. */ - lastName: string; - gender: Gender; - dateOfBirth: Date; - weight: number; - height: number; - age: number; - averageSleepTime: string; - address: Address; - children: Person[]; - skills: { [key: string]: SkillLevel; } | undefined; -} - -export enum Gender { - Male = "Male", - Female = "Female", -} - -export enum SkillLevel { - Low = 0, - Medium = 1, - Height = 2, -} - -export class Teacher extends Person implements ITeacher { - course: string | undefined; - skillLevel: SkillLevel; - - constructor(data?: ITeacher) { - super(data); - if (!data) { - this.skillLevel = SkillLevel.Medium; - } - this._discriminator = "Teacher"; - } - - init(_data?: any) { - super.init(_data); - if (_data) { - this.course = _data["Course"]; - this.skillLevel = _data["SkillLevel"] !== undefined ? _data["SkillLevel"] : SkillLevel.Medium; - } - } - - static fromJS(data: any): Teacher { - data = typeof data === 'object' ? data : {}; - let result = new Teacher(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["Course"] = this.course; - data["SkillLevel"] = this.skillLevel; - super.toJSON(data); - return data; - } -} - -export interface ITeacher extends IPerson { - course: string | undefined; - skillLevel: SkillLevel; -} - -export class PersonNotFoundException extends Exception implements IPersonNotFoundException { - id: string; - - constructor(data?: IPersonNotFoundException) { - super(data); - } - - init(_data?: any) { - super.init(_data); - if (_data) { - this.id = _data["id"]; - } - } - - static fromJS(data: any): PersonNotFoundException { - data = typeof data === 'object' ? data : {}; - let result = new PersonNotFoundException(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["id"] = this.id; - super.toJSON(data); - return data; - } -} - -export interface IPersonNotFoundException extends IException { - id: string; -} - -export interface FileParameter { - data: any; - fileName: string; -} - -export class SwaggerException extends Error { - message: string; - status: number; - response: string; - headers: { [key: string]: any; }; - result: any; - - constructor(message: string, status: number, response: string, headers: { [key: string]: any; }, result: any) { - super(); - - this.message = message; - this.status = status; - this.response = response; - this.headers = headers; - this.result = result; - } - - protected isSwaggerException = true; - - static isSwaggerException(obj: any): obj is SwaggerException { - return obj.isSwaggerException === true; - } -} - -function throwException(message: string, status: number, response: string, headers: { [key: string]: any; }, result?: any): any { - if (result !== null && result !== undefined) - throw result; - else - throw new SwaggerException(message, status, response, headers, null); -} \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryPromisesKO.ts b/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryPromisesKO.ts deleted file mode 100644 index 2ab82c5ce1..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryPromisesKO.ts +++ /dev/null @@ -1,1755 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -//---------------------- -// -// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- -// ReSharper disable InconsistentNaming - -import * as ko from 'knockout'; - -import * as jQuery from 'jquery'; - -export class GeoClient { - baseUrl: string; - beforeSend: any = undefined; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string) { - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "http://localhost:13452"; - } - - fromBodyTest(location: GeoPoint | null | undefined) { - return new Promise((resolve, reject) => { - this.fromBodyTestWithCallbacks(location, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private fromBodyTestWithCallbacks(location: GeoPoint | null | undefined, onSuccess?: (result: void) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/FromBodyTest"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(location); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/json", - } - }).done((_data, _textStatus, xhr) => { - this.processFromBodyTestWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processFromBodyTestWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processFromBodyTestWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processFromBodyTest(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processFromBodyTest(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - fromUriTest(latitude: number | undefined, longitude: number | undefined) { - return new Promise((resolve, reject) => { - this.fromUriTestWithCallbacks(latitude, longitude, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private fromUriTestWithCallbacks(latitude: number | undefined, longitude: number | undefined, onSuccess?: (result: void) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/FromUriTest?"; - if (latitude === null) - throw new Error("The parameter 'latitude' cannot be null."); - else if (latitude !== undefined) - url_ += "Latitude=" + encodeURIComponent("" + latitude) + "&"; - if (longitude === null) - throw new Error("The parameter 'longitude' cannot be null."); - else if (longitude !== undefined) - url_ += "Longitude=" + encodeURIComponent("" + longitude) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - } - }).done((_data, _textStatus, xhr) => { - this.processFromUriTestWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processFromUriTestWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processFromUriTestWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processFromUriTest(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processFromUriTest(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - addPolygon(points: GeoPoint[] | null | undefined) { - return new Promise((resolve, reject) => { - this.addPolygonWithCallbacks(points, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private addPolygonWithCallbacks(points: GeoPoint[] | null | undefined, onSuccess?: (result: void) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/AddPolygon"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(points); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/json", - } - }).done((_data, _textStatus, xhr) => { - this.processAddPolygonWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processAddPolygonWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processAddPolygonWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processAddPolygon(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processAddPolygon(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - filter(currentStates: string[] | null | undefined) { - return new Promise((resolve, reject) => { - this.filterWithCallbacks(currentStates, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private filterWithCallbacks(currentStates: string[] | null | undefined, onSuccess?: (result: void) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/Filter?"; - if (currentStates !== undefined && currentStates !== null) - currentStates && currentStates.forEach(item => { url_ += "currentStates=" + encodeURIComponent("" + item) + "&"; }); - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - } - }).done((_data, _textStatus, xhr) => { - this.processFilterWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processFilterWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processFilterWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processFilter(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processFilter(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - reverse(values: string[] | null | undefined) { - return new Promise((resolve, reject) => { - this.reverseWithCallbacks(values, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private reverseWithCallbacks(values: string[] | null | undefined, onSuccess?: (result: string[] | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/Reverse?"; - if (values !== undefined && values !== null) - values && values.forEach(item => { url_ += "values=" + encodeURIComponent("" + item) + "&"; }); - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processReverseWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processReverseWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processReverseWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processReverse(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processReverse(xhr: any): string[] | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(item); - } - else { - result200 = null; - } - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - refresh() { - return new Promise((resolve, reject) => { - this.refreshWithCallbacks((result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private refreshWithCallbacks(onSuccess?: (result: void) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/Refresh"; - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - } - }).done((_data, _textStatus, xhr) => { - this.processRefreshWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processRefreshWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processRefreshWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processRefresh(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processRefresh(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - uploadFile(file: FileParameter | null | undefined) { - return new Promise((resolve, reject) => { - this.uploadFileWithCallbacks(file, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private uploadFileWithCallbacks(file: FileParameter | null | undefined, onSuccess?: (result: boolean) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/UploadFile"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = new FormData(); - if (file !== null && file !== undefined) - content_.append("file", file.data, file.fileName ? file.fileName : "file"); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - mimeType: "multipart/form-data", - contentType: false, - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processUploadFileWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processUploadFileWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processUploadFileWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processUploadFile(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processUploadFile(xhr: any): boolean | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - uploadFiles(files: FileParameter[] | null | undefined) { - return new Promise((resolve, reject) => { - this.uploadFilesWithCallbacks(files, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private uploadFilesWithCallbacks(files: FileParameter[] | null | undefined, onSuccess?: (result: void) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/UploadFiles"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = new FormData(); - if (files !== null && files !== undefined) - files.forEach(item_ => content_.append("files", item_.data, item_.fileName ? item_.fileName : "files") ); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - mimeType: "multipart/form-data", - contentType: false, - headers: { - } - }).done((_data, _textStatus, xhr) => { - this.processUploadFilesWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processUploadFilesWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processUploadFilesWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processUploadFiles(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processUploadFiles(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - saveItems(request: GenericRequestOfAddressAndPerson | null | undefined) { - return new Promise((resolve, reject) => { - this.saveItemsWithCallbacks(request, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private saveItemsWithCallbacks(request: GenericRequestOfAddressAndPerson | null | undefined, onSuccess?: (result: void) => void, onFail?: (exception: Exception | string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/SaveItems"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(request); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/json", - } - }).done((_data, _textStatus, xhr) => { - this.processSaveItemsWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processSaveItemsWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processSaveItemsWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processSaveItems(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processSaveItems(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status === 450) { - const _responseText = xhr.responseText; - let result450: any = null; - let resultData450 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result450 = Exception.fromJS(resultData450); - return throwException("A custom error occured.", status, _responseText, _headers, result450); - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - getUploadedFile(id: number, override: boolean | undefined) { - return new Promise((resolve, reject) => { - this.getUploadedFileWithCallbacks(id, override, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private getUploadedFileWithCallbacks(id: number, override: boolean | undefined, onSuccess?: (result: any | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/GetUploadedFile/{id}?"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - if (override === null) - throw new Error("The parameter 'override' cannot be null."); - else if (override !== undefined) - url_ += "override=" + encodeURIComponent("" + override) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "get", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processGetUploadedFileWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processGetUploadedFileWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processGetUploadedFileWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processGetUploadedFile(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processGetUploadedFile(xhr: any): any | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200 || status === 206) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - postDouble(value: number | null | undefined) { - return new Promise((resolve, reject) => { - this.postDoubleWithCallbacks(value, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private postDoubleWithCallbacks(value: number | null | undefined, onSuccess?: (result: number | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Geo/PostDouble?"; - if (value !== undefined && value !== null) - url_ += "value=" + encodeURIComponent("" + value) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processPostDoubleWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processPostDoubleWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processPostDoubleWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processPostDouble(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processPostDouble(xhr: any): number | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } -} - -export class PersonsClient { - baseUrl: string; - beforeSend: any = undefined; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string) { - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "http://localhost:13452"; - } - - getAll() { - return new Promise((resolve, reject) => { - this.getAllWithCallbacks((result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private getAllWithCallbacks(onSuccess?: (result: Person[] | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons"; - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "get", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processGetAllWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processGetAllWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processGetAllWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processGetAll(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processGetAll(xhr: any): Person[] | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - add(person: Person | null | undefined) { - return new Promise((resolve, reject) => { - this.addWithCallbacks(person, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private addWithCallbacks(person: Person | null | undefined, onSuccess?: (result: void) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(person); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/json", - } - }).done((_data, _textStatus, xhr) => { - this.processAddWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processAddWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processAddWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processAdd(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processAdd(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - find(gender: Gender) { - return new Promise((resolve, reject) => { - this.findWithCallbacks(gender, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private findWithCallbacks(gender: Gender, onSuccess?: (result: Person[] | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/find/{gender}"; - if (gender === undefined || gender === null) - throw new Error("The parameter 'gender' must be defined."); - url_ = url_.replace("{gender}", encodeURIComponent("" + gender)); - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processFindWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processFindWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processFindWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processFind(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processFind(xhr: any): Person[] | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - findOptional(gender: Gender | null) { - return new Promise((resolve, reject) => { - this.findOptionalWithCallbacks(gender, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private findOptionalWithCallbacks(gender: Gender | null, onSuccess?: (result: Person[] | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/find2?"; - if (gender === undefined) - throw new Error("The parameter 'gender' must be defined."); - else if(gender !== null) - url_ += "gender=" + encodeURIComponent("" + gender) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processFindOptionalWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processFindOptionalWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processFindOptionalWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processFindOptional(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processFindOptional(xhr: any): Person[] | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Person.fromJS(item)); - } - else { - result200 = null; - } - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - get(id: string) { - return new Promise((resolve, reject) => { - this.getWithCallbacks(id, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private getWithCallbacks(id: string, onSuccess?: (result: Person | null) => void, onFail?: (exception: PersonNotFoundException | string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/{id}"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "get", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processGetWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processGetWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processGetWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processGet(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processGet(xhr: any): Person | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 500) { - const _responseText = xhr.responseText; - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - - } else if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 ? Person.fromJS(resultData200) : null; - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - delete(id: string) { - return new Promise((resolve, reject) => { - this.deleteWithCallbacks(id, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private deleteWithCallbacks(id: string, onSuccess?: (result: void) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/{id}"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "delete", - dataType: "text", - headers: { - } - }).done((_data, _textStatus, xhr) => { - this.processDeleteWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processDeleteWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processDeleteWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processDelete(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processDelete(xhr: any): void | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 204) { - const _responseText = xhr.responseText; - return; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return; - } - - transform(person: Person | null | undefined) { - return new Promise((resolve, reject) => { - this.transformWithCallbacks(person, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private transformWithCallbacks(person: Person | null | undefined, onSuccess?: (result: Person | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/transform"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(person); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/json", - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processTransformWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processTransformWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processTransformWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processTransform(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processTransform(xhr: any): Person | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 ? Person.fromJS(resultData200) : null; - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - throw(id: string) { - return new Promise((resolve, reject) => { - this.throwWithCallbacks(id, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private throwWithCallbacks(id: string, onSuccess?: (result: Person) => void, onFail?: (exception: PersonNotFoundException | string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/Throw?"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined and cannot be null."); - else - url_ += "id=" + encodeURIComponent("" + id) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processThrowWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processThrowWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processThrowWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processThrow(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processThrow(xhr: any): Person | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = Person.fromJS(resultData200); - return result200; - - } else if (status === 500) { - const _responseText = xhr.responseText; - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - /** - * Gets the name of a person. - * @param id The person ID. - * @return The person's name. - */ - getName(id: string) { - return new Promise((resolve, reject) => { - this.getNameWithCallbacks(id, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private getNameWithCallbacks(id: string, onSuccess?: (result: string) => void, onFail?: (exception: PersonNotFoundException | string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/{id}/Name"; - if (id === undefined || id === null) - throw new Error("The parameter 'id' must be defined."); - url_ = url_.replace("{id}", encodeURIComponent("" + id)); - url_ = url_.replace(/[?&]$/, ""); - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "get", - dataType: "text", - headers: { - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processGetNameWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processGetNameWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processGetNameWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processGetName(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processGetName(xhr: any): string | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status === 500) { - const _responseText = xhr.responseText; - let result500: any = null; - let resultData500 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result500 = PersonNotFoundException.fromJS(resultData500); - return throwException("A server side error occurred.", status, _responseText, _headers, result500); - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - addXml(person: string | null | undefined) { - return new Promise((resolve, reject) => { - this.addXmlWithCallbacks(person, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private addXmlWithCallbacks(person: string | null | undefined, onSuccess?: (result: string | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/AddXml"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = person; - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/xml", - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processAddXmlWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processAddXmlWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processAddXmlWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processAddXml(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processAddXml(xhr: any): string | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } - - upload(data: Blob | null | undefined) { - return new Promise((resolve, reject) => { - this.uploadWithCallbacks(data, (result) => resolve(result), (exception, _reason) => reject(exception)); - }); - } - - private uploadWithCallbacks(data: Blob | null | undefined, onSuccess?: (result: string | null) => void, onFail?: (exception: string, reason: string) => void) { - let url_ = this.baseUrl + "/api/Persons/upload"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = data; - - jQuery.ajax({ - url: url_, - beforeSend: this.beforeSend, - type: "post", - data: content_, - dataType: "text", - headers: { - "Content-Type": "application/octet-stream", - "Accept": "application/json" - } - }).done((_data, _textStatus, xhr) => { - this.processUploadWithCallbacks(url_, xhr, onSuccess, onFail); - }).fail((xhr) => { - this.processUploadWithCallbacks(url_, xhr, onSuccess, onFail); - }); - } - - private processUploadWithCallbacks(_url: string, xhr: any, onSuccess?: any, onFail?: any): void { - try { - let result = this.processUpload(xhr); - if (onSuccess !== undefined) - onSuccess(result); - } catch (e) { - if (onFail !== undefined) - onFail(e, "http_service_exception"); - } - } - - protected processUpload(xhr: any): string | null | null { - const status = xhr.status; - - let _headers: any = {}; - if (status === 200) { - const _responseText = xhr.responseText; - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - - } else if (status !== 200 && status !== 204) { - const _responseText = xhr.responseText; - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - } - return null; - } -} - -export class GeoPoint { - latitude = ko.observable(); - longitude = ko.observable(); - - init(data?: any) { - if (data !== undefined) { - var latitude_: any; - latitude_ = _data["Latitude"]; - this.latitude(latitude_); - - var longitude_: any; - longitude_ = _data["Longitude"]; - this.longitude(longitude_); - - } - } - - static fromJS(data: any): GeoPoint { - let result = new GeoPoint(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - let latitude_: any = this.latitude(); - data["Latitude"] = latitude_; - - let longitude_: any = this.longitude(); - data["Longitude"] = longitude_; - - return data; - } -} - -export class Exception { - message = ko.observable(); - innerException = ko.observable(); - stackTrace = ko.observable(); - source = ko.observable(); - - init(data?: any) { - if (data !== undefined) { - var message_: any; - message_ = _data["Message"]; - this.message(message_); - - var innerException_: any; - innerException_ = _data["InnerException"] ? Exception.fromJS(_data["InnerException"]) : undefined; - this.innerException(innerException_); - - var stackTrace_: any; - stackTrace_ = _data["StackTrace"]; - this.stackTrace(stackTrace_); - - var source_: any; - source_ = _data["Source"]; - this.source(source_); - - } - } - - static fromJS(data: any): Exception { - let result = new Exception(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - let message_: any = this.message(); - data["Message"] = message_; - - let innerException_: any = this.innerException(); - data["InnerException"] = innerException_ ? innerException_.toJSON() : undefined; - - let stackTrace_: any = this.stackTrace(); - data["StackTrace"] = stackTrace_; - - let source_: any = this.source(); - data["Source"] = source_; - - return data; - } -} - -export class GenericRequestOfAddressAndPerson { - item1 = ko.observable
(); - item2 = ko.observable(); - - init(data?: any) { - if (data !== undefined) { - var item1_: any; - item1_ = _data["Item1"] ? Address.fromJS(_data["Item1"]) : undefined; - this.item1(item1_); - - var item2_: any; - item2_ = _data["Item2"] ? Person.fromJS(_data["Item2"]) : undefined; - this.item2(item2_); - - } - } - - static fromJS(data: any): GenericRequestOfAddressAndPerson { - let result = new GenericRequestOfAddressAndPerson(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - let item1_: any = this.item1(); - data["Item1"] = item1_ ? item1_.toJSON() : undefined; - - let item2_: any = this.item2(); - data["Item2"] = item2_ ? item2_.toJSON() : undefined; - - return data; - } -} - -export class Address { - isPrimary = ko.observable(); - city = ko.observable(); - - init(data?: any) { - if (data !== undefined) { - var isPrimary_: any; - isPrimary_ = _data["IsPrimary"]; - this.isPrimary(isPrimary_); - - var city_: any; - city_ = _data["City"]; - this.city(city_); - - } - } - - static fromJS(data: any): Address { - let result = new Address(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - let isPrimary_: any = this.isPrimary(); - data["IsPrimary"] = isPrimary_; - - let city_: any = this.city(); - data["City"] = city_; - - return data; - } -} - -export class Person { - id = ko.observable(); - /** Gets or sets the first name. */ - firstName = ko.observable(); - /** Gets or sets the last name. */ - lastName = ko.observable(); - gender = ko.observable(); - dateOfBirth = ko.observable(); - weight = ko.observable(); - height = ko.observable(); - age = ko.observable(); - averageSleepTime = ko.observable(); - address = ko.observable
(new Address()); - children = ko.observableArray([]); - skills = ko.observable<{ [key: string]: SkillLevel; } | undefined>(); - - protected _discriminator: string; - - constructor() { - this._discriminator = "Person"; - } - - init(data?: any) { - if (data !== undefined) { - var id_: any; - id_ = _data["Id"]; - this.id(id_); - - var firstName_: any; - firstName_ = _data["FirstName"]; - this.firstName(firstName_); - - var lastName_: any; - lastName_ = _data["LastName"]; - this.lastName(lastName_); - - var gender_: any; - gender_ = _data["Gender"]; - this.gender(gender_); - - var dateOfBirth_: any; - dateOfBirth_ = _data["DateOfBirth"] ? new Date(_data["DateOfBirth"].toString()) : undefined; - this.dateOfBirth(dateOfBirth_); - - var weight_: any; - weight_ = _data["Weight"]; - this.weight(weight_); - - var height_: any; - height_ = _data["Height"]; - this.height(height_); - - var age_: any; - age_ = _data["Age"]; - this.age(age_); - - var averageSleepTime_: any; - averageSleepTime_ = _data["AverageSleepTime"]; - this.averageSleepTime(averageSleepTime_); - - var address_: any; - address_ = _data["Address"] ? Address.fromJS(_data["Address"]) : new Address(); - this.address(address_); - - var children_: any; - if (Array.isArray(_data["Children"])) { - children_ = [] as any; - for (let item of _data["Children"]) - children_.push(Person.fromJS(item)); - } - this.children(children_); - - var skills_: any; - if (_data["Skills"]) { - skills_ = {} as any; - for (let key in _data["Skills"]) { - if (_data["Skills"].hasOwnProperty(key)) - (skills_)[key] = _data["Skills"][key]; - } - } - this.skills(skills_); - - } - } - - static fromJS(data: any): Person { - if (data["discriminator"] === "Teacher") { - let result = new Teacher(); - result.init(data); - return result; - } - let result = new Person(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["discriminator"] = this._discriminator; - let id_: any = this.id(); - data["Id"] = id_; - - let firstName_: any = this.firstName(); - data["FirstName"] = firstName_; - - let lastName_: any = this.lastName(); - data["LastName"] = lastName_; - - let gender_: any = this.gender(); - data["Gender"] = gender_; - - let dateOfBirth_: any = this.dateOfBirth(); - data["DateOfBirth"] = dateOfBirth_ ? dateOfBirth_.toISOString() : undefined; - - let weight_: any = this.weight(); - data["Weight"] = weight_; - - let height_: any = this.height(); - data["Height"] = height_; - - let age_: any = this.age(); - data["Age"] = age_; - - let averageSleepTime_: any = this.averageSleepTime(); - data["AverageSleepTime"] = averageSleepTime_; - - let address_: any = this.address(); - data["Address"] = address_ ? address_.toJSON() : undefined; - - let children_: any = this.children(); - if (Array.isArray(children_)) { - data["Children"] = []; - for (let item of children_) - data["Children"].push(item.toJSON()); - } - - let skills_: any = this.skills(); - if (skills_) { - data["Skills"] = {}; - for (let key in skills_) { - if (skills_.hasOwnProperty(key)) - (data["Skills"])[key] = skills_[key]; - } - } - - return data; - } -} - -export enum Gender { - Male = "Male", - Female = "Female", -} - -export enum SkillLevel { - Low = 0, - Medium = 1, - Height = 2, -} - -export class Teacher extends Person { - course = ko.observable(); - skillLevel = ko.observable(SkillLevel.Medium); - - constructor() { - super(); - this._discriminator = "Teacher"; - } - - init(data?: any) { - super.init(data); - if (data !== undefined) { - var course_: any; - course_ = _data["Course"]; - this.course(course_); - - var skillLevel_: any; - skillLevel_ = _data["SkillLevel"] !== undefined ? _data["SkillLevel"] : SkillLevel.Medium; - this.skillLevel(skillLevel_); - - } - } - - static fromJS(data: any): Teacher { - let result = new Teacher(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - let course_: any = this.course(); - data["Course"] = course_; - - let skillLevel_: any = this.skillLevel(); - data["SkillLevel"] = skillLevel_; - - super.toJSON(data); - return data; - } -} - -export class PersonNotFoundException extends Exception { - id = ko.observable(); - - init(data?: any) { - super.init(data); - if (data !== undefined) { - var id_: any; - id_ = _data["id"]; - this.id(id_); - - } - } - - static fromJS(data: any): PersonNotFoundException { - let result = new PersonNotFoundException(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - let id_: any = this.id(); - data["id"] = id_; - - super.toJSON(data); - return data; - } -} - -export interface FileParameter { - data: any; - fileName: string; -} - -export class SwaggerException extends Error { - message: string; - status: number; - response: string; - headers: { [key: string]: any; }; - result: any; - - constructor(message: string, status: number, response: string, headers: { [key: string]: any; }, result: any) { - super(); - - this.message = message; - this.status = status; - this.response = response; - this.headers = headers; - this.result = result; - } - - protected isSwaggerException = true; - - static isSwaggerException(obj: any): obj is SwaggerException { - return obj.isSwaggerException === true; - } -} - -function throwException(message: string, status: number, response: string, headers: { [key: string]: any; }, result?: any): any { - if (result !== null && result !== undefined) - throw result; - else - throw new SwaggerException(message, status, response, headers, null); -} \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsPetStoreFetch.ts b/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsPetStoreFetch.ts deleted file mode 100644 index b00d7eef5d..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsPetStoreFetch.ts +++ /dev/null @@ -1,1289 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -//---------------------- -// -// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- -// ReSharper disable InconsistentNaming - -export class Client { - private http: { fetch(url: RequestInfo, init?: RequestInit): Promise }; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { - this.http = http ? http : window; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://petstore.swagger.io/v2"; - } - - /** - * uploads an image - * @param petId ID of pet to update - * @param additionalMetadata (optional) Additional data to pass to server - * @param file (optional) file to upload - * @return successful operation - */ - uploadFile(petId: number, additionalMetadata: string | null | undefined, file: FileParameter | null | undefined): Promise { - let url_ = this.baseUrl + "/pet/{petId}/uploadImage"; - if (petId === undefined || petId === null) - throw new Error("The parameter 'petId' must be defined."); - url_ = url_.replace("{petId}", encodeURIComponent("" + petId)); - url_ = url_.replace(/[?&]$/, ""); - - const content_ = new FormData(); - if (additionalMetadata !== null && additionalMetadata !== undefined) - content_.append("additionalMetadata", additionalMetadata.toString()); - if (file !== null && file !== undefined) - content_.append("file", file.data, file.fileName ? file.fileName : "file"); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processUploadFile(_response); - }); - } - - protected processUploadFile(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = ApiResponse.fromJS(resultData200); - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Add a new pet to the store - * @param body Pet object that needs to be added to the store - */ - addPet(body: Pet): Promise { - let url_ = this.baseUrl + "/pet"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(body); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/json", - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processAddPet(_response); - }); - } - - protected processAddPet(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 405) { - return response.text().then((_responseText) => { - return throwException("Invalid input", status, _responseText, _headers); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Update an existing pet - * @param body Pet object that needs to be added to the store - */ - updatePet(body: Pet): Promise { - let url_ = this.baseUrl + "/pet"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(body); - - let options_ = { - body: content_, - method: "PUT", - headers: { - "Content-Type": "application/json", - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processUpdatePet(_response); - }); - } - - protected processUpdatePet(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 400) { - return response.text().then((_responseText) => { - return throwException("Invalid ID supplied", status, _responseText, _headers); - }); - } else if (status === 404) { - return response.text().then((_responseText) => { - return throwException("Pet not found", status, _responseText, _headers); - }); - } else if (status === 405) { - return response.text().then((_responseText) => { - return throwException("Validation exception", status, _responseText, _headers); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Finds Pets by status - * @param status Status values that need to be considered for filter - * @return successful operation - */ - findPetsByStatus(status: Status[]): Promise { - let url_ = this.baseUrl + "/pet/findByStatus?"; - if (status === undefined || status === null) - throw new Error("The parameter 'status' must be defined and cannot be null."); - else - status && status.forEach(item => { url_ += "status=" + encodeURIComponent("" + item) + "&"; }); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processFindPetsByStatus(_response); - }); - } - - protected processFindPetsByStatus(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Pet.fromJS(item)); - } - else { - result200 = null; - } - return result200; - }); - } else if (status === 400) { - return response.text().then((_responseText) => { - return throwException("Invalid status value", status, _responseText, _headers); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Finds Pets by tags - * @param tags Tags to filter by - * @return successful operation - * @deprecated - */ - findPetsByTags(tags: string[]): Promise { - let url_ = this.baseUrl + "/pet/findByTags?"; - if (tags === undefined || tags === null) - throw new Error("The parameter 'tags' must be defined and cannot be null."); - else - tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; }); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processFindPetsByTags(_response); - }); - } - - protected processFindPetsByTags(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Pet.fromJS(item)); - } - else { - result200 = null; - } - return result200; - }); - } else if (status === 400) { - return response.text().then((_responseText) => { - return throwException("Invalid tag value", status, _responseText, _headers); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Find pet by ID - * @param petId ID of pet to return - * @return successful operation - */ - getPetById(petId: number): Promise { - let url_ = this.baseUrl + "/pet/{petId}"; - if (petId === undefined || petId === null) - throw new Error("The parameter 'petId' must be defined."); - url_ = url_.replace("{petId}", encodeURIComponent("" + petId)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processGetPetById(_response); - }); - } - - protected processGetPetById(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = Pet.fromJS(resultData200); - return result200; - }); - } else if (status === 400) { - return response.text().then((_responseText) => { - return throwException("Invalid ID supplied", status, _responseText, _headers); - }); - } else if (status === 404) { - return response.text().then((_responseText) => { - return throwException("Pet not found", status, _responseText, _headers); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Updates a pet in the store with form data - * @param petId ID of pet that needs to be updated - * @param name (optional) Updated name of the pet - * @param status (optional) Updated status of the pet - */ - updatePetWithForm(petId: number, name: string | null | undefined, status: string | null | undefined): Promise { - let url_ = this.baseUrl + "/pet/{petId}"; - if (petId === undefined || petId === null) - throw new Error("The parameter 'petId' must be defined."); - url_ = url_.replace("{petId}", encodeURIComponent("" + petId)); - url_ = url_.replace(/[?&]$/, ""); - - let content_ = ""; - if (name !== undefined) - content_ += encodeURIComponent("name") + "=" + encodeURIComponent("" + name) + "&"; - if (status !== undefined) - content_ += encodeURIComponent("status") + "=" + encodeURIComponent("" + status) + "&"; - content_ = content_.replace(/&$/, ""); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/x-www-form-urlencoded", - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processUpdatePetWithForm(_response); - }); - } - - protected processUpdatePetWithForm(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 405) { - return response.text().then((_responseText) => { - return throwException("Invalid input", status, _responseText, _headers); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Deletes a pet - * @param api_key (optional) - * @param petId Pet id to delete - */ - deletePet(api_key: string | null | undefined, petId: number): Promise { - let url_ = this.baseUrl + "/pet/{petId}"; - if (petId === undefined || petId === null) - throw new Error("The parameter 'petId' must be defined."); - url_ = url_.replace("{petId}", encodeURIComponent("" + petId)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "DELETE", - headers: { - "api_key": api_key !== undefined && api_key !== null ? "" + api_key : "", - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processDeletePet(_response); - }); - } - - protected processDeletePet(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 400) { - return response.text().then((_responseText) => { - return throwException("Invalid ID supplied", status, _responseText, _headers); - }); - } else if (status === 404) { - return response.text().then((_responseText) => { - return throwException("Pet not found", status, _responseText, _headers); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Place an order for a pet - * @param body order placed for purchasing the pet - * @return successful operation - */ - placeOrder(body: Order): Promise { - let url_ = this.baseUrl + "/store/order"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(body); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/json", - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processPlaceOrder(_response); - }); - } - - protected processPlaceOrder(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = Order.fromJS(resultData200); - return result200; - }); - } else if (status === 400) { - return response.text().then((_responseText) => { - return throwException("Invalid Order", status, _responseText, _headers); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Find purchase order by ID - * @param orderId ID of pet that needs to be fetched - * @return successful operation - */ - getOrderById(orderId: number): Promise { - let url_ = this.baseUrl + "/store/order/{orderId}"; - if (orderId === undefined || orderId === null) - throw new Error("The parameter 'orderId' must be defined."); - url_ = url_.replace("{orderId}", encodeURIComponent("" + orderId)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processGetOrderById(_response); - }); - } - - protected processGetOrderById(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = Order.fromJS(resultData200); - return result200; - }); - } else if (status === 400) { - return response.text().then((_responseText) => { - return throwException("Invalid ID supplied", status, _responseText, _headers); - }); - } else if (status === 404) { - return response.text().then((_responseText) => { - return throwException("Order not found", status, _responseText, _headers); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Delete purchase order by ID - * @param orderId ID of the order that needs to be deleted - */ - deleteOrder(orderId: number): Promise { - let url_ = this.baseUrl + "/store/order/{orderId}"; - if (orderId === undefined || orderId === null) - throw new Error("The parameter 'orderId' must be defined."); - url_ = url_.replace("{orderId}", encodeURIComponent("" + orderId)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "DELETE", - headers: { - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processDeleteOrder(_response); - }); - } - - protected processDeleteOrder(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 400) { - return response.text().then((_responseText) => { - return throwException("Invalid ID supplied", status, _responseText, _headers); - }); - } else if (status === 404) { - return response.text().then((_responseText) => { - return throwException("Order not found", status, _responseText, _headers); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Returns pet inventories by status - * @return successful operation - */ - getInventory(): Promise<{ [key: string]: number; }> { - let url_ = this.baseUrl + "/store/inventory"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processGetInventory(_response); - }); - } - - protected processGetInventory(response: Response): Promise<{ [key: string]: number; }> { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (resultData200) { - result200 = {} as any; - for (let key in resultData200) { - if (resultData200.hasOwnProperty(key)) - (result200)[key] = resultData200[key] !== undefined ? resultData200[key] : null; - } - } - else { - result200 = null; - } - return result200; - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve<{ [key: string]: number; }>(null); - } - - /** - * Creates list of users with given input array - * @param body List of user object - * @return successful operation - */ - createUsersWithArrayInput(body: User[]): Promise { - let url_ = this.baseUrl + "/user/createWithArray"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(body); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/json", - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processCreateUsersWithArrayInput(_response); - }); - } - - protected processCreateUsersWithArrayInput(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - { - return response.text().then((_responseText) => { - return; - }); - } - } - - /** - * Creates list of users with given input array - * @param body List of user object - * @return successful operation - */ - createUsersWithListInput(body: User[]): Promise { - let url_ = this.baseUrl + "/user/createWithList"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(body); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/json", - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processCreateUsersWithListInput(_response); - }); - } - - protected processCreateUsersWithListInput(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - { - return response.text().then((_responseText) => { - return; - }); - } - } - - /** - * Get user by user name - * @param username The name that needs to be fetched. Use user1 for testing. - * @return successful operation - */ - getUserByName(username: string): Promise { - let url_ = this.baseUrl + "/user/{username}"; - if (username === undefined || username === null) - throw new Error("The parameter 'username' must be defined."); - url_ = url_.replace("{username}", encodeURIComponent("" + username)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processGetUserByName(_response); - }); - } - - protected processGetUserByName(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = User.fromJS(resultData200); - return result200; - }); - } else if (status === 400) { - return response.text().then((_responseText) => { - return throwException("Invalid username supplied", status, _responseText, _headers); - }); - } else if (status === 404) { - return response.text().then((_responseText) => { - return throwException("User not found", status, _responseText, _headers); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Updated user - * @param username name that need to be updated - * @param body Updated user object - */ - updateUser(username: string, body: User): Promise { - let url_ = this.baseUrl + "/user/{username}"; - if (username === undefined || username === null) - throw new Error("The parameter 'username' must be defined."); - url_ = url_.replace("{username}", encodeURIComponent("" + username)); - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(body); - - let options_ = { - body: content_, - method: "PUT", - headers: { - "Content-Type": "application/json", - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processUpdateUser(_response); - }); - } - - protected processUpdateUser(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 400) { - return response.text().then((_responseText) => { - return throwException("Invalid user supplied", status, _responseText, _headers); - }); - } else if (status === 404) { - return response.text().then((_responseText) => { - return throwException("User not found", status, _responseText, _headers); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Delete user - * @param username The name that needs to be deleted - */ - deleteUser(username: string): Promise { - let url_ = this.baseUrl + "/user/{username}"; - if (username === undefined || username === null) - throw new Error("The parameter 'username' must be defined."); - url_ = url_.replace("{username}", encodeURIComponent("" + username)); - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "DELETE", - headers: { - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processDeleteUser(_response); - }); - } - - protected processDeleteUser(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 400) { - return response.text().then((_responseText) => { - return throwException("Invalid username supplied", status, _responseText, _headers); - }); - } else if (status === 404) { - return response.text().then((_responseText) => { - return throwException("User not found", status, _responseText, _headers); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Logs user into the system - * @param username The user name for login - * @param password The password for login in clear text - * @return successful operation - */ - loginUser(username: string, password: string): Promise { - let url_ = this.baseUrl + "/user/login?"; - if (username === undefined || username === null) - throw new Error("The parameter 'username' must be defined and cannot be null."); - else - url_ += "username=" + encodeURIComponent("" + username) + "&"; - if (password === undefined || password === null) - throw new Error("The parameter 'password' must be defined and cannot be null."); - else - url_ += "password=" + encodeURIComponent("" + password) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processLoginUser(_response); - }); - } - - protected processLoginUser(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = resultData200 !== undefined ? resultData200 : null; - - return result200; - }); - } else if (status === 400) { - return response.text().then((_responseText) => { - return throwException("Invalid username/password supplied", status, _responseText, _headers); - }); - } else if (status !== 200 && status !== 204) { - return response.text().then((_responseText) => { - return throwException("An unexpected server error occurred.", status, _responseText, _headers); - }); - } - return Promise.resolve(null); - } - - /** - * Logs out current logged in user session - * @return successful operation - */ - logoutUser(): Promise { - let url_ = this.baseUrl + "/user/logout"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processLogoutUser(_response); - }); - } - - protected processLogoutUser(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - { - return response.text().then((_responseText) => { - return; - }); - } - } - - /** - * Create user - * @param body Created user object - * @return successful operation - */ - createUser(body: User): Promise { - let url_ = this.baseUrl + "/user"; - url_ = url_.replace(/[?&]$/, ""); - - const content_ = JSON.stringify(body); - - let options_ = { - body: content_, - method: "POST", - headers: { - "Content-Type": "application/json", - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processCreateUser(_response); - }); - } - - protected processCreateUser(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - { - return response.text().then((_responseText) => { - return; - }); - } - } -} - -export class ApiResponse implements IApiResponse { - code: number | undefined; - type: string | undefined; - message: string | undefined; - - constructor(data?: IApiResponse) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.code = _data["code"]; - this.type = _data["type"]; - this.message = _data["message"]; - } - } - - static fromJS(data: any): ApiResponse { - data = typeof data === 'object' ? data : {}; - let result = new ApiResponse(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["code"] = this.code; - data["type"] = this.type; - data["message"] = this.message; - return data; - } -} - -export interface IApiResponse { - code: number | undefined; - type: string | undefined; - message: string | undefined; -} - -export class Category implements ICategory { - id: number | undefined; - name: string | undefined; - - constructor(data?: ICategory) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data["id"]; - this.name = _data["name"]; - } - } - - static fromJS(data: any): Category { - data = typeof data === 'object' ? data : {}; - let result = new Category(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["id"] = this.id; - data["name"] = this.name; - return data; - } -} - -export interface ICategory { - id: number | undefined; - name: string | undefined; -} - -export class Pet implements IPet { - id: number | undefined; - category: Category | undefined; - name: string; - photoUrls: string[]; - tags: Tag[] | undefined; - /** pet status in the store */ - status: PetStatus | undefined; - - constructor(data?: IPet) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - if (!data) { - this.photoUrls = []; - } - } - - init(_data?: any) { - if (_data) { - this.id = _data["id"]; - this.category = _data["category"] ? Category.fromJS(_data["category"]) : undefined; - this.name = _data["name"]; - if (Array.isArray(_data["photoUrls"])) { - this.photoUrls = [] as any; - for (let item of _data["photoUrls"]) - this.photoUrls.push(item); - } - if (Array.isArray(_data["tags"])) { - this.tags = [] as any; - for (let item of _data["tags"]) - this.tags.push(Tag.fromJS(item)); - } - this.status = _data["status"]; - } - } - - static fromJS(data: any): Pet { - data = typeof data === 'object' ? data : {}; - let result = new Pet(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["id"] = this.id; - data["category"] = this.category ? this.category.toJSON() : undefined; - data["name"] = this.name; - if (Array.isArray(this.photoUrls)) { - data["photoUrls"] = []; - for (let item of this.photoUrls) - data["photoUrls"].push(item); - } - if (Array.isArray(this.tags)) { - data["tags"] = []; - for (let item of this.tags) - data["tags"].push(item.toJSON()); - } - data["status"] = this.status; - return data; - } -} - -export interface IPet { - id: number | undefined; - category: Category | undefined; - name: string; - photoUrls: string[]; - tags: Tag[] | undefined; - /** pet status in the store */ - status: PetStatus | undefined; -} - -export class Tag implements ITag { - id: number | undefined; - name: string | undefined; - - constructor(data?: ITag) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data["id"]; - this.name = _data["name"]; - } - } - - static fromJS(data: any): Tag { - data = typeof data === 'object' ? data : {}; - let result = new Tag(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["id"] = this.id; - data["name"] = this.name; - return data; - } -} - -export interface ITag { - id: number | undefined; - name: string | undefined; -} - -export class Order implements IOrder { - id: number | undefined; - petId: number | undefined; - quantity: number | undefined; - shipDate: Date | undefined; - /** Order Status */ - status: OrderStatus | undefined; - complete: boolean | undefined; - - constructor(data?: IOrder) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data["id"]; - this.petId = _data["petId"]; - this.quantity = _data["quantity"]; - this.shipDate = _data["shipDate"] ? new Date(_data["shipDate"].toString()) : undefined; - this.status = _data["status"]; - this.complete = _data["complete"]; - } - } - - static fromJS(data: any): Order { - data = typeof data === 'object' ? data : {}; - let result = new Order(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["id"] = this.id; - data["petId"] = this.petId; - data["quantity"] = this.quantity; - data["shipDate"] = this.shipDate ? this.shipDate.toISOString() : undefined; - data["status"] = this.status; - data["complete"] = this.complete; - return data; - } -} - -export interface IOrder { - id: number | undefined; - petId: number | undefined; - quantity: number | undefined; - shipDate: Date | undefined; - /** Order Status */ - status: OrderStatus | undefined; - complete: boolean | undefined; -} - -export class User implements IUser { - id: number | undefined; - username: string | undefined; - firstName: string | undefined; - lastName: string | undefined; - email: string | undefined; - password: string | undefined; - phone: string | undefined; - /** User Status */ - userStatus: number | undefined; - - constructor(data?: IUser) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.id = _data["id"]; - this.username = _data["username"]; - this.firstName = _data["firstName"]; - this.lastName = _data["lastName"]; - this.email = _data["email"]; - this.password = _data["password"]; - this.phone = _data["phone"]; - this.userStatus = _data["userStatus"]; - } - } - - static fromJS(data: any): User { - data = typeof data === 'object' ? data : {}; - let result = new User(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["id"] = this.id; - data["username"] = this.username; - data["firstName"] = this.firstName; - data["lastName"] = this.lastName; - data["email"] = this.email; - data["password"] = this.password; - data["phone"] = this.phone; - data["userStatus"] = this.userStatus; - return data; - } -} - -export interface IUser { - id: number | undefined; - username: string | undefined; - firstName: string | undefined; - lastName: string | undefined; - email: string | undefined; - password: string | undefined; - phone: string | undefined; - /** User Status */ - userStatus: number | undefined; -} - -export enum Status { - Available = "available", - Pending = "pending", - Sold = "sold", -} - -export enum PetStatus { - Available = "available", - Pending = "pending", - Sold = "sold", -} - -export enum OrderStatus { - Placed = "placed", - Approved = "approved", - Delivered = "delivered", -} - -export interface FileParameter { - data: any; - fileName: string; -} - -export class ApiException extends Error { - message: string; - status: number; - response: string; - headers: { [key: string]: any; }; - result: any; - - constructor(message: string, status: number, response: string, headers: { [key: string]: any; }, result: any) { - super(); - - this.message = message; - this.status = status; - this.response = response; - this.headers = headers; - this.result = result; - } - - protected isApiException = true; - - static isApiException(obj: any): obj is ApiException { - return obj.isApiException === true; - } -} - -function throwException(message: string, status: number, response: string, headers: { [key: string]: any; }, result?: any): any { - if (result !== null && result !== undefined) - throw result; - else - throw new ApiException(message, status, response, headers, null); -} \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsUberFetch.ts b/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsUberFetch.ts deleted file mode 100644 index d63343e34a..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsUberFetch.ts +++ /dev/null @@ -1,662 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -//---------------------- -// -// Generated using the NSwag toolchain v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- -// ReSharper disable InconsistentNaming - -export class Client { - private http: { fetch(url: RequestInfo, init?: RequestInit): Promise }; - private baseUrl: string; - protected jsonParseReviver: ((key: string, value: any) => any) | undefined = undefined; - - constructor(baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise }) { - this.http = http ? http : window; - this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "https://api.uber.com/v1"; - } - - /** - * Product Types - * @param latitude Latitude component of location. - * @param longitude Longitude component of location. - * @return An array of products - */ - products(latitude: number, longitude: number): Promise { - let url_ = this.baseUrl + "/products?"; - if (latitude === undefined || latitude === null) - throw new Error("The parameter 'latitude' must be defined and cannot be null."); - else - url_ += "latitude=" + encodeURIComponent("" + latitude) + "&"; - if (longitude === undefined || longitude === null) - throw new Error("The parameter 'longitude' must be defined and cannot be null."); - else - url_ += "longitude=" + encodeURIComponent("" + longitude) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processProducts(_response); - }); - } - - protected processProducts(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Product.fromJS(item)); - } - else { - result200 = null; - } - return result200; - }); - } else { - return response.text().then((_responseText) => { - let resultdefault: any = null; - let resultDatadefault = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - resultdefault = ErrorDto.fromJS(resultDatadefault); - return throwException("Unexpected error", status, _responseText, _headers, resultdefault); - }); - } - } - - /** - * Price Estimates - * @param start_latitude Latitude component of start location. - * @param start_longitude Longitude component of start location. - * @param end_latitude Latitude component of end location. - * @param end_longitude Longitude component of end location. - * @return An array of price estimates by product - */ - price(start_latitude: number, start_longitude: number, end_latitude: number, end_longitude: number): Promise { - let url_ = this.baseUrl + "/estimates/price?"; - if (start_latitude === undefined || start_latitude === null) - throw new Error("The parameter 'start_latitude' must be defined and cannot be null."); - else - url_ += "start_latitude=" + encodeURIComponent("" + start_latitude) + "&"; - if (start_longitude === undefined || start_longitude === null) - throw new Error("The parameter 'start_longitude' must be defined and cannot be null."); - else - url_ += "start_longitude=" + encodeURIComponent("" + start_longitude) + "&"; - if (end_latitude === undefined || end_latitude === null) - throw new Error("The parameter 'end_latitude' must be defined and cannot be null."); - else - url_ += "end_latitude=" + encodeURIComponent("" + end_latitude) + "&"; - if (end_longitude === undefined || end_longitude === null) - throw new Error("The parameter 'end_longitude' must be defined and cannot be null."); - else - url_ += "end_longitude=" + encodeURIComponent("" + end_longitude) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processPrice(_response); - }); - } - - protected processPrice(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(PriceEstimate.fromJS(item)); - } - else { - result200 = null; - } - return result200; - }); - } else { - return response.text().then((_responseText) => { - let resultdefault: any = null; - let resultDatadefault = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - resultdefault = ErrorDto.fromJS(resultDatadefault); - return throwException("Unexpected error", status, _responseText, _headers, resultdefault); - }); - } - } - - /** - * Time Estimates - * @param start_latitude Latitude component of start location. - * @param start_longitude Longitude component of start location. - * @param customer_uuid (optional) Unique customer identifier to be used for experience customization. - * @param product_id (optional) Unique identifier representing a specific product for a given latitude & longitude. - * @return An array of products - */ - time(start_latitude: number, start_longitude: number, customer_uuid: string | null | undefined, product_id: string | null | undefined): Promise { - let url_ = this.baseUrl + "/estimates/time?"; - if (start_latitude === undefined || start_latitude === null) - throw new Error("The parameter 'start_latitude' must be defined and cannot be null."); - else - url_ += "start_latitude=" + encodeURIComponent("" + start_latitude) + "&"; - if (start_longitude === undefined || start_longitude === null) - throw new Error("The parameter 'start_longitude' must be defined and cannot be null."); - else - url_ += "start_longitude=" + encodeURIComponent("" + start_longitude) + "&"; - if (customer_uuid !== undefined && customer_uuid !== null) - url_ += "customer_uuid=" + encodeURIComponent("" + customer_uuid) + "&"; - if (product_id !== undefined && product_id !== null) - url_ += "product_id=" + encodeURIComponent("" + product_id) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processTime(_response); - }); - } - - protected processTime(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - if (Array.isArray(resultData200)) { - result200 = [] as any; - for (let item of resultData200) - result200.push(Product.fromJS(item)); - } - else { - result200 = null; - } - return result200; - }); - } else { - return response.text().then((_responseText) => { - let resultdefault: any = null; - let resultDatadefault = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - resultdefault = ErrorDto.fromJS(resultDatadefault); - return throwException("Unexpected error", status, _responseText, _headers, resultdefault); - }); - } - } - - /** - * User Profile - * @return Profile information for a user - */ - me(): Promise { - let url_ = this.baseUrl + "/me"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processMe(_response); - }); - } - - protected processMe(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = Profile.fromJS(resultData200); - return result200; - }); - } else { - return response.text().then((_responseText) => { - let resultdefault: any = null; - let resultDatadefault = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - resultdefault = ErrorDto.fromJS(resultDatadefault); - return throwException("Unexpected error", status, _responseText, _headers, resultdefault); - }); - } - } - - /** - * User Activity - * @param offset (optional) Offset the list of returned results by this amount. Default is zero. - * @param limit (optional) Number of items to retrieve. Default is 5, maximum is 100. - * @return History information for the given user - */ - history(offset: number | null | undefined, limit: number | null | undefined): Promise { - let url_ = this.baseUrl + "/history?"; - if (offset !== undefined && offset !== null) - url_ += "offset=" + encodeURIComponent("" + offset) + "&"; - if (limit !== undefined && limit !== null) - url_ += "limit=" + encodeURIComponent("" + limit) + "&"; - url_ = url_.replace(/[?&]$/, ""); - - let options_ = { - method: "GET", - headers: { - "Accept": "application/json" - } - }; - - return this.http.fetch(url_, options_).then((_response: Response) => { - return this.processHistory(_response); - }); - } - - protected processHistory(response: Response): Promise { - const status = response.status; - let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; - if (status === 200) { - return response.text().then((_responseText) => { - let result200: any = null; - let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - result200 = Activities.fromJS(resultData200); - return result200; - }); - } else { - return response.text().then((_responseText) => { - let resultdefault: any = null; - let resultDatadefault = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); - resultdefault = ErrorDto.fromJS(resultDatadefault); - return throwException("Unexpected error", status, _responseText, _headers, resultdefault); - }); - } - } -} - -export class Product implements IProduct { - /** Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. */ - product_id: string | undefined; - /** Description of product. */ - description: string | undefined; - /** Display name of product. */ - display_name: string | undefined; - /** Capacity of product. For example, 4 people. */ - capacity: string | undefined; - /** Image URL representing the product. */ - image: string | undefined; - - constructor(data?: IProduct) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.product_id = _data["product_id"]; - this.description = _data["description"]; - this.display_name = _data["display_name"]; - this.capacity = _data["capacity"]; - this.image = _data["image"]; - } - } - - static fromJS(data: any): Product { - data = typeof data === 'object' ? data : {}; - let result = new Product(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["product_id"] = this.product_id; - data["description"] = this.description; - data["display_name"] = this.display_name; - data["capacity"] = this.capacity; - data["image"] = this.image; - return data; - } -} - -export interface IProduct { - /** Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles. */ - product_id: string | undefined; - /** Description of product. */ - description: string | undefined; - /** Display name of product. */ - display_name: string | undefined; - /** Capacity of product. For example, 4 people. */ - capacity: string | undefined; - /** Image URL representing the product. */ - image: string | undefined; -} - -export class PriceEstimate implements IPriceEstimate { - /** Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles */ - product_id: string | undefined; - /** [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code. */ - currency_code: string | undefined; - /** Display name of product. */ - display_name: string | undefined; - /** Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or "Metered" for TAXI. */ - estimate: string | undefined; - /** Lower bound of the estimated price. */ - low_estimate: number | undefined; - /** Upper bound of the estimated price. */ - high_estimate: number | undefined; - /** Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier. */ - surge_multiplier: number | undefined; - - constructor(data?: IPriceEstimate) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.product_id = _data["product_id"]; - this.currency_code = _data["currency_code"]; - this.display_name = _data["display_name"]; - this.estimate = _data["estimate"]; - this.low_estimate = _data["low_estimate"]; - this.high_estimate = _data["high_estimate"]; - this.surge_multiplier = _data["surge_multiplier"]; - } - } - - static fromJS(data: any): PriceEstimate { - data = typeof data === 'object' ? data : {}; - let result = new PriceEstimate(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["product_id"] = this.product_id; - data["currency_code"] = this.currency_code; - data["display_name"] = this.display_name; - data["estimate"] = this.estimate; - data["low_estimate"] = this.low_estimate; - data["high_estimate"] = this.high_estimate; - data["surge_multiplier"] = this.surge_multiplier; - return data; - } -} - -export interface IPriceEstimate { - /** Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles */ - product_id: string | undefined; - /** [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code. */ - currency_code: string | undefined; - /** Display name of product. */ - display_name: string | undefined; - /** Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or "Metered" for TAXI. */ - estimate: string | undefined; - /** Lower bound of the estimated price. */ - low_estimate: number | undefined; - /** Upper bound of the estimated price. */ - high_estimate: number | undefined; - /** Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier. */ - surge_multiplier: number | undefined; -} - -export class Profile implements IProfile { - /** First name of the Uber user. */ - first_name: string | undefined; - /** Last name of the Uber user. */ - last_name: string | undefined; - /** Email address of the Uber user */ - email: string | undefined; - /** Image URL of the Uber user. */ - picture: string | undefined; - /** Promo code of the Uber user. */ - promo_code: string | undefined; - - constructor(data?: IProfile) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.first_name = _data["first_name"]; - this.last_name = _data["last_name"]; - this.email = _data["email"]; - this.picture = _data["picture"]; - this.promo_code = _data["promo_code"]; - } - } - - static fromJS(data: any): Profile { - data = typeof data === 'object' ? data : {}; - let result = new Profile(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["first_name"] = this.first_name; - data["last_name"] = this.last_name; - data["email"] = this.email; - data["picture"] = this.picture; - data["promo_code"] = this.promo_code; - return data; - } -} - -export interface IProfile { - /** First name of the Uber user. */ - first_name: string | undefined; - /** Last name of the Uber user. */ - last_name: string | undefined; - /** Email address of the Uber user */ - email: string | undefined; - /** Image URL of the Uber user. */ - picture: string | undefined; - /** Promo code of the Uber user. */ - promo_code: string | undefined; -} - -export class Activity implements IActivity { - /** Unique identifier for the activity */ - uuid: string | undefined; - - constructor(data?: IActivity) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.uuid = _data["uuid"]; - } - } - - static fromJS(data: any): Activity { - data = typeof data === 'object' ? data : {}; - let result = new Activity(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["uuid"] = this.uuid; - return data; - } -} - -export interface IActivity { - /** Unique identifier for the activity */ - uuid: string | undefined; -} - -export class Activities implements IActivities { - /** Position in pagination. */ - offset: number | undefined; - /** Number of items to retrieve (100 max). */ - limit: number | undefined; - /** Total number of items available. */ - count: number | undefined; - history: Activity[] | undefined; - - constructor(data?: IActivities) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.offset = _data["offset"]; - this.limit = _data["limit"]; - this.count = _data["count"]; - if (Array.isArray(_data["history"])) { - this.history = [] as any; - for (let item of _data["history"]) - this.history.push(Activity.fromJS(item)); - } - } - } - - static fromJS(data: any): Activities { - data = typeof data === 'object' ? data : {}; - let result = new Activities(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["offset"] = this.offset; - data["limit"] = this.limit; - data["count"] = this.count; - if (Array.isArray(this.history)) { - data["history"] = []; - for (let item of this.history) - data["history"].push(item.toJSON()); - } - return data; - } -} - -export interface IActivities { - /** Position in pagination. */ - offset: number | undefined; - /** Number of items to retrieve (100 max). */ - limit: number | undefined; - /** Total number of items available. */ - count: number | undefined; - history: Activity[] | undefined; -} - -export class ErrorDto implements IErrorDto { - code: number | undefined; - message: string | undefined; - fields: string | undefined; - - constructor(data?: IErrorDto) { - if (data) { - for (var property in data) { - if (data.hasOwnProperty(property)) - (this)[property] = (data)[property]; - } - } - } - - init(_data?: any) { - if (_data) { - this.code = _data["code"]; - this.message = _data["message"]; - this.fields = _data["fields"]; - } - } - - static fromJS(data: any): ErrorDto { - data = typeof data === 'object' ? data : {}; - let result = new ErrorDto(); - result.init(data); - return result; - } - - toJSON(data?: any) { - data = typeof data === 'object' ? data : {}; - data["code"] = this.code; - data["message"] = this.message; - data["fields"] = this.fields; - return data; - } -} - -export interface IErrorDto { - code: number | undefined; - message: string | undefined; - fields: string | undefined; -} - -export class ApiException extends Error { - message: string; - status: number; - response: string; - headers: { [key: string]: any; }; - result: any; - - constructor(message: string, status: number, response: string, headers: { [key: string]: any; }, result: any) { - super(); - - this.message = message; - this.status = status; - this.response = response; - this.headers = headers; - this.result = result; - } - - protected isApiException = true; - - static isApiException(obj: any): obj is ApiException { - return obj.isApiException === true; - } -} - -function throwException(message: string, status: number, response: string, headers: { [key: string]: any; }, result?: any): any { - throw new ApiException(message, status, response, headers, result); -} \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/scripts/typings/fetch.d.ts b/src/NSwag.Integration.TypeScriptWeb/scripts/typings/fetch.d.ts deleted file mode 100644 index ff6261932b..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/scripts/typings/fetch.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -interface URLSearchParams { - -} \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/tsc b/src/NSwag.Integration.TypeScriptWeb/tsc deleted file mode 100644 index a1c517ed7b..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/tsc +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/node_modules/typescript/bin/tsc" "$@" - ret=$? -else - node "$basedir/node_modules/typescript/bin/tsc" "$@" - ret=$? -fi -exit $ret diff --git a/src/NSwag.Integration.TypeScriptWeb/tsc.cmd b/src/NSwag.Integration.TypeScriptWeb/tsc.cmd deleted file mode 100644 index 6693f421e8..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/tsc.cmd +++ /dev/null @@ -1,7 +0,0 @@ -@IF EXIST "%~dp0\node.exe" ( - "%~dp0\node.exe" "%~dp0\node_modules\typescript\bin\tsc" %* -) ELSE ( - @SETLOCAL - @SET PATHEXT=%PATHEXT:;.JS;=;% - node "%~dp0\node_modules\typescript\bin\tsc" %* -) \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/tsconfig.json b/src/NSwag.Integration.TypeScriptWeb/tsconfig.json deleted file mode 100644 index c569880dbd..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/tsconfig.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "compilerOptions": { - "outDir": "../dist", - "target": "es5", - "module": "es2015", - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "sourceMap": true, - "inlineSources": true, - "noEmitHelpers": false, - "strictNullChecks": true, - "noImplicitAny": true, - "declaration": true, - "skipLibCheck": false, - "stripInternal": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "lib": ["dom", "es6"], - "types": [ - "jasmine" - ] - }, - "exclude": [ - "node_modules" - ] -} \ No newline at end of file diff --git a/src/NSwag.Integration.TypeScriptWeb/tsserver b/src/NSwag.Integration.TypeScriptWeb/tsserver deleted file mode 100644 index 186b5d36c4..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/tsserver +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") - -case `uname` in - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/node_modules/typescript/bin/tsserver" "$@" - ret=$? -else - node "$basedir/node_modules/typescript/bin/tsserver" "$@" - ret=$? -fi -exit $ret diff --git a/src/NSwag.Integration.TypeScriptWeb/tsserver.cmd b/src/NSwag.Integration.TypeScriptWeb/tsserver.cmd deleted file mode 100644 index 59f5b02d45..0000000000 --- a/src/NSwag.Integration.TypeScriptWeb/tsserver.cmd +++ /dev/null @@ -1,7 +0,0 @@ -@IF EXIST "%~dp0\node.exe" ( - "%~dp0\node.exe" "%~dp0\node_modules\typescript\bin\tsserver" %* -) ELSE ( - @SETLOCAL - @SET PATHEXT=%PATHEXT:;.JS;=;% - node "%~dp0\node_modules\typescript\bin\tsserver" %* -) \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/App_Start/WebApiConfig.cs b/src/NSwag.Integration.WebAPI/App_Start/WebApiConfig.cs deleted file mode 100644 index e5dde16afa..0000000000 --- a/src/NSwag.Integration.WebAPI/App_Start/WebApiConfig.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System.Linq; -using System.Web.Http; -using NSwag.AspNet.WebApi; - -namespace NSwag.Integration.WebAPI -{ - public static class WebApiConfig - { - public static void Register(HttpConfiguration config) - { - var xmlFormatter = config.Formatters - .Where(f => f.SupportedMediaTypes.Any(m => m.MediaType == "application/xml")) - .ToList().First(); - - config.Formatters.Remove(xmlFormatter); - config.Formatters.Insert(0, xmlFormatter); - config.Formatters.XmlFormatter.UseXmlSerializer = true; - - config.MapHttpAttributeRoutes(); - config.Routes.MapHttpRoute( - name: "DefaultApi", - routeTemplate: "api/{controller}/{action}/{id}", - defaults: new { id = RouteParameter.Optional } - ); - - GlobalConfiguration.Configuration.Filters.Add(new JsonExceptionFilterAttribute(false)); - } - } -} diff --git a/src/NSwag.Integration.WebAPI/ApplicationInsights.config b/src/NSwag.Integration.WebAPI/ApplicationInsights.config deleted file mode 100644 index ec406213f6..0000000000 --- a/src/NSwag.Integration.WebAPI/ApplicationInsights.config +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Controllers/GeoController.cs b/src/NSwag.Integration.WebAPI/Controllers/GeoController.cs deleted file mode 100644 index 6cacb47e66..0000000000 --- a/src/NSwag.Integration.WebAPI/Controllers/GeoController.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; -using System.Web; -using System.Web.Http; -using Newtonsoft.Json; -using NSwag.Annotations; -using NSwag.Integration.WebAPI.Models; -using NSwag.Generation.WebApi; - -namespace NSwag.Integration.WebAPI.Controllers -{ - public class FilterOptions - { - [JsonProperty("currentStates")] - public string[] CurrentStates { get; set; } - } - - public class GeoController : ApiController - { - public void FromBodyTest([FromBody] GeoPoint location) - { - - } - - public void FromUriTest([FromUri] GeoPoint location) - { - - } - - [HttpPost] - public void AddPolygon(GeoPoint[] points) - { - - } - - public void Filter([FromUri] FilterOptions filter) - { - - } - - [HttpPost] - public string[] Reverse([FromUri] string[] values) - { - return values.Reverse().ToArray(); - } - - [ResponseType("204", typeof(void))] - public object Refresh() - { - throw new NotSupportedException(); - } - - public bool UploadFile(HttpPostedFileBase file) - { - return file.InputStream.ReadByte() == 1 && file.InputStream.ReadByte() == 2; - } - - public void UploadFiles(IEnumerable files) - { - - } - - [HttpPost] - [ResponseType("204", typeof(void))] - [ResponseType("450", typeof(Exception), Description = "A custom error occured.")] - public void SaveItems(GenericRequest request) - { - throw new ArgumentException("Test"); - } - - public HttpResponseMessage GetUploadedFile(int id, bool @override = false) - { - return new HttpResponseMessage(HttpStatusCode.OK) - { - Content = new ByteArrayContent(new byte[] { 1, 2, 3 }) - }; - } - - [HttpPost] - public double? PostDouble([FromUri]double? value = null) - { - // This allows us to test whether the client correctly converted the parameter to a string before adding it to the uri. - if (!value.HasValue) - { - throw new ArgumentNullException(nameof(value)); - } - - return value; - } - - #region Swagger generator - - private static readonly Lazy _swagger = new Lazy(() => - { - var settings = new WebApiOpenApiDocumentGeneratorSettings - { - DefaultUrlTemplate = "api/{controller}/{action}/{id}" - }; - - var generator = new WebApiOpenApiDocumentGenerator(settings); - var document = Task.Run(async () => await generator.GenerateForControllerAsync()) - .GetAwaiter().GetResult(); - - return document.ToJson(); - }); - - [SwaggerIgnore] - [HttpGet, Route("api/Geo/Swagger")] - public HttpResponseMessage Swagger() - { - var response = new HttpResponseMessage(); - response.StatusCode = HttpStatusCode.OK; - response.Content = new StringContent(_swagger.Value, Encoding.UTF8, "application/json"); - return response; - } - - #endregion - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Controllers/PersonsController.cs b/src/NSwag.Integration.WebAPI/Controllers/PersonsController.cs deleted file mode 100644 index a4b31f92b9..0000000000 --- a/src/NSwag.Integration.WebAPI/Controllers/PersonsController.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Threading.Tasks; -using System.Web.Http; -using System.Web.Http.Results; -using System.Xml; -using NSwag.Integration.WebAPI.Models; -using NSwag.Annotations; -using NSwag.Integration.WebAPI.Models.Exceptions; - -namespace NSwag.Integration.WebAPI.Controllers -{ - [RoutePrefix("api/Persons")] - public class PersonsController : ApiController - { - [Route("")] - public IEnumerable GetAll() - { - return new List - { - new Person(), - new Teacher { Course = "SE" } - }; - } - - [Route("find/{gender}")] - public IEnumerable Find(Gender gender) - { - return new List - { - new Person(), - new Teacher { Course = "SE" } - }; - } - - [Route("find2")] - public IEnumerable FindOptional(Gender? gender) - { - return new List - { - new Person(), - new Teacher { Course = "SE" } - }; - } - - [Route("{id}")] - [SwaggerDefaultResponse] - [ResponseType("500", typeof(PersonNotFoundException))] - public Person Get(Guid id) - { - return new Teacher(); - } - - [HttpPost] - [Route("transform")] - public Person Transform([FromBody]Person person) - { - person.FirstName = person.FirstName.ToUpperInvariant(); - return person; - } - - [Route("Throw")] - [ResponseType(typeof(Person))] - [ResponseType("500", typeof(PersonNotFoundException))] - public Person Throw(Guid id) - { - throw new PersonNotFoundException(id); - } - - /// Gets the name of a person. - /// The person ID. - /// The person's name. - [Route("{id}/Name")] - [ResponseType(typeof(string))] - [ResponseType("500", typeof(PersonNotFoundException))] - public string GetName(Guid id) - { - return "Foo Bar: " + id; - } - - [HttpPost, Route("")] - public void Add(Person person) - { - - } - - [HttpPost, Route("AddXml")] - public JsonResult AddXml([FromBody]XmlDocument person) - { - return Json(person.OuterXml); - } - - [HttpDelete, Route("{id}")] - public void Delete(Guid id) - { - - } - - [HttpPost, Route("upload")] - public async Task Upload([FromBody] Stream data) - { - // TODO: Implement stream handler: https://github.com/RicoSuter/NJsonSchema/issues/445 - return await this.Request.Content.ReadAsByteArrayAsync(); - //using (var ms = new MemoryStream()) - //{ - // data.CopyTo(ms); - // return ms.ToArray(); - //} - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Controllers/SwaggerController.cs b/src/NSwag.Integration.WebAPI/Controllers/SwaggerController.cs deleted file mode 100644 index c8e878cb55..0000000000 --- a/src/NSwag.Integration.WebAPI/Controllers/SwaggerController.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Net; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; -using System.Web.Http; -using NSwag.Annotations; -using NSwag.Generation.WebApi; - -namespace NSwag.Integration.WebAPI.Controllers -{ - public class SwaggerController : ApiController - { - private static readonly Lazy _swagger = new Lazy(() => - { - var controllers = new[] { typeof(PersonsController) }; - var settings = new WebApiOpenApiDocumentGeneratorSettings - { - DefaultUrlTemplate = "api/{controller}/{action}/{id}" - }; - - var generator = new WebApiOpenApiDocumentGenerator(settings); - var document = Task.Run(async () => await generator.GenerateForControllersAsync(controllers)) - .GetAwaiter().GetResult(); - - return document.ToJson(); - }); - - [SwaggerIgnore] - [HttpGet, Route("swaggerdoc")] - public HttpResponseMessage Swagger() - { - var response = new HttpResponseMessage(); - response.StatusCode = HttpStatusCode.OK; - response.Content = new StringContent(_swagger.Value, Encoding.UTF8, "application/json"); - return response; - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Global.asax b/src/NSwag.Integration.WebAPI/Global.asax deleted file mode 100644 index 12b752f8da..0000000000 --- a/src/NSwag.Integration.WebAPI/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="NSwag.Integration.WebAPI.WebApiApplication" Language="C#" %> diff --git a/src/NSwag.Integration.WebAPI/Global.asax.cs b/src/NSwag.Integration.WebAPI/Global.asax.cs deleted file mode 100644 index 769548e008..0000000000 --- a/src/NSwag.Integration.WebAPI/Global.asax.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Web.Http; -using System.Web.Routing; -using NSwag.AspNet.Owin; - -namespace NSwag.Integration.WebAPI -{ - public class WebApiApplication : System.Web.HttpApplication - { - protected void Application_Start() - { - RouteTable.Routes.MapOwinPath("swagger", app => - { - app.UseSwaggerUi3(typeof(WebApiApplication).Assembly, s => - { - s.GeneratorSettings.DefaultUrlTemplate = "api/{controller}/{action}/{id}"; - s.MiddlewareBasePath = "/swagger"; - }); - }); - - - GlobalConfiguration.Configure(WebApiConfig.Register); - GlobalConfiguration.Configuration.EnsureInitialized(); - } - } -} diff --git a/src/NSwag.Integration.WebAPI/Models/Address.cs b/src/NSwag.Integration.WebAPI/Models/Address.cs deleted file mode 100644 index bd32eb69a6..0000000000 --- a/src/NSwag.Integration.WebAPI/Models/Address.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace NSwag.Integration.WebAPI.Models -{ - public class Address - { - public bool IsPrimary { get; set; } - - public string City { get; set; } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Models/Exceptions/PersonNotFoundException.cs b/src/NSwag.Integration.WebAPI/Models/Exceptions/PersonNotFoundException.cs deleted file mode 100644 index ba3530c04a..0000000000 --- a/src/NSwag.Integration.WebAPI/Models/Exceptions/PersonNotFoundException.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using Newtonsoft.Json; - -namespace NSwag.Integration.WebAPI.Models.Exceptions -{ - public class PersonNotFoundException : Exception - { - [JsonProperty("id")] - public Guid Id { get; private set; } - - public PersonNotFoundException(Guid id) - { - Id = id; - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Models/Gender.cs b/src/NSwag.Integration.WebAPI/Models/Gender.cs deleted file mode 100644 index e14fab17db..0000000000 --- a/src/NSwag.Integration.WebAPI/Models/Gender.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; - -namespace NSwag.Integration.WebAPI.Models -{ - [JsonConverter(typeof(StringEnumConverter))] - public enum Gender - { - Male, - Female - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Models/GenericRequest.cs b/src/NSwag.Integration.WebAPI/Models/GenericRequest.cs deleted file mode 100644 index 59d797b858..0000000000 --- a/src/NSwag.Integration.WebAPI/Models/GenericRequest.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace NSwag.Integration.WebAPI.Models -{ - public class GenericRequest - { - public TItem1 Item1 { get; set; } - - public TItem2 Item2 { get; set; } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Models/GeoPoint.cs b/src/NSwag.Integration.WebAPI/Models/GeoPoint.cs deleted file mode 100644 index e64b619fac..0000000000 --- a/src/NSwag.Integration.WebAPI/Models/GeoPoint.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace NSwag.Integration.WebAPI.Models -{ - public class GeoPoint - { - public double Latitude { get; set; } - - public double Longitude { get; set; } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Models/Person.cs b/src/NSwag.Integration.WebAPI/Models/Person.cs deleted file mode 100644 index 4ba59c3047..0000000000 --- a/src/NSwag.Integration.WebAPI/Models/Person.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using NJsonSchema.Converters; - -namespace NSwag.Integration.WebAPI.Models -{ - [JsonConverter(typeof(JsonInheritanceConverter), "discriminator")] - [KnownType(typeof(Teacher))] - public class Person - { - public Guid Id { get; set; } - - /// Gets or sets the first name. - [Required] - [MinLength(2)] - public string FirstName { get; set; } = "Rico"; - - /// Gets or sets the last name. - [Required] - public string LastName { get; set; } = "Suter"; - - public Gender Gender { get; set; } - - public DateTime DateOfBirth { get; set; } - - public decimal Weight { get; set; } - - public double Height { get; set; } - - [Range(5, 99)] - public int Age { get; set; } - - public TimeSpan AverageSleepTime { get; set; } - - [Required] - public Address Address { get; set; } = new Address(); - - [Required] - public Person[] Children { get; set; } = new Person[] { }; - - public Dictionary Skills { get; set; } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Models/SkillLevel.cs b/src/NSwag.Integration.WebAPI/Models/SkillLevel.cs deleted file mode 100644 index b130fcc1b2..0000000000 --- a/src/NSwag.Integration.WebAPI/Models/SkillLevel.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace NSwag.Integration.WebAPI.Models -{ - - public enum SkillLevel - { - Low, - - Medium, - - Height - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Models/Teacher.cs b/src/NSwag.Integration.WebAPI/Models/Teacher.cs deleted file mode 100644 index 202479cc7f..0000000000 --- a/src/NSwag.Integration.WebAPI/Models/Teacher.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.ComponentModel; - -namespace NSwag.Integration.WebAPI.Models -{ - public class Teacher : Person - { - public string Course { get; set; } - - [DefaultValue(SkillLevel.Medium)] - public SkillLevel SkillLevel { get; set; } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/NSwag.Integration.WebAPI.csproj b/src/NSwag.Integration.WebAPI/NSwag.Integration.WebAPI.csproj deleted file mode 100644 index 6365d73cd2..0000000000 --- a/src/NSwag.Integration.WebAPI/NSwag.Integration.WebAPI.csproj +++ /dev/null @@ -1,208 +0,0 @@ - - - - - Debug - AnyCPU - - - 2.0 - {6DF73809-53CA-4A82-AAE6-3C2C62C2D8E8} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - NSwag.Integration.WebAPI - NSwag.Integration.WebAPI - v4.6.1 - win - true - - - - - - - - - - 6 - - false - $(NoWarn),618,1591 - - - true - full - false - bin\ - TRACE;DEBUG;AspNetOwin - prompt - 4 - bin\NSwag.Integration.WebAPI.XML - - - pdbonly - true - bin\ - TRACE;AspNetOwin - prompt - 4 - bin\NSwag.Integration.WebAPI.XML - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - - - - - - - - - - - - - Global.asax - - - - - - - - PreserveNewest - - - - - - - - - - - - - - - Web.config - - - Web.config - - - - - {ca084154-e758-4a44-938d-7806af2dd886} - NSwag.Annotations - - - {69A692EB-C277-46AB-BA55-B33E7E6E129C} - NSwag.AspNet.Owin - - - {e5ac8f27-f9e2-4e98-ac98-6f9361132a2e} - NSwag.AspNet.WebApi - - - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4} - NSwag.CodeGeneration - - - {2E6174AA-FC75-4821-9E86-51B30568BEC0} - NSwag.Core - - - {8A547CB0-930F-466D-92EB-E780FF14C0A6} - NSwag.Generation.WebApi - - - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574} - NSwag.Generation - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - true - bin\ - TRACE;DEBUG;AspNetOwin - bin\NSwag.Integration.WebAPI.XML - full - x64 - prompt - MinimumRecommendedRules.ruleset - - - bin\ - TRACE;AspNetOwin - bin\NSwag.Integration.WebAPI.XML - true - pdbonly - x64 - prompt - MinimumRecommendedRules.ruleset - - - - - - - - - True - True - 16489 - / - http://localhost:13452 - False - False - - - False - - - - - \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Properties/AssemblyInfo.cs b/src/NSwag.Integration.WebAPI/Properties/AssemblyInfo.cs deleted file mode 100644 index d442ebf7b5..0000000000 --- a/src/NSwag.Integration.WebAPI/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NSwag.Integration.WebAPI")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NSwag.Integration.WebAPI")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6df73809-53ca-4a82-aae6-3c2c62c2d8e8")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/NSwag.Integration.WebAPI/SwaggerDocumentTemplate.json b/src/NSwag.Integration.WebAPI/SwaggerDocumentTemplate.json deleted file mode 100644 index f6bf01b165..0000000000 --- a/src/NSwag.Integration.WebAPI/SwaggerDocumentTemplate.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "securityDefinitions": { - "api_key": { - "type": "apiKey", - "name": "api_key", - "in": "header" - }, - "petstore_auth": { - "type": "oauth2", - "authorizationUrl": "http://swagger.io/api/oauth/dialog", - "flow": "implicit", - "scopes": { - "write:pets": "modify pets in your account", - "read:pets": "read your pets" - } - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Swagger_Angular.nswag b/src/NSwag.Integration.WebAPI/Swagger_Angular.nswag deleted file mode 100644 index 8b88a6b0bf..0000000000 --- a/src/NSwag.Integration.WebAPI/Swagger_Angular.nswag +++ /dev/null @@ -1,116 +0,0 @@ -{ - "runtime": "WinX64", - "defaultVariables": null, - "documentGenerator": { - "webApiToOpenApi": { - "controllerNames": [ - "NSwag.Integration.WebAPI.Controllers.GeoController", - "NSwag.Integration.WebAPI.Controllers.PersonsController" - ], - "isAspNetCore": false, - "resolveJsonOptions": false, - "defaultUrlTemplate": "api/{controller}/{action}/{id}", - "addMissingPathParameters": false, - "includedVersions": null, - "defaultPropertyNameHandling": "Default", - "defaultReferenceTypeNullHandling": "Null", - "defaultResponseReferenceTypeNullHandling": "NotNull", - "defaultEnumHandling": "Integer", - "flattenInheritanceHierarchy": false, - "generateKnownTypes": true, - "generateEnumMappingDescription": false, - "generateXmlObjects": false, - "generateAbstractProperties": false, - "generateAbstractSchemas": true, - "ignoreObsoleteProperties": false, - "allowReferencesWithProperties": false, - "excludedTypeNames": [], - "serviceHost": "localhost:13452", - "serviceBasePath": null, - "serviceSchemes": [ - "http" - ], - "infoTitle": "Web API Swagger specification", - "infoDescription": null, - "infoVersion": "1.0.0", - "documentTemplate": null, - "documentProcessorTypes": [], - "operationProcessorTypes": [], - "typeNameGeneratorType": null, - "schemaNameGeneratorType": null, - "contractResolverType": null, - "serializerSettingsType": null, - "useDocumentProvider": true, - "documentName": "v1", - "aspNetCoreEnvironment": null, - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": true, - "output": null, - "outputType": "Swagger2", - "assemblyPaths": [ - "bin/NSwag.Integration.WebAPI.dll" - ], - "assemblyConfig": "Web.config", - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": { - "openApiToTypeScriptClient": { - "className": "{controller}Client", - "moduleName": "", - "namespace": "", - "typeScriptVersion": 2.0, - "template": "Angular", - "promiseType": "Promise", - "httpClass": "HttpClient", - "useSingletonProvider": false, - "injectionTokenType": "OpaqueToken", - "rxJsVersion": 6.0, - "dateTimeType": "Date", - "nullValue": "Undefined", - "generateClientClasses": true, - "generateClientInterfaces": false, - "generateOptionalParameters": true, - "exportTypes": true, - "wrapDtoExceptions": false, - "exceptionClass": "SwaggerException", - "clientBaseClass": "MyBaseClass", - "wrapResponses": false, - "wrapResponseMethods": [], - "generateResponseClasses": true, - "responseClass": "SwaggerResponse", - "protectedMethods": [], - "configurationClass": null, - "useTransformOptionsMethod": true, - "useTransformResultMethod": true, - "generateDtoTypes": true, - "operationGenerationMode": "MultipleClientsFromOperationId", - "markOptionalProperties": false, - "generateCloneMethod": false, - "typeStyle": "Class", - "classTypes": [], - "extendedClasses": [], - "extensionCode": "../NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAngular.extensions.ts", - "generateDefaultValues": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": true, - "generateConstructorInterface": true, - "convertConstructorInterfaceData": false, - "importRequiredTypes": true, - "useGetBaseUrlMethod": false, - "baseUrlTokenName": "API_BASE_URL", - "queryNullValue": "", - "inlineNamedDictionaries": false, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAngular.ts" - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Swagger_AngularJS.nswag b/src/NSwag.Integration.WebAPI/Swagger_AngularJS.nswag deleted file mode 100644 index 61e10d1208..0000000000 --- a/src/NSwag.Integration.WebAPI/Swagger_AngularJS.nswag +++ /dev/null @@ -1,116 +0,0 @@ -{ - "runtime": "WinX64", - "defaultVariables": null, - "documentGenerator": { - "webApiToOpenApi": { - "controllerNames": [ - "NSwag.Integration.WebAPI.Controllers.GeoController", - "NSwag.Integration.WebAPI.Controllers.PersonsController" - ], - "isAspNetCore": false, - "resolveJsonOptions": false, - "defaultUrlTemplate": "api/{controller}/{action}/{id}", - "addMissingPathParameters": false, - "includedVersions": null, - "defaultPropertyNameHandling": "Default", - "defaultReferenceTypeNullHandling": "Null", - "defaultResponseReferenceTypeNullHandling": "NotNull", - "defaultEnumHandling": "Integer", - "flattenInheritanceHierarchy": false, - "generateKnownTypes": true, - "generateEnumMappingDescription": false, - "generateXmlObjects": false, - "generateAbstractProperties": false, - "generateAbstractSchemas": true, - "ignoreObsoleteProperties": false, - "allowReferencesWithProperties": false, - "excludedTypeNames": [], - "serviceHost": "localhost:13452", - "serviceBasePath": null, - "serviceSchemes": [ - "http" - ], - "infoTitle": "Web API Swagger specification", - "infoDescription": null, - "infoVersion": "1.0.0", - "documentTemplate": null, - "documentProcessorTypes": [], - "operationProcessorTypes": [], - "typeNameGeneratorType": null, - "schemaNameGeneratorType": null, - "contractResolverType": null, - "serializerSettingsType": null, - "useDocumentProvider": true, - "documentName": "v1", - "aspNetCoreEnvironment": null, - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": true, - "output": null, - "outputType": "Swagger2", - "assemblyPaths": [ - "bin/NSwag.Integration.WebAPI.dll" - ], - "assemblyConfig": "Web.config", - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": { - "openApiToTypeScriptClient": { - "className": "{controller}Client", - "moduleName": "", - "namespace": "", - "typeScriptVersion": 2.0, - "template": "AngularJS", - "promiseType": "Promise", - "httpClass": "HttpClient", - "useSingletonProvider": false, - "injectionTokenType": "OpaqueToken", - "rxJsVersion": 6.0, - "dateTimeType": "Date", - "nullValue": "Undefined", - "generateClientClasses": true, - "generateClientInterfaces": false, - "generateOptionalParameters": false, - "exportTypes": true, - "wrapDtoExceptions": false, - "exceptionClass": "SwaggerException", - "clientBaseClass": null, - "wrapResponses": false, - "wrapResponseMethods": [], - "generateResponseClasses": true, - "responseClass": "SwaggerResponse", - "protectedMethods": [], - "configurationClass": null, - "useTransformOptionsMethod": false, - "useTransformResultMethod": false, - "generateDtoTypes": true, - "operationGenerationMode": "MultipleClientsFromOperationId", - "markOptionalProperties": false, - "generateCloneMethod": false, - "typeStyle": "Class", - "classTypes": [], - "extendedClasses": [], - "extensionCode": null, - "generateDefaultValues": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateConstructorInterface": true, - "convertConstructorInterfaceData": false, - "importRequiredTypes": true, - "useGetBaseUrlMethod": false, - "baseUrlTokenName": "API_BASE_URL", - "queryNullValue": "", - "inlineNamedDictionaries": false, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAngularJS.ts" - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Swagger_Aurelia.nswag b/src/NSwag.Integration.WebAPI/Swagger_Aurelia.nswag deleted file mode 100644 index d79b14f826..0000000000 --- a/src/NSwag.Integration.WebAPI/Swagger_Aurelia.nswag +++ /dev/null @@ -1,116 +0,0 @@ -{ - "runtime": "WinX64", - "defaultVariables": null, - "documentGenerator": { - "webApiToOpenApi": { - "controllerNames": [ - "NSwag.Integration.WebAPI.Controllers.GeoController", - "NSwag.Integration.WebAPI.Controllers.PersonsController" - ], - "isAspNetCore": false, - "resolveJsonOptions": false, - "defaultUrlTemplate": "api/{controller}/{action}/{id}", - "addMissingPathParameters": false, - "includedVersions": null, - "defaultPropertyNameHandling": "Default", - "defaultReferenceTypeNullHandling": "Null", - "defaultResponseReferenceTypeNullHandling": "NotNull", - "defaultEnumHandling": "Integer", - "flattenInheritanceHierarchy": false, - "generateKnownTypes": true, - "generateEnumMappingDescription": false, - "generateXmlObjects": false, - "generateAbstractProperties": false, - "generateAbstractSchemas": true, - "ignoreObsoleteProperties": false, - "allowReferencesWithProperties": false, - "excludedTypeNames": [], - "serviceHost": "localhost:13452", - "serviceBasePath": null, - "serviceSchemes": [ - "http" - ], - "infoTitle": "Web API Swagger specification", - "infoDescription": null, - "infoVersion": "1.0.0", - "documentTemplate": null, - "documentProcessorTypes": [], - "operationProcessorTypes": [], - "typeNameGeneratorType": null, - "schemaNameGeneratorType": null, - "contractResolverType": null, - "serializerSettingsType": null, - "useDocumentProvider": true, - "documentName": "v1", - "aspNetCoreEnvironment": null, - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": true, - "output": null, - "outputType": "Swagger2", - "assemblyPaths": [ - "bin/NSwag.Integration.WebAPI.dll" - ], - "assemblyConfig": "Web.config", - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": { - "openApiToTypeScriptClient": { - "className": "{controller}Client", - "moduleName": "", - "namespace": "", - "typeScriptVersion": 2.0, - "template": "Aurelia", - "promiseType": "Promise", - "httpClass": "HttpClient", - "useSingletonProvider": false, - "injectionTokenType": "OpaqueToken", - "rxJsVersion": 6.0, - "dateTimeType": "Date", - "nullValue": "Undefined", - "generateClientClasses": true, - "generateClientInterfaces": false, - "generateOptionalParameters": false, - "exportTypes": true, - "wrapDtoExceptions": false, - "exceptionClass": "SwaggerException", - "clientBaseClass": null, - "wrapResponses": false, - "wrapResponseMethods": [], - "generateResponseClasses": true, - "responseClass": "SwaggerResponse", - "protectedMethods": [], - "configurationClass": null, - "useTransformOptionsMethod": false, - "useTransformResultMethod": false, - "generateDtoTypes": true, - "operationGenerationMode": "MultipleClientsFromOperationId", - "markOptionalProperties": false, - "generateCloneMethod": false, - "typeStyle": "Class", - "classTypes": [], - "extendedClasses": [], - "extensionCode": null, - "generateDefaultValues": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateConstructorInterface": true, - "convertConstructorInterfaceData": false, - "importRequiredTypes": true, - "useGetBaseUrlMethod": false, - "baseUrlTokenName": "API_BASE_URL", - "queryNullValue": "", - "inlineNamedDictionaries": false, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAurelia.ts" - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Swagger_ClientConsole.nswag b/src/NSwag.Integration.WebAPI/Swagger_ClientConsole.nswag deleted file mode 100644 index 9a234d4fcb..0000000000 --- a/src/NSwag.Integration.WebAPI/Swagger_ClientConsole.nswag +++ /dev/null @@ -1,197 +0,0 @@ -{ - "runtime": "WinX64", - "defaultVariables": null, - "documentGenerator": { - "webApiToOpenApi": { - "controllerNames": [ - "NSwag.Integration.WebAPI.Controllers.GeoController", - "NSwag.Integration.WebAPI.Controllers.PersonsController" - ], - "isAspNetCore": false, - "resolveJsonOptions": false, - "defaultUrlTemplate": "api/{controller}/{action}/{id}", - "addMissingPathParameters": false, - "includedVersions": null, - "defaultPropertyNameHandling": "Default", - "defaultReferenceTypeNullHandling": "Null", - "defaultResponseReferenceTypeNullHandling": "NotNull", - "defaultEnumHandling": "Integer", - "flattenInheritanceHierarchy": false, - "generateKnownTypes": true, - "generateEnumMappingDescription": false, - "generateXmlObjects": false, - "generateAbstractProperties": false, - "generateAbstractSchemas": true, - "ignoreObsoleteProperties": false, - "allowReferencesWithProperties": false, - "excludedTypeNames": [], - "serviceHost": "localhost:13452", - "serviceBasePath": null, - "serviceSchemes": [ - "http" - ], - "infoTitle": "Web API Swagger specification", - "infoDescription": null, - "infoVersion": "1.0.0", - "documentTemplate": "SwaggerDocumentTemplate.json", - "documentProcessorTypes": [], - "operationProcessorTypes": [], - "typeNameGeneratorType": null, - "schemaNameGeneratorType": null, - "contractResolverType": null, - "serializerSettingsType": null, - "useDocumentProvider": true, - "documentName": "v1", - "aspNetCoreEnvironment": null, - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": true, - "output": null, - "outputType": "Swagger2", - "assemblyPaths": [ - "bin/NSwag.Integration.WebAPI.dll" - ], - "assemblyConfig": "Web.config", - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": { - "openApiToCSharpClient": { - "clientBaseClass": null, - "configurationClass": null, - "generateClientClasses": true, - "generateClientInterfaces": false, - "injectHttpClient": false, - "disposeHttpClient": true, - "protectedMethods": [], - "generateExceptionClasses": true, - "exceptionClass": "SwaggerException", - "wrapDtoExceptions": true, - "useHttpClientCreationMethod": false, - "httpClientType": "System.Net.Http.HttpClient", - "useHttpRequestMessageCreationMethod": false, - "useBaseUrl": false, - "generateBaseUrlProperty": true, - "generateSyncMethods": false, - "exposeJsonSerializerSettings": false, - "clientClassAccessModifier": "public", - "typeAccessModifier": "public", - "generateContractsOutput": true, - "contractsNamespace": "NSwag.Integration.Console.Contracts", - "contractsOutputFilePath": "../NSwag.Integration.Console/ServiceClientsContracts.cs", - "parameterDateTimeFormat": "s", - "parameterDateFormat": "yyyy-MM-dd", - "generateUpdateJsonSerializerSettingsMethod": true, - "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": "NSwag.Integration.Console", - "requiredPropertiesMustBeDefined": true, - "dateType": "System.DateTime", - "jsonConverters": [ - "Newtonsoft.Json.Converters.StringEnumConverter" - ], - "dateTimeType": "System.DateTime", - "timeType": "System.TimeSpan", - "timeSpanType": "System.TimeSpan", - "arrayType": "System.Collections.ObjectModel.ObservableCollection", - "arrayInstanceType": "System.Collections.ObjectModel.ObservableCollection", - "dictionaryType": "System.Collections.Generic.Dictionary", - "dictionaryInstanceType": "System.Collections.Generic.Dictionary", - "arrayBaseType": "System.Collections.ObjectModel.Collection", - "dictionaryBaseType": "System.Collections.Generic.Dictionary", - "classStyle": "Poco", - "generateDefaultValues": true, - "generateDataAnnotations": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateImmutableArrayProperties": false, - "generateImmutableDictionaryProperties": false, - "jsonSerializerSettingsTransformationMethod": null, - "inlineNamedDictionaries": false, - "inlineNamedTuples": true, - "generateDtoTypes": true, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../NSwag.Integration.Console/ServiceClients.cs" - }, - "openApiToCSharpController": { - "controllerBaseClass": null, - "controllerStyle": "Partial", - "controllerTarget": "AspNet", - "useCancellationToken": false, - "useActionResultType": false, - "generateModelValidationAttributes": false, - "routeNamingStrategy": "None", - "className": "{controller}", - "operationGenerationMode": "MultipleClientsFromOperationId", - "additionalNamespaceUsages": [ - "System.Web.Http" - ], - "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.DateTime", - "jsonConverters": null, - "dateTimeType": "System.DateTime", - "timeType": "System.TimeSpan", - "timeSpanType": "System.TimeSpan", - "arrayType": "System.Collections.Generic.List", - "arrayInstanceType": "System.Collections.Generic.List", - "dictionaryType": "System.Collections.Generic.Dictionary", - "dictionaryInstanceType": "System.Collections.Generic.Dictionary", - "arrayBaseType": "System.Collections.ObjectModel.Collection", - "dictionaryBaseType": "System.Collections.Generic.Dictionary", - "classStyle": "Poco", - "generateDefaultValues": true, - "generateDataAnnotations": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateImmutableArrayProperties": false, - "generateImmutableDictionaryProperties": false, - "jsonSerializerSettingsTransformationMethod": null, - "inlineNamedDictionaries": false, - "inlineNamedTuples": true, - "generateDtoTypes": true, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../NSwag.Integration.Console/Controllers.cs" - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Swagger_ClientPCL.nswag b/src/NSwag.Integration.WebAPI/Swagger_ClientPCL.nswag deleted file mode 100644 index 7f37af6588..0000000000 --- a/src/NSwag.Integration.WebAPI/Swagger_ClientPCL.nswag +++ /dev/null @@ -1,139 +0,0 @@ -{ - "runtime": "WinX64", - "defaultVariables": null, - "documentGenerator": { - "webApiToOpenApi": { - "controllerNames": [ - "NSwag.Integration.WebAPI.Controllers.GeoController", - "NSwag.Integration.WebAPI.Controllers.PersonsController" - ], - "isAspNetCore": false, - "resolveJsonOptions": false, - "defaultUrlTemplate": "api/{controller}/{action}/{id}", - "addMissingPathParameters": false, - "includedVersions": null, - "defaultPropertyNameHandling": "Default", - "defaultReferenceTypeNullHandling": "Null", - "defaultResponseReferenceTypeNullHandling": "NotNull", - "defaultEnumHandling": "Integer", - "flattenInheritanceHierarchy": false, - "generateKnownTypes": true, - "generateEnumMappingDescription": false, - "generateXmlObjects": false, - "generateAbstractProperties": false, - "generateAbstractSchemas": true, - "ignoreObsoleteProperties": false, - "allowReferencesWithProperties": false, - "excludedTypeNames": [], - "serviceHost": "localhost:13452", - "serviceBasePath": null, - "serviceSchemes": [ - "http" - ], - "infoTitle": "Web API Swagger specification", - "infoDescription": null, - "infoVersion": "1.0.0", - "documentTemplate": "SwaggerDocumentTemplate.json", - "documentProcessorTypes": [], - "operationProcessorTypes": [], - "typeNameGeneratorType": null, - "schemaNameGeneratorType": null, - "contractResolverType": null, - "serializerSettingsType": null, - "useDocumentProvider": true, - "documentName": "v1", - "aspNetCoreEnvironment": null, - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": true, - "output": "../NSwag.Integration.ClientPCL/swagger.json", - "outputType": "Swagger2", - "assemblyPaths": [ - "bin/NSwag.Integration.WebAPI.dll" - ], - "assemblyConfig": "Web.config", - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": { - "openApiToCSharpClient": { - "clientBaseClass": "ClientBase", - "configurationClass": null, - "generateClientClasses": true, - "generateClientInterfaces": false, - "injectHttpClient": true, - "disposeHttpClient": true, - "protectedMethods": [], - "generateExceptionClasses": true, - "exceptionClass": "{controller}ClientException", - "wrapDtoExceptions": true, - "useHttpClientCreationMethod": true, - "httpClientType": "System.Net.Http.HttpClient", - "useHttpRequestMessageCreationMethod": true, - "useBaseUrl": true, - "generateBaseUrlProperty": true, - "generateSyncMethods": false, - "exposeJsonSerializerSettings": false, - "clientClassAccessModifier": "public", - "typeAccessModifier": "public", - "generateContractsOutput": true, - "contractsNamespace": "NSwag.Integration.ClientPCL.Contracts", - "contractsOutputFilePath": "../NSwag.Integration.ClientPCL/ServiceClientsContracts.cs", - "parameterDateTimeFormat": "s", - "parameterDateFormat": "yyyy-MM-dd", - "generateUpdateJsonSerializerSettingsMethod": 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": true, - "wrapResponseMethods": [], - "generateResponseClasses": true, - "responseClass": "SwaggerResponse", - "namespace": "NSwag.Integration.ClientPCL", - "requiredPropertiesMustBeDefined": true, - "dateType": "System.DateTime", - "jsonConverters": [ - "Newtonsoft.Json.Converters.StringEnumConverter" - ], - "dateTimeType": "System.DateTime", - "timeType": "System.TimeSpan", - "timeSpanType": "System.TimeSpan", - "arrayType": "System.Collections.ObjectModel.ObservableCollection", - "arrayInstanceType": "System.Collections.ObjectModel.ObservableCollection", - "dictionaryType": "System.Collections.Generic.Dictionary", - "dictionaryInstanceType": "System.Collections.Generic.Dictionary", - "arrayBaseType": "System.Collections.ObjectModel.Collection", - "dictionaryBaseType": "System.Collections.Generic.Dictionary", - "classStyle": "Poco", - "generateDefaultValues": true, - "generateDataAnnotations": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": true, - "generateImmutableArrayProperties": false, - "generateImmutableDictionaryProperties": false, - "jsonSerializerSettingsTransformationMethod": null, - "inlineNamedDictionaries": false, - "inlineNamedTuples": true, - "generateDtoTypes": true, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../NSwag.Integration.ClientPCL/ServiceClients.cs" - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Swagger_Fetch.nswag b/src/NSwag.Integration.WebAPI/Swagger_Fetch.nswag deleted file mode 100644 index 336a388d41..0000000000 --- a/src/NSwag.Integration.WebAPI/Swagger_Fetch.nswag +++ /dev/null @@ -1,118 +0,0 @@ -{ - "runtime": "WinX64", - "defaultVariables": null, - "documentGenerator": { - "webApiToOpenApi": { - "controllerNames": [ - "NSwag.Integration.WebAPI.Controllers.GeoController", - "NSwag.Integration.WebAPI.Controllers.PersonsController" - ], - "isAspNetCore": false, - "resolveJsonOptions": false, - "defaultUrlTemplate": "api/{controller}/{action}/{id}", - "addMissingPathParameters": false, - "includedVersions": null, - "defaultPropertyNameHandling": "Default", - "defaultReferenceTypeNullHandling": "Null", - "defaultResponseReferenceTypeNullHandling": "NotNull", - "defaultEnumHandling": "Integer", - "flattenInheritanceHierarchy": false, - "generateKnownTypes": true, - "generateEnumMappingDescription": false, - "generateXmlObjects": false, - "generateAbstractProperties": false, - "generateAbstractSchemas": true, - "ignoreObsoleteProperties": false, - "allowReferencesWithProperties": false, - "excludedTypeNames": [], - "serviceHost": "localhost:13452", - "serviceBasePath": null, - "serviceSchemes": [ - "http" - ], - "infoTitle": "Web API Swagger specification", - "infoDescription": null, - "infoVersion": "1.0.0", - "documentTemplate": null, - "documentProcessorTypes": [], - "operationProcessorTypes": [], - "typeNameGeneratorType": null, - "schemaNameGeneratorType": null, - "contractResolverType": null, - "serializerSettingsType": null, - "useDocumentProvider": true, - "documentName": "v1", - "aspNetCoreEnvironment": null, - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": true, - "output": null, - "outputType": "Swagger2", - "assemblyPaths": [ - "bin/NSwag.Integration.WebAPI.dll" - ], - "assemblyConfig": "Web.config", - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": { - "openApiToTypeScriptClient": { - "className": "{controller}Client", - "moduleName": "", - "namespace": "", - "typeScriptVersion": 2.0, - "template": "Fetch", - "promiseType": "Promise", - "httpClass": "HttpClient", - "useSingletonProvider": false, - "injectionTokenType": "OpaqueToken", - "rxJsVersion": 6.0, - "dateTimeType": "Date", - "nullValue": "Undefined", - "generateClientClasses": true, - "generateClientInterfaces": false, - "generateOptionalParameters": false, - "exportTypes": true, - "wrapDtoExceptions": false, - "exceptionClass": "SwaggerException", - "clientBaseClass": null, - "wrapResponses": false, - "wrapResponseMethods": [], - "generateResponseClasses": true, - "responseClass": "SwaggerResponse", - "protectedMethods": [], - "configurationClass": null, - "useTransformOptionsMethod": false, - "useTransformResultMethod": false, - "generateDtoTypes": true, - "operationGenerationMode": "MultipleClientsFromOperationId", - "markOptionalProperties": false, - "generateCloneMethod": false, - "typeStyle": "Class", - "classTypes": [], - "extendedClasses": [ - "GeoClient" - ], - "extensionCode": "../NSwag.Integration.TypeScriptWeb/scripts/serviceClientsFetch.extensions.ts", - "generateDefaultValues": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateConstructorInterface": true, - "convertConstructorInterfaceData": false, - "importRequiredTypes": true, - "useGetBaseUrlMethod": false, - "baseUrlTokenName": "API_BASE_URL", - "queryNullValue": "", - "inlineNamedDictionaries": false, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../NSwag.Integration.TypeScriptWeb/scripts/serviceClientsFetch.ts" - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Swagger_JQueryCallbacks.nswag b/src/NSwag.Integration.WebAPI/Swagger_JQueryCallbacks.nswag deleted file mode 100644 index 4248fc68b0..0000000000 --- a/src/NSwag.Integration.WebAPI/Swagger_JQueryCallbacks.nswag +++ /dev/null @@ -1,116 +0,0 @@ -{ - "runtime": "WinX64", - "defaultVariables": null, - "documentGenerator": { - "webApiToOpenApi": { - "controllerNames": [ - "NSwag.Integration.WebAPI.Controllers.GeoController", - "NSwag.Integration.WebAPI.Controllers.PersonsController" - ], - "isAspNetCore": false, - "resolveJsonOptions": false, - "defaultUrlTemplate": "api/{controller}/{action}/{id}", - "addMissingPathParameters": false, - "includedVersions": null, - "defaultPropertyNameHandling": "Default", - "defaultReferenceTypeNullHandling": "Null", - "defaultResponseReferenceTypeNullHandling": "NotNull", - "defaultEnumHandling": "Integer", - "flattenInheritanceHierarchy": false, - "generateKnownTypes": true, - "generateEnumMappingDescription": false, - "generateXmlObjects": false, - "generateAbstractProperties": false, - "generateAbstractSchemas": true, - "ignoreObsoleteProperties": false, - "allowReferencesWithProperties": false, - "excludedTypeNames": [], - "serviceHost": "localhost:13452", - "serviceBasePath": null, - "serviceSchemes": [ - "http" - ], - "infoTitle": "Web API Swagger specification", - "infoDescription": null, - "infoVersion": "1.0.0", - "documentTemplate": null, - "documentProcessorTypes": [], - "operationProcessorTypes": [], - "typeNameGeneratorType": null, - "schemaNameGeneratorType": null, - "contractResolverType": null, - "serializerSettingsType": null, - "useDocumentProvider": true, - "documentName": "v1", - "aspNetCoreEnvironment": null, - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": true, - "output": null, - "outputType": "Swagger2", - "assemblyPaths": [ - "bin/NSwag.Integration.WebAPI.dll" - ], - "assemblyConfig": "Web.config", - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": { - "openApiToTypeScriptClient": { - "className": "{controller}Client", - "moduleName": "", - "namespace": "", - "typeScriptVersion": 2.0, - "template": "JQueryCallbacks", - "promiseType": "Promise", - "httpClass": "HttpClient", - "useSingletonProvider": false, - "injectionTokenType": "OpaqueToken", - "rxJsVersion": 6.0, - "dateTimeType": "Date", - "nullValue": "Undefined", - "generateClientClasses": true, - "generateClientInterfaces": false, - "generateOptionalParameters": false, - "exportTypes": true, - "wrapDtoExceptions": false, - "exceptionClass": "SwaggerException", - "clientBaseClass": null, - "wrapResponses": false, - "wrapResponseMethods": [], - "generateResponseClasses": true, - "responseClass": "SwaggerResponse", - "protectedMethods": [], - "configurationClass": null, - "useTransformOptionsMethod": false, - "useTransformResultMethod": false, - "generateDtoTypes": true, - "operationGenerationMode": "MultipleClientsFromOperationId", - "markOptionalProperties": false, - "generateCloneMethod": false, - "typeStyle": "Class", - "classTypes": [], - "extendedClasses": [], - "extensionCode": null, - "generateDefaultValues": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateConstructorInterface": true, - "convertConstructorInterfaceData": false, - "importRequiredTypes": true, - "useGetBaseUrlMethod": false, - "baseUrlTokenName": "API_BASE_URL", - "queryNullValue": "", - "inlineNamedDictionaries": false, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryCallbacks.ts" - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Swagger_JQueryPromises.nswag b/src/NSwag.Integration.WebAPI/Swagger_JQueryPromises.nswag deleted file mode 100644 index 8f56747258..0000000000 --- a/src/NSwag.Integration.WebAPI/Swagger_JQueryPromises.nswag +++ /dev/null @@ -1,118 +0,0 @@ -{ - "runtime": "WinX64", - "defaultVariables": null, - "documentGenerator": { - "webApiToOpenApi": { - "controllerNames": [ - "NSwag.Integration.WebAPI.Controllers.GeoController", - "NSwag.Integration.WebAPI.Controllers.PersonsController" - ], - "isAspNetCore": false, - "resolveJsonOptions": false, - "defaultUrlTemplate": "api/{controller}/{action}/{id}", - "addMissingPathParameters": false, - "includedVersions": null, - "defaultPropertyNameHandling": "Default", - "defaultReferenceTypeNullHandling": "Null", - "defaultResponseReferenceTypeNullHandling": "NotNull", - "defaultEnumHandling": "Integer", - "flattenInheritanceHierarchy": false, - "generateKnownTypes": true, - "generateEnumMappingDescription": false, - "generateXmlObjects": false, - "generateAbstractProperties": false, - "generateAbstractSchemas": true, - "ignoreObsoleteProperties": false, - "allowReferencesWithProperties": false, - "excludedTypeNames": [], - "serviceHost": "localhost:13452", - "serviceBasePath": null, - "serviceSchemes": [ - "http" - ], - "infoTitle": "Web API Swagger specification", - "infoDescription": null, - "infoVersion": "1.0.0", - "documentTemplate": null, - "documentProcessorTypes": [], - "operationProcessorTypes": [], - "typeNameGeneratorType": null, - "schemaNameGeneratorType": null, - "contractResolverType": null, - "serializerSettingsType": null, - "useDocumentProvider": true, - "documentName": "v1", - "aspNetCoreEnvironment": null, - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": true, - "output": null, - "outputType": "Swagger2", - "assemblyPaths": [ - "bin/NSwag.Integration.WebAPI.dll" - ], - "assemblyConfig": "Web.config", - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": { - "openApiToTypeScriptClient": { - "className": "{controller}Client", - "moduleName": "", - "namespace": "", - "typeScriptVersion": 2.0, - "template": "JQueryPromises", - "promiseType": "Promise", - "httpClass": "HttpClient", - "useSingletonProvider": false, - "injectionTokenType": "OpaqueToken", - "rxJsVersion": 6.0, - "dateTimeType": "Date", - "nullValue": "Undefined", - "generateClientClasses": true, - "generateClientInterfaces": false, - "generateOptionalParameters": false, - "exportTypes": true, - "wrapDtoExceptions": false, - "exceptionClass": "SwaggerException", - "clientBaseClass": null, - "wrapResponses": false, - "wrapResponseMethods": [], - "generateResponseClasses": true, - "responseClass": "SwaggerResponse", - "protectedMethods": [], - "configurationClass": null, - "useTransformOptionsMethod": false, - "useTransformResultMethod": false, - "generateDtoTypes": true, - "operationGenerationMode": "MultipleClientsFromOperationId", - "markOptionalProperties": false, - "generateCloneMethod": false, - "typeStyle": "Class", - "classTypes": [], - "extendedClasses": [ - "Person" - ], - "extensionCode": "../NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryPromises.extensions.ts", - "generateDefaultValues": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateConstructorInterface": true, - "convertConstructorInterfaceData": false, - "importRequiredTypes": true, - "useGetBaseUrlMethod": false, - "baseUrlTokenName": "API_BASE_URL", - "queryNullValue": "", - "inlineNamedDictionaries": false, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryPromises.ts" - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Swagger_JQueryPromises_KO.nswag b/src/NSwag.Integration.WebAPI/Swagger_JQueryPromises_KO.nswag deleted file mode 100644 index 9a88685faa..0000000000 --- a/src/NSwag.Integration.WebAPI/Swagger_JQueryPromises_KO.nswag +++ /dev/null @@ -1,116 +0,0 @@ -{ - "runtime": "WinX64", - "defaultVariables": null, - "documentGenerator": { - "webApiToOpenApi": { - "controllerNames": [ - "NSwag.Integration.WebAPI.Controllers.GeoController", - "NSwag.Integration.WebAPI.Controllers.PersonsController" - ], - "isAspNetCore": false, - "resolveJsonOptions": false, - "defaultUrlTemplate": "api/{controller}/{action}/{id}", - "addMissingPathParameters": false, - "includedVersions": null, - "defaultPropertyNameHandling": "Default", - "defaultReferenceTypeNullHandling": "Null", - "defaultResponseReferenceTypeNullHandling": "NotNull", - "defaultEnumHandling": "Integer", - "flattenInheritanceHierarchy": false, - "generateKnownTypes": true, - "generateEnumMappingDescription": false, - "generateXmlObjects": false, - "generateAbstractProperties": false, - "generateAbstractSchemas": true, - "ignoreObsoleteProperties": false, - "allowReferencesWithProperties": false, - "excludedTypeNames": [], - "serviceHost": "localhost:13452", - "serviceBasePath": null, - "serviceSchemes": [ - "http" - ], - "infoTitle": "Web API Swagger specification", - "infoDescription": null, - "infoVersion": "1.0.0", - "documentTemplate": null, - "documentProcessorTypes": [], - "operationProcessorTypes": [], - "typeNameGeneratorType": null, - "schemaNameGeneratorType": null, - "contractResolverType": null, - "serializerSettingsType": null, - "useDocumentProvider": true, - "documentName": "v1", - "aspNetCoreEnvironment": null, - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": true, - "output": null, - "outputType": "Swagger2", - "assemblyPaths": [ - "bin/NSwag.Integration.WebAPI.dll" - ], - "assemblyConfig": "Web.config", - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": { - "openApiToTypeScriptClient": { - "className": "{controller}Client", - "moduleName": "", - "namespace": "", - "typeScriptVersion": 2.0, - "template": "JQueryPromises", - "promiseType": "Promise", - "httpClass": "HttpClient", - "useSingletonProvider": false, - "injectionTokenType": "OpaqueToken", - "rxJsVersion": 6.0, - "dateTimeType": "Date", - "nullValue": "Undefined", - "generateClientClasses": true, - "generateClientInterfaces": false, - "generateOptionalParameters": false, - "exportTypes": true, - "wrapDtoExceptions": false, - "exceptionClass": "SwaggerException", - "clientBaseClass": null, - "wrapResponses": false, - "wrapResponseMethods": [], - "generateResponseClasses": true, - "responseClass": "SwaggerResponse", - "protectedMethods": [], - "configurationClass": null, - "useTransformOptionsMethod": false, - "useTransformResultMethod": false, - "generateDtoTypes": true, - "operationGenerationMode": "MultipleClientsFromOperationId", - "markOptionalProperties": false, - "generateCloneMethod": false, - "typeStyle": "KnockoutClass", - "classTypes": [], - "extendedClasses": [], - "extensionCode": null, - "generateDefaultValues": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateConstructorInterface": true, - "convertConstructorInterfaceData": false, - "importRequiredTypes": true, - "useGetBaseUrlMethod": false, - "baseUrlTokenName": "API_BASE_URL", - "queryNullValue": "", - "inlineNamedDictionaries": false, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryPromisesKO.ts" - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Swagger_PetStore_Fetch.nswag b/src/NSwag.Integration.WebAPI/Swagger_PetStore_Fetch.nswag deleted file mode 100644 index 215ddd6763..0000000000 --- a/src/NSwag.Integration.WebAPI/Swagger_PetStore_Fetch.nswag +++ /dev/null @@ -1,145 +0,0 @@ -{ - "runtime": "WinX64", - "defaultVariables": null, - "documentGenerator": { - "fromDocument": { - "json": "", - "url": "http://petstore.swagger.io/v2/swagger.json", - "output": null - } - }, - "codeGenerators": { - "openApiToTypeScriptClient": { - "className": "{controller}Client", - "moduleName": "", - "namespace": "", - "typeScriptVersion": 2.0, - "template": "Fetch", - "promiseType": "Promise", - "httpClass": "HttpClient", - "useSingletonProvider": false, - "injectionTokenType": "OpaqueToken", - "rxJsVersion": 6.0, - "dateTimeType": "Date", - "nullValue": "Undefined", - "generateClientClasses": true, - "generateClientInterfaces": false, - "generateOptionalParameters": false, - "exportTypes": true, - "wrapDtoExceptions": false, - "clientBaseClass": null, - "wrapResponses": false, - "wrapResponseMethods": [], - "generateResponseClasses": true, - "responseClass": "SwaggerResponse", - "protectedMethods": [], - "configurationClass": null, - "useTransformOptionsMethod": false, - "useTransformResultMethod": false, - "generateDtoTypes": true, - "operationGenerationMode": "MultipleClientsFromOperationId", - "markOptionalProperties": false, - "generateCloneMethod": false, - "typeStyle": "Class", - "classTypes": [], - "extendedClasses": [], - "extensionCode": null, - "generateDefaultValues": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateConstructorInterface": true, - "convertConstructorInterfaceData": false, - "importRequiredTypes": true, - "useGetBaseUrlMethod": false, - "baseUrlTokenName": "API_BASE_URL", - "queryNullValue": "", - "inlineNamedDictionaries": false, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../NSwag.Integration.TypeScriptWeb/scripts/serviceClientsPetStoreFetch.ts" - }, - "openApiToCSharpClient": { - "clientBaseClass": null, - "configurationClass": null, - "generateClientClasses": true, - "generateClientInterfaces": true, - "injectHttpClient": false, - "disposeHttpClient": true, - "protectedMethods": [ - "PetStoreClient.AddPetAsync" - ], - "generateExceptionClasses": true, - "exceptionClass": "SwaggerException", - "wrapDtoExceptions": true, - "useHttpClientCreationMethod": false, - "httpClientType": "System.Net.Http.HttpClient", - "useHttpRequestMessageCreationMethod": false, - "useBaseUrl": true, - "generateBaseUrlProperty": true, - "generateSyncMethods": false, - "exposeJsonSerializerSettings": false, - "clientClassAccessModifier": "public", - "typeAccessModifier": "public", - "generateContractsOutput": false, - "contractsNamespace": null, - "contractsOutputFilePath": null, - "parameterDateTimeFormat": "s", - "parameterDateFormat": "yyyy-MM-dd", - "generateUpdateJsonSerializerSettingsMethod": true, - "serializeTypeInformation": false, - "queryNullValue": "", - "className": "PetStoreClient", - "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": "PetStore", - "requiredPropertiesMustBeDefined": true, - "dateType": "System.DateTime", - "jsonConverters": null, - "dateTimeType": "System.DateTime", - "timeType": "System.TimeSpan", - "timeSpanType": "System.TimeSpan", - "arrayType": "System.Collections.ObjectModel.ObservableCollection", - "arrayInstanceType": "System.Collections.ObjectModel.ObservableCollection", - "dictionaryType": "System.Collections.Generic.Dictionary", - "dictionaryInstanceType": "System.Collections.Generic.Dictionary", - "arrayBaseType": "System.Collections.ObjectModel.Collection", - "dictionaryBaseType": "System.Collections.Generic.Dictionary", - "classStyle": "Inpc", - "generateDefaultValues": true, - "generateDataAnnotations": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateImmutableArrayProperties": false, - "generateImmutableDictionaryProperties": false, - "jsonSerializerSettingsTransformationMethod": null, - "inlineNamedDictionaries": false, - "inlineNamedTuples": true, - "generateDtoTypes": true, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../NSwag.Integration.ClientPCL/PetStoreClient.cs" - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Swagger_Uber_Fetch.nswag b/src/NSwag.Integration.WebAPI/Swagger_Uber_Fetch.nswag deleted file mode 100644 index ce0f34b53f..0000000000 --- a/src/NSwag.Integration.WebAPI/Swagger_Uber_Fetch.nswag +++ /dev/null @@ -1,143 +0,0 @@ -{ - "runtime": "WinX64", - "defaultVariables": null, - "documentGenerator": { - "fromDocument": { - "json": "", - "url": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v2.0/json/uber.json", - "output": null - } - }, - "codeGenerators": { - "openApiToTypeScriptClient": { - "className": "{controller}Client", - "moduleName": "", - "namespace": "", - "typeScriptVersion": 2.0, - "template": "Fetch", - "promiseType": "Promise", - "httpClass": "HttpClient", - "useSingletonProvider": false, - "injectionTokenType": "OpaqueToken", - "rxJsVersion": 6.0, - "dateTimeType": "Date", - "nullValue": "Undefined", - "generateClientClasses": true, - "generateClientInterfaces": false, - "generateOptionalParameters": false, - "exportTypes": true, - "wrapDtoExceptions": true, - "clientBaseClass": null, - "wrapResponses": false, - "wrapResponseMethods": [], - "generateResponseClasses": true, - "responseClass": "SwaggerResponse", - "protectedMethods": [], - "configurationClass": null, - "useTransformOptionsMethod": false, - "useTransformResultMethod": false, - "generateDtoTypes": true, - "operationGenerationMode": "MultipleClientsFromOperationId", - "markOptionalProperties": false, - "generateCloneMethod": false, - "typeStyle": "Class", - "classTypes": [], - "extendedClasses": [], - "extensionCode": null, - "generateDefaultValues": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateConstructorInterface": true, - "convertConstructorInterfaceData": false, - "importRequiredTypes": true, - "useGetBaseUrlMethod": false, - "baseUrlTokenName": "API_BASE_URL", - "queryNullValue": "", - "inlineNamedDictionaries": false, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../NSwag.Integration.TypeScriptWeb/scripts/serviceClientsUberFetch.ts" - }, - "openApiToCSharpClient": { - "clientBaseClass": null, - "configurationClass": null, - "generateClientClasses": true, - "generateClientInterfaces": false, - "injectHttpClient": true, - "disposeHttpClient": true, - "protectedMethods": [], - "generateExceptionClasses": true, - "exceptionClass": "SwaggerException", - "wrapDtoExceptions": true, - "useHttpClientCreationMethod": false, - "httpClientType": "System.Net.Http.HttpClient", - "useHttpRequestMessageCreationMethod": false, - "useBaseUrl": true, - "generateBaseUrlProperty": true, - "generateSyncMethods": false, - "exposeJsonSerializerSettings": false, - "clientClassAccessModifier": "public", - "typeAccessModifier": "public", - "generateContractsOutput": false, - "contractsNamespace": null, - "contractsOutputFilePath": null, - "parameterDateTimeFormat": "s", - "parameterDateFormat": "yyyy-MM-dd", - "generateUpdateJsonSerializerSettingsMethod": true, - "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": "Uber", - "requiredPropertiesMustBeDefined": true, - "dateType": "System.DateTime", - "jsonConverters": null, - "dateTimeType": "System.DateTime", - "timeType": "System.TimeSpan", - "timeSpanType": "System.TimeSpan", - "arrayType": "System.Collections.ObjectModel.ObservableCollection", - "arrayInstanceType": "System.Collections.ObjectModel.Collection", - "dictionaryType": "System.Collections.Generic.Dictionary", - "dictionaryInstanceType": "System.Collections.Generic.Dictionary", - "arrayBaseType": "System.Collections.ObjectModel.Collection", - "dictionaryBaseType": "System.Collections.Generic.Dictionary", - "classStyle": "Inpc", - "generateDefaultValues": true, - "generateDataAnnotations": true, - "excludedTypeNames": [], - "excludedParameterNames": [], - "handleReferences": false, - "generateImmutableArrayProperties": false, - "generateImmutableDictionaryProperties": false, - "jsonSerializerSettingsTransformationMethod": null, - "inlineNamedDictionaries": false, - "inlineNamedTuples": true, - "generateDtoTypes": true, - "templateDirectory": null, - "typeNameGeneratorType": null, - "propertyNameGeneratorType": null, - "enumNameGeneratorType": null, - "serviceHost": null, - "serviceSchemes": null, - "output": "../NSwag.Integration.ClientPCL/UberClient.cs" - } - } -} \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Web.Debug.config b/src/NSwag.Integration.WebAPI/Web.Debug.config deleted file mode 100644 index 2e302f9f95..0000000000 --- a/src/NSwag.Integration.WebAPI/Web.Debug.config +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Web.Release.config b/src/NSwag.Integration.WebAPI/Web.Release.config deleted file mode 100644 index c35844462b..0000000000 --- a/src/NSwag.Integration.WebAPI/Web.Release.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/Web.config b/src/NSwag.Integration.WebAPI/Web.config deleted file mode 100644 index e654a7cc54..0000000000 --- a/src/NSwag.Integration.WebAPI/Web.config +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Integration.WebAPI/build.bat b/src/NSwag.Integration.WebAPI/build.bat deleted file mode 100644 index 2387c4a073..0000000000 --- a/src/NSwag.Integration.WebAPI/build.bat +++ /dev/null @@ -1 +0,0 @@ -dotnet run -c Release --project "../NSwag.Console" -- run \ No newline at end of file diff --git a/src/NSwag.MSBuild/NSwag.MSBuild.nuspec b/src/NSwag.MSBuild/NSwag.MSBuild.nuspec index b3a5940671..3feb31126e 100644 --- a/src/NSwag.MSBuild/NSwag.MSBuild.nuspec +++ b/src/NSwag.MSBuild/NSwag.MSBuild.nuspec @@ -22,15 +22,13 @@ - - - - - + + + + + - - diff --git a/src/NSwag.Min.sln b/src/NSwag.Min.sln deleted file mode 100644 index 524dc61eda..0000000000 --- a/src/NSwag.Min.sln +++ /dev/null @@ -1,670 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31825.309 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.CodeGeneration", "NSwag.CodeGeneration\NSwag.CodeGeneration.csproj", "{75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Annotations", "NSwag.Annotations\NSwag.Annotations.csproj", "{CA084154-E758-4A44-938D-7806AF2DD886}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Core", "NSwag.Core\NSwag.Core.csproj", "{2E6174AA-FC75-4821-9E86-51B30568BEC0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.AspNet.Owin", "NSwag.AspNet.Owin\NSwag.AspNet.Owin.csproj", "{69A692EB-C277-46AB-BA55-B33E7E6E129C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.AspNet.WebApi", "NSwag.AspNet.WebApi\NSwag.AspNet.WebApi.csproj", "{E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Generation", "NSwag.Generation\NSwag.Generation.csproj", "{5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.CodeGeneration.CSharp", "NSwag.CodeGeneration.CSharp\NSwag.CodeGeneration.CSharp.csproj", "{F0036DA5-5DD4-494C-91B0-37689E00511E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.CodeGeneration.TypeScript", "NSwag.CodeGeneration.TypeScript\NSwag.CodeGeneration.TypeScript.csproj", "{9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "03 CodeGeneration", "03 CodeGeneration", "{441A2B84-3FF3-43BE-BAD8-609A1EBDC95C}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "01 Core", "01 Core", "{1030C3AA-7549-473B-AA7E-5DFAC2F9D37A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "02 Generation", "02 Generation", "{48E8B044-3374-4F39-A180-9E01F7A10785}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Generation.WebApi", "NSwag.Generation.WebApi\NSwag.Generation.WebApi.csproj", "{8A547CB0-930F-466D-92EB-E780FF14C0A6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.AspNetCore", "NSwag.AspNetCore\NSwag.AspNetCore.csproj", "{73E71805-C3AB-400A-8258-7BF429F04EC2}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "04 ASP.NET", "04 ASP.NET", "{0AF934BD-80BE-483E-BCB7-D9B3F7B816E3}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "06 Tests", "06 Tests", "{D8CC0D1C-8DAC-49FE-AA78-C028DC124DD5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Core.Yaml", "NSwag.Core.Yaml\NSwag.Core.Yaml.csproj", "{9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Generation.AspNetCore", "NSwag.Generation.AspNetCore\NSwag.Generation.AspNetCore.csproj", "{51740C29-AF4F-40AD-BFDE-09E6F8C873D2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Core.Tests", "NSwag.Core.Tests\NSwag.Core.Tests.csproj", "{6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "09 Samples", "09 Samples", "{A0338E8D-A4A3-4380-9FF7-1D0BDC260E31}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Generation.AspNetCore.Tests", "NSwag.Generation.AspNetCore.Tests\NSwag.Generation.AspNetCore.Tests.csproj", "{55672414-CC74-4943-B878-508EC4D486AD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Generation.AspNetCore.Tests.Web", "NSwag.Generation.AspNetCore.Tests.Web\NSwag.Generation.AspNetCore.Tests.Web.csproj", "{C56AC38A-513B-40C6-AEB8-0146BB5B2888}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Sample.NETCore21", "NSwag.Sample.NETCore21\NSwag.Sample.NETCore21.csproj", "{B024633F-AA96-4551-AB18-2EF9650425AF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Core.Yaml.Tests", "NSwag.Core.Yaml.Tests\NSwag.Core.Yaml.Tests.csproj", "{9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.CodeGeneration.CSharp.Tests", "NSwag.CodeGeneration.CSharp.Tests\NSwag.CodeGeneration.CSharp.Tests.csproj", "{C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.CodeGeneration.TypeScript.Tests", "NSwag.CodeGeneration.TypeScript.Tests\NSwag.CodeGeneration.TypeScript.Tests.csproj", "{95B83E7B-1ADF-4185-AB36-3B17459B0128}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.CodeGeneration.Tests", "NSwag.CodeGeneration.Tests\NSwag.CodeGeneration.Tests.csproj", "{94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "05 Frontends", "05 Frontends", "{49A70E20-FF73-451D-BBE8-7680EDCF007B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Commands", "NSwag.Commands\NSwag.Commands.csproj", "{6C699C0A-4FD9-440E-97FC-F422A2FCA31E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.AssemblyLoader", "NSwag.AssemblyLoader\NSwag.AssemblyLoader.csproj", "{A264DD57-E7CF-42DB-94A4-D560DFC408C8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.ConsoleCore", "NSwag.ConsoleCore\NSwag.ConsoleCore.csproj", "{071DAE67-E6F1-4983-84D9-07015BB481C7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.AspNetCore.Launcher", "NSwag.AspNetCore.Launcher\NSwag.AspNetCore.Launcher.csproj", "{DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.AssemblyLoader.Tests", "NSwag.AssemblyLoader.Tests\NSwag.AssemblyLoader.Tests.csproj", "{06B5C478-0ACC-4088-97B6-891C4F35EBBC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Generation.Tests", "NSwag.Generation.Tests\NSwag.Generation.Tests.csproj", "{3A6CA187-AD6F-438C-9E5B-B2771F75AF41}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Sample.NET50", "NSwag.Sample.NET50\NSwag.Sample.NET50.csproj", "{F109D48B-A2FF-497D-8374-FEA60C5F2365}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Sample.NETCore31", "NSwag.Sample.NETCore31\NSwag.Sample.NETCore31.csproj", "{FC20849C-915D-411B-8CFB-915B7751D898}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Sample.NET60", "NSwag.Sample.NET60\NSwag.Sample.NET60.csproj", "{7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Sample.NET60Minimal", "NSwag.Sample.NET60Minimal\NSwag.Sample.NET60Minimal.csproj", "{FA78E42D-F49F-45E3-820E-331FB8E34195}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - ReleaseTypeScriptStrict|Any CPU = ReleaseTypeScriptStrict|Any CPU - ReleaseTypeScriptStrict|x64 = ReleaseTypeScriptStrict|x64 - ReleaseTypeScriptStrict|x86 = ReleaseTypeScriptStrict|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}.Debug|x64.ActiveCfg = Debug|Any CPU - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}.Debug|x64.Build.0 = Debug|Any CPU - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}.Debug|x86.ActiveCfg = Debug|Any CPU - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}.Debug|x86.Build.0 = Debug|Any CPU - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}.Release|Any CPU.Build.0 = Release|Any CPU - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}.Release|x64.ActiveCfg = Release|Any CPU - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}.Release|x64.Build.0 = Release|Any CPU - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}.Release|x86.ActiveCfg = Release|Any CPU - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.Debug|x64.ActiveCfg = Debug|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.Debug|x64.Build.0 = Debug|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.Debug|x86.ActiveCfg = Debug|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.Debug|x86.Build.0 = Debug|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.Release|Any CPU.Build.0 = Release|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.Release|x64.ActiveCfg = Release|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.Release|x64.Build.0 = Release|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.Release|x86.ActiveCfg = Release|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.Release|x86.Build.0 = Release|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {CA084154-E758-4A44-938D-7806AF2DD886}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.Debug|x64.ActiveCfg = Debug|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.Debug|x64.Build.0 = Debug|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.Debug|x86.ActiveCfg = Debug|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.Debug|x86.Build.0 = Debug|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.Release|Any CPU.Build.0 = Release|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.Release|x64.ActiveCfg = Release|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.Release|x64.Build.0 = Release|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.Release|x86.ActiveCfg = Release|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.Release|x86.Build.0 = Release|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {2E6174AA-FC75-4821-9E86-51B30568BEC0}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.Debug|x64.ActiveCfg = Debug|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.Debug|x64.Build.0 = Debug|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.Debug|x86.ActiveCfg = Debug|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.Debug|x86.Build.0 = Debug|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.Release|Any CPU.Build.0 = Release|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.Release|x64.ActiveCfg = Release|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.Release|x64.Build.0 = Release|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.Release|x86.ActiveCfg = Release|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.Release|x86.Build.0 = Release|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {69A692EB-C277-46AB-BA55-B33E7E6E129C}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.Debug|x64.ActiveCfg = Debug|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.Debug|x64.Build.0 = Debug|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.Debug|x86.ActiveCfg = Debug|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.Debug|x86.Build.0 = Debug|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.Release|Any CPU.Build.0 = Release|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.Release|x64.ActiveCfg = Release|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.Release|x64.Build.0 = Release|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.Release|x86.ActiveCfg = Release|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.Release|x86.Build.0 = Release|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.Debug|x64.ActiveCfg = Debug|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.Debug|x64.Build.0 = Debug|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.Debug|x86.ActiveCfg = Debug|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.Debug|x86.Build.0 = Debug|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.Release|Any CPU.Build.0 = Release|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.Release|x64.ActiveCfg = Release|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.Release|x64.Build.0 = Release|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.Release|x86.ActiveCfg = Release|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.Release|x86.Build.0 = Release|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.Debug|x64.ActiveCfg = Debug|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.Debug|x64.Build.0 = Debug|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.Debug|x86.ActiveCfg = Debug|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.Debug|x86.Build.0 = Debug|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.Release|Any CPU.Build.0 = Release|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.Release|x64.ActiveCfg = Release|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.Release|x64.Build.0 = Release|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.Release|x86.ActiveCfg = Release|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.Release|x86.Build.0 = Release|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {F0036DA5-5DD4-494C-91B0-37689E00511E}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.Debug|x64.ActiveCfg = Debug|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.Debug|x64.Build.0 = Debug|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.Debug|x86.ActiveCfg = Debug|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.Debug|x86.Build.0 = Debug|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.Release|Any CPU.Build.0 = Release|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.Release|x64.ActiveCfg = Release|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.Release|x64.Build.0 = Release|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.Release|x86.ActiveCfg = Release|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.Release|x86.Build.0 = Release|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.Debug|x64.ActiveCfg = Debug|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.Debug|x64.Build.0 = Debug|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.Debug|x86.ActiveCfg = Debug|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.Debug|x86.Build.0 = Debug|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.Release|Any CPU.Build.0 = Release|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.Release|x64.ActiveCfg = Release|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.Release|x64.Build.0 = Release|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.Release|x86.ActiveCfg = Release|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.Release|x86.Build.0 = Release|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {8A547CB0-930F-466D-92EB-E780FF14C0A6}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.Debug|x64.ActiveCfg = Debug|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.Debug|x64.Build.0 = Debug|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.Debug|x86.ActiveCfg = Debug|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.Debug|x86.Build.0 = Debug|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.Release|Any CPU.Build.0 = Release|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.Release|x64.ActiveCfg = Release|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.Release|x64.Build.0 = Release|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.Release|x86.ActiveCfg = Release|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.Release|x86.Build.0 = Release|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {73E71805-C3AB-400A-8258-7BF429F04EC2}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.Debug|x64.ActiveCfg = Debug|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.Debug|x64.Build.0 = Debug|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.Debug|x86.ActiveCfg = Debug|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.Debug|x86.Build.0 = Debug|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.Release|Any CPU.Build.0 = Release|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.Release|x64.ActiveCfg = Release|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.Release|x64.Build.0 = Release|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.Release|x86.ActiveCfg = Release|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.Release|x86.Build.0 = Release|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.Debug|x64.ActiveCfg = Debug|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.Debug|x64.Build.0 = Debug|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.Debug|x86.ActiveCfg = Debug|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.Debug|x86.Build.0 = Debug|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.Release|Any CPU.Build.0 = Release|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.Release|x64.ActiveCfg = Release|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.Release|x64.Build.0 = Release|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.Release|x86.ActiveCfg = Release|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.Release|x86.Build.0 = Release|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.Debug|x64.ActiveCfg = Debug|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.Debug|x64.Build.0 = Debug|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.Debug|x86.ActiveCfg = Debug|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.Debug|x86.Build.0 = Debug|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.Release|Any CPU.Build.0 = Release|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.Release|x64.ActiveCfg = Release|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.Release|x64.Build.0 = Release|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.Release|x86.ActiveCfg = Release|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.Release|x86.Build.0 = Release|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.Debug|x64.ActiveCfg = Debug|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.Debug|x64.Build.0 = Debug|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.Debug|x86.ActiveCfg = Debug|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.Debug|x86.Build.0 = Debug|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.Release|Any CPU.Build.0 = Release|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.Release|x64.ActiveCfg = Release|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.Release|x64.Build.0 = Release|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.Release|x86.ActiveCfg = Release|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.Release|x86.Build.0 = Release|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {55672414-CC74-4943-B878-508EC4D486AD}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.Debug|x64.ActiveCfg = Debug|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.Debug|x64.Build.0 = Debug|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.Debug|x86.ActiveCfg = Debug|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.Debug|x86.Build.0 = Debug|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.Release|Any CPU.Build.0 = Release|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.Release|x64.ActiveCfg = Release|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.Release|x64.Build.0 = Release|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.Release|x86.ActiveCfg = Release|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.Release|x86.Build.0 = Release|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {C56AC38A-513B-40C6-AEB8-0146BB5B2888}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.Debug|x64.ActiveCfg = Debug|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.Debug|x64.Build.0 = Debug|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.Debug|x86.ActiveCfg = Debug|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.Debug|x86.Build.0 = Debug|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.Release|Any CPU.Build.0 = Release|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.Release|x64.ActiveCfg = Release|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.Release|x64.Build.0 = Release|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.Release|x86.ActiveCfg = Release|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.Release|x86.Build.0 = Release|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {B024633F-AA96-4551-AB18-2EF9650425AF}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.Debug|x64.ActiveCfg = Debug|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.Debug|x64.Build.0 = Debug|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.Debug|x86.ActiveCfg = Debug|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.Debug|x86.Build.0 = Debug|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.Release|Any CPU.Build.0 = Release|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.Release|x64.ActiveCfg = Release|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.Release|x64.Build.0 = Release|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.Release|x86.ActiveCfg = Release|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.Release|x86.Build.0 = Release|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.Debug|x64.ActiveCfg = Debug|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.Debug|x64.Build.0 = Debug|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.Debug|x86.ActiveCfg = Debug|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.Debug|x86.Build.0 = Debug|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.Release|Any CPU.Build.0 = Release|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.Release|x64.ActiveCfg = Release|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.Release|x64.Build.0 = Release|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.Release|x86.ActiveCfg = Release|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.Release|x86.Build.0 = Release|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.Debug|Any CPU.Build.0 = Debug|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.Debug|x64.ActiveCfg = Debug|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.Debug|x64.Build.0 = Debug|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.Debug|x86.ActiveCfg = Debug|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.Debug|x86.Build.0 = Debug|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.Release|Any CPU.ActiveCfg = Release|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.Release|Any CPU.Build.0 = Release|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.Release|x64.ActiveCfg = Release|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.Release|x64.Build.0 = Release|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.Release|x86.ActiveCfg = Release|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.Release|x86.Build.0 = Release|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {95B83E7B-1ADF-4185-AB36-3B17459B0128}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.Debug|x64.ActiveCfg = Debug|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.Debug|x64.Build.0 = Debug|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.Debug|x86.ActiveCfg = Debug|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.Debug|x86.Build.0 = Debug|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.Release|Any CPU.Build.0 = Release|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.Release|x64.ActiveCfg = Release|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.Release|x64.Build.0 = Release|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.Release|x86.ActiveCfg = Release|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.Release|x86.Build.0 = Release|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.Debug|x64.ActiveCfg = Debug|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.Debug|x64.Build.0 = Debug|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.Debug|x86.ActiveCfg = Debug|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.Debug|x86.Build.0 = Debug|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.Release|Any CPU.Build.0 = Release|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.Release|x64.ActiveCfg = Release|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.Release|x64.Build.0 = Release|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.Release|x86.ActiveCfg = Release|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.Release|x86.Build.0 = Release|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.Debug|x64.ActiveCfg = Debug|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.Debug|x64.Build.0 = Debug|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.Debug|x86.ActiveCfg = Debug|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.Debug|x86.Build.0 = Debug|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.Release|Any CPU.Build.0 = Release|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.Release|x64.ActiveCfg = Release|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.Release|x64.Build.0 = Release|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.Release|x86.ActiveCfg = Release|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.Release|x86.Build.0 = Release|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {A264DD57-E7CF-42DB-94A4-D560DFC408C8}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.Debug|x64.ActiveCfg = Debug|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.Debug|x64.Build.0 = Debug|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.Debug|x86.ActiveCfg = Debug|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.Debug|x86.Build.0 = Debug|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.Release|Any CPU.Build.0 = Release|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.Release|x64.ActiveCfg = Release|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.Release|x64.Build.0 = Release|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.Release|x86.ActiveCfg = Release|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.Release|x86.Build.0 = Release|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {071DAE67-E6F1-4983-84D9-07015BB481C7}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.Debug|x64.ActiveCfg = Debug|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.Debug|x64.Build.0 = Debug|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.Debug|x86.ActiveCfg = Debug|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.Debug|x86.Build.0 = Debug|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.Release|Any CPU.Build.0 = Release|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.Release|x64.ActiveCfg = Release|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.Release|x64.Build.0 = Release|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.Release|x86.ActiveCfg = Release|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.Release|x86.Build.0 = Release|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.Debug|x64.ActiveCfg = Debug|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.Debug|x64.Build.0 = Debug|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.Debug|x86.ActiveCfg = Debug|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.Debug|x86.Build.0 = Debug|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.Release|Any CPU.Build.0 = Release|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.Release|x64.ActiveCfg = Release|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.Release|x64.Build.0 = Release|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.Release|x86.ActiveCfg = Release|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.Release|x86.Build.0 = Release|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {06B5C478-0ACC-4088-97B6-891C4F35EBBC}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.Debug|x64.ActiveCfg = Debug|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.Debug|x64.Build.0 = Debug|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.Debug|x86.ActiveCfg = Debug|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.Debug|x86.Build.0 = Debug|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.Release|Any CPU.Build.0 = Release|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.Release|x64.ActiveCfg = Release|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.Release|x64.Build.0 = Release|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.Release|x86.ActiveCfg = Release|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.Release|x86.Build.0 = Release|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.Debug|x64.ActiveCfg = Debug|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.Debug|x64.Build.0 = Debug|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.Debug|x86.ActiveCfg = Debug|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.Debug|x86.Build.0 = Debug|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.Release|Any CPU.Build.0 = Release|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.Release|x64.ActiveCfg = Release|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.Release|x64.Build.0 = Release|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.Release|x86.ActiveCfg = Release|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.Release|x86.Build.0 = Release|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {F109D48B-A2FF-497D-8374-FEA60C5F2365}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.Debug|x64.ActiveCfg = Debug|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.Debug|x64.Build.0 = Debug|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.Debug|x86.ActiveCfg = Debug|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.Debug|x86.Build.0 = Debug|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.Release|Any CPU.Build.0 = Release|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.Release|x64.ActiveCfg = Release|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.Release|x64.Build.0 = Release|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.Release|x86.ActiveCfg = Release|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.Release|x86.Build.0 = Release|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Debug|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Debug|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.ReleaseTypeScriptStrict|x64.ActiveCfg = Debug|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.ReleaseTypeScriptStrict|x64.Build.0 = Debug|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.ReleaseTypeScriptStrict|x86.ActiveCfg = Debug|Any CPU - {FC20849C-915D-411B-8CFB-915B7751D898}.ReleaseTypeScriptStrict|x86.Build.0 = Debug|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.Debug|x64.ActiveCfg = Debug|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.Debug|x64.Build.0 = Debug|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.Debug|x86.ActiveCfg = Debug|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.Debug|x86.Build.0 = Debug|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.Release|Any CPU.Build.0 = Release|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.Release|x64.ActiveCfg = Release|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.Release|x64.Build.0 = Release|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.Release|x86.ActiveCfg = Release|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.Release|x86.Build.0 = Release|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.Debug|x64.ActiveCfg = Debug|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.Debug|x64.Build.0 = Debug|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.Debug|x86.ActiveCfg = Debug|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.Debug|x86.Build.0 = Debug|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.Release|Any CPU.Build.0 = Release|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.Release|x64.ActiveCfg = Release|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.Release|x64.Build.0 = Release|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.Release|x86.ActiveCfg = Release|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.Release|x86.Build.0 = Release|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.ReleaseTypeScriptStrict|Any CPU.ActiveCfg = Release|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.ReleaseTypeScriptStrict|Any CPU.Build.0 = Release|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.ReleaseTypeScriptStrict|x64.ActiveCfg = Release|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.ReleaseTypeScriptStrict|x64.Build.0 = Release|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.ReleaseTypeScriptStrict|x86.ActiveCfg = Release|Any CPU - {FA78E42D-F49F-45E3-820E-331FB8E34195}.ReleaseTypeScriptStrict|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {75B3F91D-687E-4FB3-AD45-CCFA3C406DB4} = {441A2B84-3FF3-43BE-BAD8-609A1EBDC95C} - {CA084154-E758-4A44-938D-7806AF2DD886} = {1030C3AA-7549-473B-AA7E-5DFAC2F9D37A} - {2E6174AA-FC75-4821-9E86-51B30568BEC0} = {1030C3AA-7549-473B-AA7E-5DFAC2F9D37A} - {69A692EB-C277-46AB-BA55-B33E7E6E129C} = {0AF934BD-80BE-483E-BCB7-D9B3F7B816E3} - {E5AC8F27-F9E2-4E98-AC98-6F9361132A2E} = {0AF934BD-80BE-483E-BCB7-D9B3F7B816E3} - {5EBE3EFF-9558-45F2-9C8F-5C8CFB74D574} = {48E8B044-3374-4F39-A180-9E01F7A10785} - {F0036DA5-5DD4-494C-91B0-37689E00511E} = {441A2B84-3FF3-43BE-BAD8-609A1EBDC95C} - {9293CFCD-6C7B-43E0-9FBD-88753EBF64CC} = {441A2B84-3FF3-43BE-BAD8-609A1EBDC95C} - {8A547CB0-930F-466D-92EB-E780FF14C0A6} = {48E8B044-3374-4F39-A180-9E01F7A10785} - {73E71805-C3AB-400A-8258-7BF429F04EC2} = {0AF934BD-80BE-483E-BCB7-D9B3F7B816E3} - {9E74D2F4-F3E8-4E9F-AC8E-54A3D86A5FCC} = {1030C3AA-7549-473B-AA7E-5DFAC2F9D37A} - {51740C29-AF4F-40AD-BFDE-09E6F8C873D2} = {48E8B044-3374-4F39-A180-9E01F7A10785} - {6AB4FD70-2CCF-4876-A193-B5FD6B32C39A} = {D8CC0D1C-8DAC-49FE-AA78-C028DC124DD5} - {55672414-CC74-4943-B878-508EC4D486AD} = {D8CC0D1C-8DAC-49FE-AA78-C028DC124DD5} - {C56AC38A-513B-40C6-AEB8-0146BB5B2888} = {D8CC0D1C-8DAC-49FE-AA78-C028DC124DD5} - {B024633F-AA96-4551-AB18-2EF9650425AF} = {A0338E8D-A4A3-4380-9FF7-1D0BDC260E31} - {9829DFE2-7F49-40E3-B6A5-AEBB42D1DB33} = {D8CC0D1C-8DAC-49FE-AA78-C028DC124DD5} - {C7923A8B-D0CE-4FD8-ADA0-7507D5F3F693} = {D8CC0D1C-8DAC-49FE-AA78-C028DC124DD5} - {95B83E7B-1ADF-4185-AB36-3B17459B0128} = {D8CC0D1C-8DAC-49FE-AA78-C028DC124DD5} - {94D1F2FB-0E9B-45C0-AC0E-D272BAA4B79F} = {D8CC0D1C-8DAC-49FE-AA78-C028DC124DD5} - {6C699C0A-4FD9-440E-97FC-F422A2FCA31E} = {49A70E20-FF73-451D-BBE8-7680EDCF007B} - {A264DD57-E7CF-42DB-94A4-D560DFC408C8} = {49A70E20-FF73-451D-BBE8-7680EDCF007B} - {071DAE67-E6F1-4983-84D9-07015BB481C7} = {49A70E20-FF73-451D-BBE8-7680EDCF007B} - {DCAF8B88-E36F-48F8-AD0E-0F9B42E9FEB6} = {49A70E20-FF73-451D-BBE8-7680EDCF007B} - {06B5C478-0ACC-4088-97B6-891C4F35EBBC} = {D8CC0D1C-8DAC-49FE-AA78-C028DC124DD5} - {3A6CA187-AD6F-438C-9E5B-B2771F75AF41} = {D8CC0D1C-8DAC-49FE-AA78-C028DC124DD5} - {F109D48B-A2FF-497D-8374-FEA60C5F2365} = {A0338E8D-A4A3-4380-9FF7-1D0BDC260E31} - {FC20849C-915D-411B-8CFB-915B7751D898} = {A0338E8D-A4A3-4380-9FF7-1D0BDC260E31} - {7C9814BB-5B98-43F1-9CD2-4C55CEB9DFBF} = {A0338E8D-A4A3-4380-9FF7-1D0BDC260E31} - {FA78E42D-F49F-45E3-820E-331FB8E34195} = {A0338E8D-A4A3-4380-9FF7-1D0BDC260E31} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {98FCEEE2-A45C-41E7-B2ED-1B14755E9067} - EndGlobalSection -EndGlobal diff --git a/src/NSwag.Npm/package-lock.json b/src/NSwag.Npm/package-lock.json index 3240e4026c..08a92acf45 100644 --- a/src/NSwag.Npm/package-lock.json +++ b/src/NSwag.Npm/package-lock.json @@ -1,12 +1,12 @@ { "name": "nswag", - "version": "13.18.2", + "version": "14.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "nswag", - "version": "13.18.2", + "version": "14.0.0", "license": "MIT", "bin": { "nswag": "bin/nswag.js" diff --git a/src/NSwag.Npm/package.json b/src/NSwag.Npm/package.json index d9f2be6657..2893c0fa53 100644 --- a/src/NSwag.Npm/package.json +++ b/src/NSwag.Npm/package.json @@ -1,6 +1,6 @@ { "name": "nswag", - "version": "13.18.2", + "version": "14.0.0", "optionalDependencies": {}, "repository": { "type": "git", diff --git a/src/NSwag.Sample.NET50/Controllers/ValuesController.cs b/src/NSwag.Sample.NET50/Controllers/ValuesController.cs deleted file mode 100644 index 377079e037..0000000000 --- a/src/NSwag.Sample.NET50/Controllers/ValuesController.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.AspNetCore.Mvc; - -namespace NSwag.Sample.NET50.Controllers -{ - [Route("api/[controller]")] - [ApiController] - public class ValuesController : ControllerBase - { - public class Person - { - public string FirstName { get; set; } = ""; - - public string? MiddleName { get; set; } - - public string LastName { get; set; } = ""; - - public DateTime DayOfBirth { get; set; } - } - - public enum TestEnum - { - Foo, - Bar - } - - [HttpGet] - public ActionResult> Get() - { - return new Person[] { }; - } - - // GET api/values/5 - [HttpGet("{id}")] - public ActionResult Get(int id) - { - return TestEnum.Foo; - } - - // GET api/values/5 - [HttpGet("{id}/foo")] - public ActionResult GetFooBar(int id) - { - return "value"; - } - - // POST api/values - [HttpPost] - public void Post([FromBody] string value) - { - } - - // PUT api/values/5 - [HttpPut("{id}")] - public void Put(int id, [FromBody] string value) - { - } - - // DELETE api/values/5 - [HttpDelete("{id}")] - public void Delete(int id) - { - } - } -} diff --git a/src/NSwag.Sample.NET50/NSwag.Sample.NET50.csproj b/src/NSwag.Sample.NET50/NSwag.Sample.NET50.csproj deleted file mode 100644 index 69d950cd98..0000000000 --- a/src/NSwag.Sample.NET50/NSwag.Sample.NET50.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - net5.0 - enable - 8.0 - - - - - - - - diff --git a/src/NSwag.Sample.NET50/Program.cs b/src/NSwag.Sample.NET50/Program.cs deleted file mode 100644 index 6e50522ef2..0000000000 --- a/src/NSwag.Sample.NET50/Program.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Hosting; - -namespace NSwag.Sample.NET50 -{ - public class Program - { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - } -} diff --git a/src/NSwag.Sample.NET50/Properties/launchSettings.json b/src/NSwag.Sample.NET50/Properties/launchSettings.json deleted file mode 100644 index 50ee08064c..0000000000 --- a/src/NSwag.Sample.NET50/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:1284/", - "sslPort": 44390 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "NSwag.Sample.NET50": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:5000;https://localhost:5001" - } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NET50/Startup.cs b/src/NSwag.Sample.NET50/Startup.cs deleted file mode 100644 index 2487a295b1..0000000000 --- a/src/NSwag.Sample.NET50/Startup.cs +++ /dev/null @@ -1,65 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using NJsonSchema.Generation; -using System.Text.Json.Serialization; - -namespace NSwag.Sample.NET50 -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - public void ConfigureServices(IServiceCollection services) - { - services.AddMvc(); - - services - .AddControllers() - .AddJsonOptions(options => - { - options.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull; - options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()); - }); - - services.AddOpenApiDocument(document => - { - document.Description = "Hello world!"; - document.DefaultReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull; - }); - } - - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseHttpsRedirection(); - app.UseRouting(); - app.UseAuthorization(); - app.UseEndpoints(endpoints => - { - endpoints.MapControllers(); - }); - - app.UseOpenApi(p => p.Path = "/swagger/{documentName}/swagger.yaml"); - app.UseSwaggerUi3(p => p.DocumentPath = "/swagger/{documentName}/swagger.yaml"); - //app.UseApimundo(); - app.UseApimundo(settings => - { - //settings.CompareTo = "a:a:27:25:15:latest"; - settings.DocumentPath = "/swagger/v1/swagger.yaml"; - settings.ApimundoUrl = "https://localhost:5001"; - }); - } - } -} diff --git a/src/NSwag.Sample.NET50/appsettings.Development.json b/src/NSwag.Sample.NET50/appsettings.Development.json deleted file mode 100644 index e203e9407e..0000000000 --- a/src/NSwag.Sample.NET50/appsettings.Development.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/src/NSwag.Sample.NET50/appsettings.json b/src/NSwag.Sample.NET50/appsettings.json deleted file mode 100644 index 7cb5ac8193..0000000000 --- a/src/NSwag.Sample.NET50/appsettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "AllowedHosts": "*" -} diff --git a/src/NSwag.Sample.NET50/nswag.json b/src/NSwag.Sample.NET50/nswag.json deleted file mode 100644 index 4bda4cf1ce..0000000000 --- a/src/NSwag.Sample.NET50/nswag.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "runtime": "Net50", - "defaultVariables": null, - "documentGenerator": { - "aspNetCoreToOpenApi": { - "project": "NSwag.Sample.NET50.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, - "useDocumentProvider": true, - "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/Properties/launchSettings.json b/src/NSwag.Sample.NET60/Properties/launchSettings.json index e08cb1201c..715b9fe7fc 100644 --- a/src/NSwag.Sample.NET60/Properties/launchSettings.json +++ b/src/NSwag.Sample.NET60/Properties/launchSettings.json @@ -1,27 +1,14 @@ { - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:1284/", - "sslPort": 44390 - } - }, + "$schema": "http://json.schemastore.org/launchsettings.json", "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, "NSwag.Sample.NET60": { "commandName": "Project", "launchBrowser": true, + "launchUrl": "swagger", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "http://localhost:5000;https://localhost:5001" + "applicationUrl": "https://localhost:7001;http://localhost:7000" } } -} +} \ No newline at end of file diff --git a/src/NSwag.Sample.NET60/Startup.cs b/src/NSwag.Sample.NET60/Startup.cs index f106bd9001..66cc3d1cc6 100644 --- a/src/NSwag.Sample.NET60/Startup.cs +++ b/src/NSwag.Sample.NET60/Startup.cs @@ -32,7 +32,7 @@ public void ConfigureServices(IServiceCollection services) services.AddOpenApiDocument(document => { document.Description = "Hello world!"; - document.DefaultReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull; + document.SchemaSettings.DefaultReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull; }); } diff --git a/src/NSwag.Sample.NET60/openapi.json b/src/NSwag.Sample.NET60/openapi.json index ac84f3d2f4..26c94bf3b5 100644 --- a/src/NSwag.Sample.NET60/openapi.json +++ b/src/NSwag.Sample.NET60/openapi.json @@ -1,5 +1,5 @@ { - "x-generator": "NSwag v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v13.0.0.0))", + "x-generator": "NSwag v14.0.0.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))", "openapi": "3.0.0", "info": { "title": "My Title", diff --git a/src/NSwag.Sample.NET60Minimal/Program.cs b/src/NSwag.Sample.NET60Minimal/Program.cs index f14eec5b49..5fda1cf4cc 100644 --- a/src/NSwag.Sample.NET60Minimal/Program.cs +++ b/src/NSwag.Sample.NET60Minimal/Program.cs @@ -22,10 +22,10 @@ app.UseOpenApi(); app.UseSwaggerUi3(); -app.MapGet("/", (Func)(() => "Hello World!")) +app.MapGet("/", () => "Hello World!") .WithTags("General"); -app.MapGet("/sum/{a}/{b}", (Func)((a, b) => a + b)) +app.MapGet("/sum/{a}/{b}", (int a, int b) => a + b) .WithName("CalculateSum") .WithTags("Calculator"); diff --git a/src/NSwag.Sample.NET60Minimal/Properties/launchSettings.json b/src/NSwag.Sample.NET60Minimal/Properties/launchSettings.json index 3d73d0b0b1..6aa10cff13 100644 --- a/src/NSwag.Sample.NET60Minimal/Properties/launchSettings.json +++ b/src/NSwag.Sample.NET60Minimal/Properties/launchSettings.json @@ -1,13 +1,14 @@ { + "$schema": "http://json.schemastore.org/launchsettings.json", "profiles": { "NSwag.Sample.NET60Minimal": { "commandName": "Project", "launchBrowser": true, - "launchUrl": "swagger/v1/swagger.json", + "launchUrl": "swagger", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "https://localhost:5001;http://localhost:5000" + "applicationUrl": "https://localhost:7001;http://localhost:7000" } } } \ No newline at end of file diff --git a/src/NSwag.Sample.NET60Minimal/openapi.json b/src/NSwag.Sample.NET60Minimal/openapi.json index 32d5d8ad08..1d23f2ea40 100644 --- a/src/NSwag.Sample.NET60Minimal/openapi.json +++ b/src/NSwag.Sample.NET60Minimal/openapi.json @@ -1,5 +1,5 @@ { - "x-generator": "NSwag v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v9.0.0.0))", + "x-generator": "NSwag v14.0.0.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))", "openapi": "3.0.0", "info": { "title": "Minimal API", @@ -68,6 +68,27 @@ } } } + }, + "/examples": { + "get": { + "tags": [ + "Example" + ], + "operationId": "Example_Get", + "responses": { + "200": { + "description": "", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } } }, "components": {} diff --git a/src/NSwag.Sample.NET70/NSwag.Sample.NET70.csproj b/src/NSwag.Sample.NET70/NSwag.Sample.NET70.csproj index 1123044def..95dd2ac216 100644 --- a/src/NSwag.Sample.NET70/NSwag.Sample.NET70.csproj +++ b/src/NSwag.Sample.NET70/NSwag.Sample.NET70.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/NSwag.Sample.NET70/Properties/launchSettings.json b/src/NSwag.Sample.NET70/Properties/launchSettings.json index bfda022edd..b9ab13135c 100644 --- a/src/NSwag.Sample.NET70/Properties/launchSettings.json +++ b/src/NSwag.Sample.NET70/Properties/launchSettings.json @@ -1,27 +1,14 @@ { - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:1284/", - "sslPort": 44390 - } - }, + "$schema": "http://json.schemastore.org/launchsettings.json", "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, "NSwag.Sample.NET70": { "commandName": "Project", "launchBrowser": true, + "launchUrl": "swagger", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "http://localhost:5000;https://localhost:5001" + "applicationUrl": "https://localhost:7001;http://localhost:7000" } } -} +} \ No newline at end of file diff --git a/src/NSwag.Sample.NET70/Startup.cs b/src/NSwag.Sample.NET70/Startup.cs index 09c1d2c48e..ad6d8e70ff 100644 --- a/src/NSwag.Sample.NET70/Startup.cs +++ b/src/NSwag.Sample.NET70/Startup.cs @@ -32,7 +32,7 @@ public void ConfigureServices(IServiceCollection services) services.AddOpenApiDocument(document => { document.Description = "Hello world!"; - document.DefaultReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull; + document.SchemaSettings.DefaultReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull; }); } diff --git a/src/NSwag.Sample.NET70/openapi.json b/src/NSwag.Sample.NET70/openapi.json index ac84f3d2f4..26c94bf3b5 100644 --- a/src/NSwag.Sample.NET70/openapi.json +++ b/src/NSwag.Sample.NET70/openapi.json @@ -1,5 +1,5 @@ { - "x-generator": "NSwag v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v13.0.0.0))", + "x-generator": "NSwag v14.0.0.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))", "openapi": "3.0.0", "info": { "title": "My Title", diff --git a/src/NSwag.Sample.NET70Minimal/Properties/launchSettings.json b/src/NSwag.Sample.NET70Minimal/Properties/launchSettings.json index 1822eca017..68f0b4fb35 100644 --- a/src/NSwag.Sample.NET70Minimal/Properties/launchSettings.json +++ b/src/NSwag.Sample.NET70Minimal/Properties/launchSettings.json @@ -1,13 +1,14 @@ { + "$schema": "http://json.schemastore.org/launchsettings.json", "profiles": { "NSwag.Sample.NET70Minimal": { "commandName": "Project", "launchBrowser": true, - "launchUrl": "swagger/v1/swagger.json", + "launchUrl": "swagger", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, - "applicationUrl": "https://localhost:5001;http://localhost:5000" + "applicationUrl": "https://localhost:7001;http://localhost:7000" } } -} +} \ No newline at end of file diff --git a/src/NSwag.Sample.NET70Minimal/openapi.json b/src/NSwag.Sample.NET70Minimal/openapi.json index 32d5d8ad08..1d23f2ea40 100644 --- a/src/NSwag.Sample.NET70Minimal/openapi.json +++ b/src/NSwag.Sample.NET70Minimal/openapi.json @@ -1,5 +1,5 @@ { - "x-generator": "NSwag v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v9.0.0.0))", + "x-generator": "NSwag v14.0.0.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))", "openapi": "3.0.0", "info": { "title": "Minimal API", @@ -68,6 +68,27 @@ } } } + }, + "/examples": { + "get": { + "tags": [ + "Example" + ], + "operationId": "Example_Get", + "responses": { + "200": { + "description": "", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + } + } + } } }, "components": {} diff --git a/src/NSwag.Sample.NETCore20.Part/NSwag.Sample.NETCore20.Part.csproj b/src/NSwag.Sample.NETCore20.Part/NSwag.Sample.NETCore20.Part.csproj deleted file mode 100644 index 2a377ca6d6..0000000000 --- a/src/NSwag.Sample.NETCore20.Part/NSwag.Sample.NETCore20.Part.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - netcoreapp2.0 - - - - - diff --git a/src/NSwag.Sample.NETCore20.Part/SampleController.cs b/src/NSwag.Sample.NETCore20.Part/SampleController.cs deleted file mode 100644 index e399930843..0000000000 --- a/src/NSwag.Sample.NETCore20.Part/SampleController.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Microsoft.AspNetCore.Mvc; - -namespace NSwag.Sample.NETCore20.Part -{ - [Route("/sample")] - public class SampleController : Controller - { - [HttpPost] - public string GetSample() - { - return null; - } - } -} diff --git a/src/NSwag.Sample.NETCore20/NSwag.Sample.NETCore20.csproj b/src/NSwag.Sample.NETCore20/NSwag.Sample.NETCore20.csproj deleted file mode 100644 index d648e88b31..0000000000 --- a/src/NSwag.Sample.NETCore20/NSwag.Sample.NETCore20.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - netcoreapp2.0 - false - - - - %(RecursiveDir)\%(FileName)%(Extension) - - - - - - - - - - - - - diff --git a/src/NSwag.Sample.NETCore20/Output/swagger_new_v2.json b/src/NSwag.Sample.NETCore20/Output/swagger_new_v2.json deleted file mode 100644 index b6f2aaa55e..0000000000 --- a/src/NSwag.Sample.NETCore20/Output/swagger_new_v2.json +++ /dev/null @@ -1,601 +0,0 @@ -{ - "x-generator": "NSwag v11.18.3.0 (NJsonSchema v9.10.67.0 (Newtonsoft.Json v10.0.0.0))", - "swagger": "2.0", - "info": { - "title": "My Title", - "version": "1.0.0" - }, - "host": "localhost:65384", - "schemes": [ - "http" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json", - "text/plain", - "text/json" - ], - "paths": { - "/pet": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_AddPet", - "consumes": [ - "application/json" - ], - "parameters": [ - { - "name": "pet", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Pet" - }, - "x-nullable": true - } - ], - "responses": { - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - }, - "put": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPet", - "consumes": [ - "application/json" - ], - "parameters": [ - { - "name": "pet", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Pet" - }, - "x-nullable": true - } - ], - "responses": { - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - } - }, - "/pet/findByStatus": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByStatus", - "parameters": [ - { - "type": "array", - "name": "status", - "in": "query", - "required": true, - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "type": "string" - } - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - }, - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - } - }, - "/pet/findByCategory": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByCategory", - "parameters": [ - { - "type": "string", - "name": "category", - "in": "query", - "required": true, - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - }, - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - } - }, - "/pet/{petId}": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindById", - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/Pet" - } - }, - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - }, - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPetWithFormData", - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "integer", - "name": "Id", - "in": "formData", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "integer", - "name": "Age", - "in": "formData", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "integer", - "name": "Category.Id", - "in": "formData", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "string", - "name": "Category.Name", - "in": "formData", - "required": true, - "x-nullable": true - }, - { - "type": "boolean", - "name": "HasVaccinations", - "in": "formData", - "required": true, - "x-nullable": false - }, - { - "type": "string", - "name": "Name", - "in": "formData", - "required": true, - "x-nullable": true - }, - { - "type": "array", - "name": "Images", - "in": "formData", - "required": true, - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "$ref": "#/definitions/Image" - } - }, - { - "type": "array", - "name": "Tags", - "in": "formData", - "required": true, - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "$ref": "#/definitions/Tag" - } - }, - { - "type": "string", - "name": "Status", - "in": "formData", - "required": true, - "x-nullable": true - } - ], - "responses": { - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - }, - "delete": { - "tags": [ - "Pet" - ], - "operationId": "Pet_DeletePet", - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - } - }, - "/pet/{petId}/uploadImage": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_UploadImage", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "file", - "name": "file", - "in": "formData", - "required": true, - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/ApiResponse" - } - }, - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - } - }, - "/pet/RequiredAndOptional": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_RequiredAndOptional", - "parameters": [ - { - "type": "integer", - "name": "int_RequiredAndNotNullable", - "in": "query", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "integer", - "name": "int_RequiredAndNullable", - "in": "query", - "required": true, - "format": "int32", - "x-nullable": true - }, - { - "type": "string", - "name": "string_RequiredAndNullable", - "in": "query", - "required": true, - "x-nullable": true - }, - { - "type": "string", - "name": "string_RequiredAndNotNullable", - "in": "query", - "required": true, - "x-nullable": false - }, - { - "type": "number", - "name": "decimalWithDefault_NotRequiredAndNotNullable", - "in": "query", - "format": "decimal", - "default": 1.0, - "x-nullable": false - }, - { - "type": "number", - "name": "decimalWithDefault_NotRequiredAndNullable", - "in": "query", - "format": "decimal", - "default": 1.0, - "x-nullable": true - }, - { - "type": "string", - "name": "stringWithDefault_NotRequiredAndNullable", - "in": "query", - "default": "foo", - "x-nullable": true - }, - { - "type": "string", - "name": "stringWithDefault_NotRequiredAndNotNullable", - "in": "query", - "default": "foo", - "x-nullable": false - } - ], - "responses": { - "200": { - "description": "" - } - } - } - }, - "/sample": { - "post": { - "tags": [ - "Sample" - ], - "operationId": "Sample_GetSample", - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "string" - } - } - } - } - } - }, - "definitions": { - "Pet": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "age", - "hasVaccinations", - "name", - "status" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "age": { - "type": "integer", - "format": "int32", - "maximum": 150.0, - "minimum": 0.0 - }, - "category": { - "$ref": "#/definitions/Category" - }, - "hasVaccinations": { - "type": "boolean" - }, - "name": { - "type": "string", - "maxLength": 50, - "minLength": 2 - }, - "images": { - "type": "array", - "items": { - "$ref": "#/definitions/Image" - } - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/definitions/Tag" - } - }, - "status": { - "type": "string", - "minLength": 1 - } - } - }, - "Category": { - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "Image": { - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "url": { - "type": "string" - } - } - }, - "Tag": { - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "SerializableError": { - "type": "object", - "additionalProperties": false, - "allOf": [ - { - "type": "object", - "additionalProperties": {} - } - ] - }, - "ApiResponse": { - "type": "object", - "additionalProperties": false, - "required": [ - "code" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - }, - "securityDefinitions": { - "TEST_HEADER": { - "type": "apiKey", - "description": "TEST_HEADER", - "name": "TEST_HEADER", - "in": "header" - } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore20/Output/swagger_new_v3.json b/src/NSwag.Sample.NETCore20/Output/swagger_new_v3.json deleted file mode 100644 index 844554e4b2..0000000000 --- a/src/NSwag.Sample.NETCore20/Output/swagger_new_v3.json +++ /dev/null @@ -1,728 +0,0 @@ -{ - "x-generator": "NSwag v11.18.3.0 (NJsonSchema v9.10.67.0 (Newtonsoft.Json v10.0.0.0))", - "openapi": "3.0", - "info": { - "title": "My Title", - "version": "1.0.0" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json", - "text/plain", - "text/json" - ], - "servers": [ - { - "url": "http://localhost:65384" - } - ], - "paths": { - "/pet": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_AddPet", - "requestBody": { - "x-name": "pet", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Pet" - } - } - }, - "required": true - }, - "responses": { - "400": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SerializableError" - } - ] - } - } - } - } - } - }, - "put": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPet", - "requestBody": { - "x-name": "pet", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Pet" - } - } - }, - "required": true - }, - "responses": { - "400": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SerializableError" - } - ] - } - } - } - } - } - } - }, - "/pet/findByStatus": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByStatus", - "parameters": [ - { - "name": "status", - "in": "query", - "required": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "collectionFormat": "multi", - "nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" - } - } - } - } - }, - "400": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SerializableError" - } - ] - } - } - } - } - } - } - }, - "/pet/findByCategory": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByCategory", - "parameters": [ - { - "name": "category", - "in": "query", - "required": true, - "schema": { - "type": "string" - }, - "nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" - } - } - } - } - }, - "400": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SerializableError" - } - ] - } - } - } - } - } - } - }, - "/pet/{petId}": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindById", - "parameters": [ - { - "name": "petId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "nullable": false - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/Pet" - } - ] - } - } - } - }, - "400": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SerializableError" - } - ] - } - } - } - }, - "404": { - "description": "" - } - } - }, - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPetWithFormData", - "parameters": [ - { - "name": "petId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "nullable": false - }, - { - "name": "Id", - "in": "formData", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "nullable": false - }, - { - "name": "Age", - "in": "formData", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "nullable": false - }, - { - "name": "Category.Id", - "in": "formData", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "nullable": false - }, - { - "name": "Category.Name", - "in": "formData", - "required": true, - "schema": { - "type": "string" - }, - "nullable": true - }, - { - "name": "HasVaccinations", - "in": "formData", - "required": true, - "schema": { - "type": "boolean" - }, - "nullable": false - }, - { - "name": "Name", - "in": "formData", - "required": true, - "schema": { - "type": "string" - }, - "nullable": true - }, - { - "name": "Images", - "in": "formData", - "required": true, - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Image" - } - }, - "collectionFormat": "multi", - "nullable": true - }, - { - "name": "Tags", - "in": "formData", - "required": true, - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Tag" - } - }, - "collectionFormat": "multi", - "nullable": true - }, - { - "name": "Status", - "in": "formData", - "required": true, - "schema": { - "type": "string" - }, - "nullable": true - } - ], - "responses": { - "400": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SerializableError" - } - ] - } - } - } - }, - "404": { - "description": "" - } - } - }, - "delete": { - "tags": [ - "Pet" - ], - "operationId": "Pet_DeletePet", - "parameters": [ - { - "name": "petId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "nullable": false - } - ], - "responses": { - "400": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SerializableError" - } - ] - } - } - } - }, - "404": { - "description": "" - } - } - } - }, - "/pet/{petId}/uploadImage": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_UploadImage", - "parameters": [ - { - "name": "petId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "nullable": false - }, - { - "type": "file", - "name": "file", - "in": "formData", - "required": true, - "schema": { - "type": "file" - }, - "nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ApiResponse" - } - ] - } - } - } - }, - "400": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SerializableError" - } - ] - } - } - } - }, - "404": { - "description": "" - } - } - } - }, - "/pet/RequiredAndOptional": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_RequiredAndOptional", - "parameters": [ - { - "name": "int_RequiredAndNotNullable", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "nullable": false - }, - { - "name": "int_RequiredAndNullable", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "nullable": true - }, - { - "name": "string_RequiredAndNullable", - "in": "query", - "required": true, - "schema": { - "type": "string" - }, - "nullable": true - }, - { - "name": "string_RequiredAndNotNullable", - "in": "query", - "required": true, - "schema": { - "type": "string" - }, - "nullable": false - }, - { - "name": "decimalWithDefault_NotRequiredAndNotNullable", - "in": "query", - "schema": { - "type": "number", - "format": "decimal" - }, - "default": 1.0, - "nullable": false - }, - { - "name": "decimalWithDefault_NotRequiredAndNullable", - "in": "query", - "schema": { - "type": "number", - "format": "decimal" - }, - "default": 1.0, - "nullable": true - }, - { - "name": "stringWithDefault_NotRequiredAndNullable", - "in": "query", - "schema": { - "type": "string" - }, - "default": "foo", - "nullable": true - }, - { - "name": "stringWithDefault_NotRequiredAndNotNullable", - "in": "query", - "schema": { - "type": "string" - }, - "default": "foo", - "nullable": false - } - ], - "responses": { - "200": { - "description": "" - } - } - } - }, - "/sample": { - "post": { - "tags": [ - "Sample" - ], - "operationId": "Sample_GetSample", - "responses": { - "200": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "Pet": { - "type": "object", - "additionalProperties": false, - "required": [ - "name", - "status" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "age": { - "type": "integer", - "format": "int32", - "maximum": 150.0, - "minimum": 0.0 - }, - "category": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/Category" - } - ] - }, - "hasVaccinations": { - "type": "boolean" - }, - "name": { - "type": "string", - "maxLength": 50, - "minLength": 2 - }, - "images": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Image" - } - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Tag" - } - }, - "status": { - "type": "string", - "minLength": 1 - } - } - }, - "Category": { - "type": "object", - "additionalProperties": false, - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "Image": { - "type": "object", - "additionalProperties": false, - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "url": { - "type": "string" - } - } - }, - "Tag": { - "type": "object", - "additionalProperties": false, - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "SerializableError": { - "type": "object", - "additionalProperties": false, - "allOf": [ - { - "type": "object", - "additionalProperties": {} - } - ] - }, - "ApiResponse": { - "type": "object", - "additionalProperties": false, - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore20/Output/swagger_old_v2.json b/src/NSwag.Sample.NETCore20/Output/swagger_old_v2.json deleted file mode 100644 index 0c60237713..0000000000 --- a/src/NSwag.Sample.NETCore20/Output/swagger_old_v2.json +++ /dev/null @@ -1,501 +0,0 @@ -{ - "x-generator": "NSwag v11.18.3.0 (NJsonSchema v9.10.67.0 (Newtonsoft.Json v10.0.0.0))", - "swagger": "2.0", - "info": { - "title": "My Title", - "version": "1.0.0" - }, - "host": "localhost:65384", - "schemes": [ - "http" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/pet": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_AddPet", - "parameters": [ - { - "name": "pet", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Pet" - }, - "x-nullable": true - } - ], - "responses": { - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - }, - "put": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPet", - "parameters": [ - { - "name": "pet", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Pet" - }, - "x-nullable": true - } - ], - "responses": { - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - } - }, - "/pet/findByStatus": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByStatus", - "parameters": [ - { - "type": "array", - "name": "status", - "in": "query", - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "type": "string" - } - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - }, - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - } - }, - "/pet/findByCategory": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByCategory", - "parameters": [ - { - "type": "string", - "name": "category", - "in": "query", - "required": true, - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - }, - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - } - }, - "/pet/{petId}": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindById", - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/Pet" - } - }, - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - }, - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPetWithFormData", - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "object", - "name": "pet", - "in": "formData", - "x-schema": { - "$ref": "#/definitions/Pet" - }, - "x-nullable": true - } - ], - "responses": { - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - }, - "delete": { - "tags": [ - "Pet" - ], - "operationId": "Pet_DeletePet", - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - } - }, - "/pet/{petId}/uploadImage": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_UploadImage", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "file", - "name": "file", - "in": "formData", - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/ApiResponse" - } - }, - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - } - }, - "/pet/RequiredAndOptional": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_RequiredAndOptional", - "parameters": [ - { - "type": "integer", - "name": "int_RequiredAndNotNullable", - "in": "query", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "integer", - "name": "int_RequiredAndNullable", - "in": "query", - "required": true, - "format": "int32", - "x-nullable": true - }, - { - "type": "string", - "name": "string_RequiredAndNullable", - "in": "query", - "required": true, - "x-nullable": true - }, - { - "type": "string", - "name": "string_RequiredAndNotNullable", - "in": "query", - "required": true, - "x-nullable": false - }, - { - "type": "number", - "name": "decimalWithDefault_NotRequiredAndNotNullable", - "in": "query", - "format": "decimal", - "default": 1.0, - "x-nullable": false - }, - { - "type": "number", - "name": "decimalWithDefault_NotRequiredAndNullable", - "in": "query", - "format": "decimal", - "default": 1.0, - "x-nullable": true - }, - { - "type": "string", - "name": "stringWithDefault_NotRequiredAndNullable", - "in": "query", - "default": "foo", - "x-nullable": true - }, - { - "type": "string", - "name": "stringWithDefault_NotRequiredAndNotNullable", - "in": "query", - "default": "foo", - "x-nullable": false - } - ], - "responses": { - "200": { - "description": "" - } - } - } - } - }, - "definitions": { - "Pet": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "age", - "hasVaccinations", - "name", - "status" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "age": { - "type": "integer", - "format": "int32", - "maximum": 150.0, - "minimum": 0.0 - }, - "category": { - "$ref": "#/definitions/Category" - }, - "hasVaccinations": { - "type": "boolean" - }, - "name": { - "type": "string", - "maxLength": 50, - "minLength": 2 - }, - "images": { - "type": "array", - "items": { - "$ref": "#/definitions/Image" - } - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/definitions/Tag" - } - }, - "status": { - "type": "string", - "minLength": 1 - } - } - }, - "Category": { - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "Image": { - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "url": { - "type": "string" - } - } - }, - "Tag": { - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "SerializableError": { - "type": "object", - "additionalProperties": false, - "allOf": [ - { - "type": "object", - "additionalProperties": {} - } - ] - }, - "ApiResponse": { - "type": "object", - "additionalProperties": false, - "required": [ - "code" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore20/Output/swagger_old_v3.json b/src/NSwag.Sample.NETCore20/Output/swagger_old_v3.json deleted file mode 100644 index 7d3d375314..0000000000 --- a/src/NSwag.Sample.NETCore20/Output/swagger_old_v3.json +++ /dev/null @@ -1,619 +0,0 @@ -{ - "x-generator": "NSwag v11.18.3.0 (NJsonSchema v9.10.67.0 (Newtonsoft.Json v10.0.0.0))", - "openapi": "3.0", - "info": { - "title": "My Title", - "version": "1.0.0" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "servers": [ - { - "url": "http://localhost:65384" - } - ], - "paths": { - "/pet": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_AddPet", - "requestBody": { - "x-name": "pet", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Pet" - } - } - }, - "required": true - }, - "responses": { - "400": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SerializableError" - } - ] - } - } - } - } - } - }, - "put": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPet", - "requestBody": { - "x-name": "pet", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Pet" - } - } - }, - "required": true - }, - "responses": { - "400": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SerializableError" - } - ] - } - } - } - } - } - } - }, - "/pet/findByStatus": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByStatus", - "parameters": [ - { - "name": "status", - "in": "query", - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "collectionFormat": "multi", - "nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" - } - } - } - } - }, - "400": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SerializableError" - } - ] - } - } - } - } - } - } - }, - "/pet/findByCategory": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByCategory", - "parameters": [ - { - "name": "category", - "in": "query", - "required": true, - "schema": { - "type": "string" - }, - "nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Pet" - } - } - } - } - }, - "400": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SerializableError" - } - ] - } - } - } - } - } - } - }, - "/pet/{petId}": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindById", - "parameters": [ - { - "name": "petId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "nullable": false - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/Pet" - } - ] - } - } - } - }, - "400": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SerializableError" - } - ] - } - } - } - }, - "404": { - "description": "" - } - } - }, - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPetWithFormData", - "parameters": [ - { - "name": "petId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "nullable": false - }, - { - "name": "pet", - "in": "formData", - "schema": { - "$ref": "#/components/schemas/Pet" - }, - "nullable": true - } - ], - "responses": { - "400": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SerializableError" - } - ] - } - } - } - }, - "404": { - "description": "" - } - } - }, - "delete": { - "tags": [ - "Pet" - ], - "operationId": "Pet_DeletePet", - "parameters": [ - { - "name": "petId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "nullable": false - } - ], - "responses": { - "400": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SerializableError" - } - ] - } - } - } - }, - "404": { - "description": "" - } - } - } - }, - "/pet/{petId}/uploadImage": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_UploadImage", - "parameters": [ - { - "name": "petId", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "nullable": false - }, - { - "type": "file", - "name": "file", - "in": "formData", - "schema": { - "type": "file" - }, - "nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/ApiResponse" - } - ] - } - } - } - }, - "400": { - "x-nullable": true, - "description": "", - "content": { - "application/json": { - "schema": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/SerializableError" - } - ] - } - } - } - }, - "404": { - "description": "" - } - } - } - }, - "/pet/RequiredAndOptional": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_RequiredAndOptional", - "parameters": [ - { - "name": "int_RequiredAndNotNullable", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "nullable": false - }, - { - "name": "int_RequiredAndNullable", - "in": "query", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - }, - "nullable": true - }, - { - "name": "string_RequiredAndNullable", - "in": "query", - "required": true, - "schema": { - "type": "string" - }, - "nullable": true - }, - { - "name": "string_RequiredAndNotNullable", - "in": "query", - "required": true, - "schema": { - "type": "string" - }, - "nullable": false - }, - { - "name": "decimalWithDefault_NotRequiredAndNotNullable", - "in": "query", - "schema": { - "type": "number", - "format": "decimal" - }, - "default": 1.0, - "nullable": false - }, - { - "name": "decimalWithDefault_NotRequiredAndNullable", - "in": "query", - "schema": { - "type": "number", - "format": "decimal" - }, - "default": 1.0, - "nullable": true - }, - { - "name": "stringWithDefault_NotRequiredAndNullable", - "in": "query", - "schema": { - "type": "string" - }, - "default": "foo", - "nullable": true - }, - { - "name": "stringWithDefault_NotRequiredAndNotNullable", - "in": "query", - "schema": { - "type": "string" - }, - "default": "foo", - "nullable": false - } - ], - "responses": { - "200": { - "description": "" - } - } - } - } - }, - "components": { - "schemas": { - "Pet": { - "type": "object", - "additionalProperties": false, - "required": [ - "name", - "status" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "age": { - "type": "integer", - "format": "int32", - "maximum": 150.0, - "minimum": 0.0 - }, - "category": { - "nullable": true, - "oneOf": [ - { - "$ref": "#/components/schemas/Category" - } - ] - }, - "hasVaccinations": { - "type": "boolean" - }, - "name": { - "type": "string", - "maxLength": 50, - "minLength": 2 - }, - "images": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Image" - } - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Tag" - } - }, - "status": { - "type": "string", - "minLength": 1 - } - } - }, - "Category": { - "type": "object", - "additionalProperties": false, - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "Image": { - "type": "object", - "additionalProperties": false, - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "url": { - "type": "string" - } - } - }, - "Tag": { - "type": "object", - "additionalProperties": false, - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "SerializableError": { - "type": "object", - "additionalProperties": false, - "allOf": [ - { - "type": "object", - "additionalProperties": {} - } - ] - }, - "ApiResponse": { - "type": "object", - "additionalProperties": false, - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore20/Program.cs b/src/NSwag.Sample.NETCore20/Program.cs deleted file mode 100644 index 259dc400b9..0000000000 --- a/src/NSwag.Sample.NETCore20/Program.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; - -namespace NSwag.Sample.NETCore20 -{ - public class Program - { - public static void Main(string[] args) - { - BuildWebHost(args).Run(); - } - - public static IWebHost BuildWebHost(string[] args) => - WebHost.CreateDefaultBuilder(args) - .UseStartup() - .Build(); - } -} diff --git a/src/NSwag.Sample.NETCore20/Properties/launchSettings.json b/src/NSwag.Sample.NETCore20/Properties/launchSettings.json deleted file mode 100644 index 64a4855280..0000000000 --- a/src/NSwag.Sample.NETCore20/Properties/launchSettings.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:65384/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "NSwag.Sample.NETCore20": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:65385/" - } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore20/Startup.cs b/src/NSwag.Sample.NETCore20/Startup.cs deleted file mode 100644 index 7999a79832..0000000000 --- a/src/NSwag.Sample.NETCore20/Startup.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System.Reflection; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using NSwag.AspNetCore; -using NSwag.Sample.NETCore20.Part; -using NSwag.Generation.Processors.Security; - -namespace NSwag.Sample.NETCore20 -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - public void ConfigureServices(IServiceCollection services) - { - services.AddMvc(). - AddApplicationPart(typeof(SampleController).GetTypeInfo().Assembly); - - // Add OpenAPI and Swagger DI services and configure documents - - // Adds the NSwag services - services - // Register a Swagger 2.0 document generator - .AddSwaggerDocument(document => - { - document.DocumentName = "swagger"; - // Add operation security scope processor - document.OperationProcessors.Add(new OperationSecurityScopeProcessor("TEST_APIKEY")); - // Add custom document processors, etc. - document.DocumentProcessors.Add(new SecurityDefinitionAppender("TEST_APIKEY", new OpenApiSecurityScheme - { - Type = OpenApiSecuritySchemeType.ApiKey, - Name = "TEST_HEADER", - In = OpenApiSecurityApiKeyLocation.Header, - Description = "TEST_DESCRIPTION" - })); - // Post process the generated document - document.PostProcess = d => d.Info.Title = "Hello world!"; - }) - // Register an OpenAPI 3.0 document generator - .AddOpenApiDocument(document => document.DocumentName = "openapi"); - } - - public void Configure(IApplicationBuilder app, IHostingEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseMvc(); - - //// Add OpenAPI and Swagger middlewares to serve documents and web UIs - - // URLs: - // - http://localhost:65384/swagger/v1/swagger.json - // - http://localhost:65384/swagger - // - http://localhost:65384/redoc - // - http://localhost:65384/openapi - // - http://localhost:65384/openapi_redoc - - // Add Swagger 2.0 document serving middleware - app.UseOpenApi(options => - { - options.DocumentName = "swagger"; - options.Path = "/swagger/v1/swagger.json"; - }); - - // Add web UIs to interact with the document - app.UseSwaggerUi3(options => - { - // Define web UI route - options.Path = "/swagger"; - - // Define OpenAPI/Swagger document route (defined with UseSwaggerWithApiExplorer) - options.DocumentPath = "/swagger/v1/swagger.json"; - }); - app.UseReDoc(options => - { - options.Path = "/redoc"; - options.DocumentPath = "/swagger/v1/swagger.json"; - }); - - //// Add OpenAPI 3.0 document serving middleware - app.UseOpenApi(options => - { - options.DocumentName = "openapi"; - options.Path = "/openapi/v1/openapi.json"; - }); - - // Add web UIs to interact with the document - app.UseSwaggerUi3(options => - { - options.Path = "/openapi"; - options.DocumentPath = "/openapi/v1/openapi.json"; - }); - app.UseReDoc(options => - { - options.Path = "/openapi_redoc"; - options.DocumentPath = "/openapi/v1/openapi.json"; - }); - - // Add Swagger UI with multiple documents - app.UseSwaggerUi3(options => - { - // Add multiple OpenAPI/Swagger documents to the Swagger UI 3 web frontend - options.SwaggerRoutes.Add(new SwaggerUi3Route("Swagger", "/swagger/v1/swagger.json")); - options.SwaggerRoutes.Add(new SwaggerUi3Route("Openapi", "/openapi/v1/openapi.json")); - options.SwaggerRoutes.Add(new SwaggerUi3Route("Petstore", "http://petstore.swagger.io/v2/swagger.json")); - - // Define web UI route - options.Path = "/swagger_all"; - }); - } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore20/Update-SwaggerSpecs.ps1 b/src/NSwag.Sample.NETCore20/Update-SwaggerSpecs.ps1 deleted file mode 100644 index 144649d80b..0000000000 --- a/src/NSwag.Sample.NETCore20/Update-SwaggerSpecs.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -Try -{ - New-Item -ItemType directory -Force -Path "$PSScriptRoot/Output" - - Invoke-WebRequest -Uri 'http://localhost:65384/swagger_new_ui/v1/swagger.json' -OutFile "$PSScriptRoot/Output/swagger_new_v2.json" - - Invoke-WebRequest -Uri 'http://localhost:65384/swagger_new_v3/v1/swagger.json' -OutFile "$PSScriptRoot/Output/swagger_new_v3.json" - - Invoke-WebRequest -Uri 'http://localhost:65384/swagger_old_ui/v1/swagger.json' -OutFile "$PSScriptRoot/Output/swagger_old_v2.json" - - Invoke-WebRequest -Uri 'http://localhost:65384/swagger_old_v3/v1/swagger.json' -OutFile "$PSScriptRoot/Output/swagger_old_v3.json" -} -Catch -{ - "Could not download the OpenAPI/Swagger specifications: " - Throw -} - diff --git a/src/NSwag.Sample.NETCore20/appsettings.Development.json b/src/NSwag.Sample.NETCore20/appsettings.Development.json deleted file mode 100644 index fa8ce71a97..0000000000 --- a/src/NSwag.Sample.NETCore20/appsettings.Development.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/src/NSwag.Sample.NETCore20/appsettings.json b/src/NSwag.Sample.NETCore20/appsettings.json deleted file mode 100644 index 26bb0ac7ac..0000000000 --- a/src/NSwag.Sample.NETCore20/appsettings.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Logging": { - "IncludeScopes": false, - "Debug": { - "LogLevel": { - "Default": "Warning" - } - }, - "Console": { - "LogLevel": { - "Default": "Warning" - } - } - } -} diff --git a/src/NSwag.Sample.NETCore20/nswag.json b/src/NSwag.Sample.NETCore20/nswag.json deleted file mode 100644 index 60ab8fa8b0..0000000000 --- a/src/NSwag.Sample.NETCore20/nswag.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "runtime": "NetCore21", - "defaultVariables": "", - "documentGenerator": { - "aspNetCoreToOpenApi": { - "project": null, - "msBuildProjectExtensionsPath": null, - "configuration": null, - "runtime": null, - "targetFramework": null, - "noBuild": false, - "verbose": true, - "workingDirectory": null, - "requireParametersWithoutDefault": false, - "apiGroupNames": null, - "defaultPropertyNameHandling": "Default", - "defaultReferenceTypeNullHandling": "Null", - "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, - "useDocumentProvider": true, - "documentName": "swagger", - "aspNetCoreEnvironment": null, - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": false, - "output": "swagger.json", - "outputType": "Swagger2", - "assemblyPaths": [ - "bin/Debug/netcoreapp2.0/NSwag.Sample.NETCore20.dll" - ], - "assemblyConfig": null, - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": {} -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore20/swagger.json b/src/NSwag.Sample.NETCore20/swagger.json deleted file mode 100644 index a32d73b7b4..0000000000 --- a/src/NSwag.Sample.NETCore20/swagger.json +++ /dev/null @@ -1,758 +0,0 @@ -{ - "x-generator": "NSwag v13.10.8.0 (NJsonSchema v10.3.11.0 (Newtonsoft.Json v11.0.0.0))", - "swagger": "2.0", - "info": { - "title": "Hello world!", - "version": "1.0.0" - }, - "paths": { - "/pet": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_AddPet", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "pet", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Pet" - }, - "x-nullable": false - } - ], - "responses": { - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - }, - "security": [ - { - "TEST_APIKEY": [] - } - ] - }, - "put": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPet", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "pet", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Pet" - }, - "x-nullable": false - } - ], - "responses": { - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - }, - "security": [ - { - "TEST_APIKEY": [] - } - ] - } - }, - "/pet/findByStatus": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByStatusAll", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "array", - "name": "status", - "in": "query", - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "type": "string" - } - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - }, - "security": [ - { - "TEST_APIKEY": [] - } - ] - } - }, - "/pet/findByStatus/{skip}/{sortOrder}": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByStatus", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "array", - "name": "status", - "in": "query", - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "type": "string" - } - }, - { - "type": "integer", - "name": "skip", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "integer", - "name": "sortOrder", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - }, - "security": [ - { - "TEST_APIKEY": [] - } - ] - } - }, - "/pet/findByCategory": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByCategory", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "string", - "name": "category", - "in": "query", - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - }, - "security": [ - { - "TEST_APIKEY": [] - } - ] - } - }, - "/pet/{petId}": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindById", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/Pet" - } - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - }, - "security": [ - { - "TEST_APIKEY": [] - } - ] - }, - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPetWithFormData", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "integer", - "name": "Id", - "in": "formData", - "format": "int32", - "x-nullable": false - }, - { - "type": "integer", - "name": "Age", - "in": "formData", - "format": "int32", - "maximum": 150.0, - "minimum": 0.0, - "x-nullable": false - }, - { - "type": "integer", - "name": "Category.Id", - "in": "formData", - "format": "int32", - "x-nullable": false - }, - { - "type": "string", - "name": "Category.Name", - "in": "formData", - "x-nullable": true - }, - { - "type": "boolean", - "name": "HasVaccinations", - "in": "formData", - "x-nullable": false - }, - { - "type": "string", - "name": "Name", - "in": "formData", - "maxLength": 50, - "minLength": 2, - "x-nullable": true - }, - { - "type": "array", - "name": "Images", - "in": "formData", - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "$ref": "#/definitions/Image" - } - }, - { - "type": "array", - "name": "Tags", - "in": "formData", - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "$ref": "#/definitions/Tag" - } - }, - { - "type": "string", - "name": "Status", - "in": "formData", - "x-nullable": true - } - ], - "responses": { - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - }, - "security": [ - { - "TEST_APIKEY": [] - } - ] - }, - "delete": { - "tags": [ - "Pet" - ], - "operationId": "Pet_DeletePet", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - }, - "security": [ - { - "TEST_APIKEY": [] - } - ] - } - }, - "/pet/{petId}/uploadImage": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_UploadImage", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "string", - "name": "ContentType", - "in": "query", - "x-nullable": true - }, - { - "type": "string", - "name": "ContentDisposition", - "in": "query", - "x-nullable": true - }, - { - "type": "object", - "name": "Headers", - "in": "query", - "x-schema": { - "$ref": "#/definitions/IHeaderDictionary" - }, - "x-nullable": true - }, - { - "type": "integer", - "name": "Length", - "in": "query", - "format": "int64", - "x-nullable": false - }, - { - "type": "string", - "name": "Name", - "in": "query", - "x-nullable": true - }, - { - "type": "string", - "name": "FileName", - "in": "query", - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/ApiResponse" - } - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - }, - "security": [ - { - "TEST_APIKEY": [] - } - ] - } - }, - "/pet/RequiredAndOptional": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_RequiredAndOptional", - "parameters": [ - { - "type": "integer", - "name": "int_RequiredAndNotNullable", - "in": "query", - "format": "int32", - "x-nullable": false - }, - { - "type": "integer", - "name": "int_RequiredAndNullable", - "in": "query", - "format": "int32", - "x-nullable": true - }, - { - "type": "string", - "name": "string_RequiredAndNullable", - "in": "query", - "x-nullable": true - }, - { - "type": "string", - "name": "string_RequiredAndNotNullable", - "in": "query", - "x-nullable": false - }, - { - "type": "number", - "name": "decimalWithDefault_NotRequiredAndNotNullable", - "in": "query", - "format": "decimal", - "default": 1.0, - "x-nullable": false - }, - { - "type": "number", - "name": "decimalWithDefault_NotRequiredAndNullable", - "in": "query", - "format": "decimal", - "default": 1.0, - "x-nullable": true - }, - { - "type": "string", - "name": "stringWithDefault_NotRequiredAndNullable", - "in": "query", - "default": "foo", - "x-nullable": true - }, - { - "type": "string", - "name": "stringWithDefault_NotRequiredAndNotNullable", - "in": "query", - "default": "foo", - "x-nullable": false - } - ], - "responses": { - "200": { - "description": "" - } - }, - "security": [ - { - "TEST_APIKEY": [] - } - ] - } - }, - "/sample": { - "post": { - "tags": [ - "Sample" - ], - "operationId": "Sample_GetSample", - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "type": "string" - } - } - }, - "security": [ - { - "TEST_APIKEY": [] - } - ] - } - } - }, - "definitions": { - "SerializableError": { - "type": "object", - "additionalProperties": {} - }, - "Pet": { - "type": "object", - "required": [ - "id", - "age", - "hasVaccinations", - "name", - "status" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "age": { - "type": "integer", - "format": "int32", - "maximum": 150.0, - "minimum": 0.0 - }, - "category": { - "$ref": "#/definitions/Category" - }, - "hasVaccinations": { - "type": "boolean" - }, - "name": { - "type": "string", - "maxLength": 50, - "minLength": 2 - }, - "images": { - "type": "array", - "items": { - "$ref": "#/definitions/Image" - } - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/definitions/Tag" - } - }, - "status": { - "type": "string", - "minLength": 1 - } - } - }, - "Category": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "Image": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "url": { - "type": "string" - } - } - }, - "Tag": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "ApiResponse": { - "type": "object", - "required": [ - "code" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "IHeaderDictionary": { - "type": "object", - "x-abstract": true, - "required": [ - "Item" - ], - "properties": { - "Item": { - "type": "array", - "items": { - "additionalProperties": {} - } - }, - "ContentLength": { - "type": "integer", - "format": "int64" - } - } - } - }, - "securityDefinitions": { - "TEST_APIKEY": { - "type": "apiKey", - "description": "TEST_DESCRIPTION", - "name": "TEST_HEADER", - "in": "header" - } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore21/Controllers/PetController.cs b/src/NSwag.Sample.NETCore21/Controllers/PetController.cs deleted file mode 100644 index 9a0e94c010..0000000000 --- a/src/NSwag.Sample.NETCore21/Controllers/PetController.cs +++ /dev/null @@ -1,161 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Net; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.ModelBinding; - -namespace NSwag.Sample -{ - // Intentionally not sharing the controller source code with the 1.1 and 2.0 samples. - // 2.1 introduces enhancements to the programming model for API but expects you to - // write some different code. - // - // This sample is similar to http://petstore.swagger.io/#/ - [ApiController] - [Route("/pet")] - public class PetController : ControllerBase - { - /// - /// Creates an order - /// - /// Order created - /// Order invalid - [HttpPost("createOrder")] - [ProducesResponseType(typeof(int), 201)] - [ProducesResponseType(typeof(IDictionary), 400)] - public void CreateOrder() - { - - } - - [HttpPost] - [Consumes("application/json")] - [Produces("application/json")] - [ProducesResponseType(StatusCodes.Status204NoContent)] - [ProducesResponseType(typeof(SerializableError), StatusCodes.Status400BadRequest)] - [return: Description("My success response description.")] - public async Task AddPet([FromBody] Pet pet) - { - await Task.Delay(0); - return new EmptyResult(); - } - - [HttpPut] - [Consumes("application/json")] - [Produces("application/json")] - [ProducesResponseType(StatusCodes.Status204NoContent)] - [ProducesResponseType(typeof(SerializableError), StatusCodes.Status400BadRequest)] - public async Task EditPet([FromBody] Pet pet) - { - if (pet.Id == 0) - { - return NotFound(); - } - - await Task.Delay(0); - return new EmptyResult(); - } - - // 'status' is intended to be an optional query string parameter - // Sample with ActionResult auto-detection - [HttpGet("findByStatus")] - [Produces("application/json")] - public async Task>> FindByStatus(string[] status) - { - await Task.Delay(0); - return new ObjectResult(Array.Empty()); - } - - // Included this extra action not present in http://petstore.swagger.io/#/ - // to represent an action with a required query parameter. - [HttpGet("findByCategory")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(SerializableError), StatusCodes.Status400BadRequest)] - public async Task>> FindByCategory([BindRequired] string category) - { - await Task.Delay(0); - return new ObjectResult(Array.Empty()); - } - - [HttpGet("{petId}", Name = "FindPetById")] - [Produces("application/json")] - [ProducesResponseType(typeof(Pet), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(SerializableError), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] - public async Task> FindById(int petId) - { - if (!ModelState.IsValid) - { - return BadRequest(ModelState); - } - - await Task.Delay(0); - if (petId == 0) - { - return NotFound(); - } - - return Ok(new Pet()); - } - - [HttpPost("{petId}")] - [Consumes("application/www-form-url-encoded")] - [Produces("application/json")] - [ProducesResponseType(StatusCodes.Status204NoContent)] - [ProducesResponseType(typeof(SerializableError), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] - public async Task EditPet(int petId, [FromForm] Pet pet) - { - if (petId == 0) - { - return NotFound(); - } - - await Task.Delay(0); - return new EmptyResult(); - } - - [HttpDelete("{petId}")] - [Produces("application/json")] - [ProducesResponseType(StatusCodes.Status204NoContent)] - [ProducesResponseType(typeof(SerializableError), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] - public async Task DeletePet(int petId) - { - if (petId == 0) - { - return NotFound(); - } - - await Task.Delay(0); - return new EmptyResult(); - } - - [HttpPost("{petId}/uploadImage")] - [Consumes("multipart/form-data")] - [Produces("application/json")] - [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)] - [ProducesResponseType(typeof(SerializableError), StatusCodes.Status400BadRequest)] - [ProducesResponseType(StatusCodes.Status404NotFound)] - public async Task> UploadImage(int petId, IFormFile file) - { - if (petId == 0) - { - return NotFound(); - } - - await Task.Delay(0); - return Ok(new ApiResponse()); - } - - [HttpPost("file")] - public ActionResult GetFile() - { - return NoContent(); - } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore21/NSwag.Sample.NETCore21.csproj b/src/NSwag.Sample.NETCore21/NSwag.Sample.NETCore21.csproj deleted file mode 100644 index d958c42da8..0000000000 --- a/src/NSwag.Sample.NETCore21/NSwag.Sample.NETCore21.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - netcoreapp2.1 - true - - $(NoWarn),1591 - - - - - Models\%(RecursiveDir)\%(FileName)%(Extension) - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore21/Program.cs b/src/NSwag.Sample.NETCore21/Program.cs deleted file mode 100644 index bbe0a68db5..0000000000 --- a/src/NSwag.Sample.NETCore21/Program.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging; - -namespace NSwag.Sample.NETCore21 -{ - public class Program - { - public static void Main(string[] args) - { - CreateWebHostBuilder(args).Build().Run(); - } - - public static IWebHostBuilder CreateWebHostBuilder(string[] args) => - WebHost.CreateDefaultBuilder(args) - .UseStartup(); - } -} diff --git a/src/NSwag.Sample.NETCore21/Properties/launchSettings.json b/src/NSwag.Sample.NETCore21/Properties/launchSettings.json deleted file mode 100644 index 3c6ca53ffa..0000000000 --- a/src/NSwag.Sample.NETCore21/Properties/launchSettings.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:32367", - "sslPort": 44370 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_HTTPS_PORT": "44370", - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "NSwag.Sample.NETCore21": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_URLS": "https://localhost:5001;http://localhost:5000", - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore21/Startup.cs b/src/NSwag.Sample.NETCore21/Startup.cs deleted file mode 100644 index 7e5a05a06b..0000000000 --- a/src/NSwag.Sample.NETCore21/Startup.cs +++ /dev/null @@ -1,58 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; - -namespace NSwag.Sample.NETCore21 -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - public void ConfigureServices(IServiceCollection services) - { - services - .AddMvc(options => options.AllowEmptyInputInBodyModelBinding = false) - .SetCompatibilityVersion(CompatibilityVersion.Version_2_1); - - // Add NSwag OpenAPI/Swagger DI services and configure documents - // For more advanced setup, see NSwag.Sample.NETCore20 project - - services.AddOpenApiDocument(document => document.DocumentName = "a"); - services.AddSwaggerDocument(document => document.DocumentName = "b"); - } - - public void Configure(IApplicationBuilder app, IHostingEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - else - { - app.UseHsts(); - } - - app.UseHttpsRedirection(); - app.UseMvc(); - - // Add middlewares to service the OpenAPI/Swagger document and the web UI - - // URLs: - // - http://localhost:32367/swagger/a/swagger.json - // - http://localhost:32367/swagger/b/swagger.json - // - http://localhost:32367/swagger - -#pragma warning disable 618 - app.UseSwagger(); // registers the two documents in separate routes -#pragma warning restore 618 - app.UseSwaggerUi3(); // registers a single Swagger UI (v3) with the two documents - } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore21/appsettings.Development.json b/src/NSwag.Sample.NETCore21/appsettings.Development.json deleted file mode 100644 index 0623a3f445..0000000000 --- a/src/NSwag.Sample.NETCore21/appsettings.Development.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/src/NSwag.Sample.NETCore21/appsettings.json b/src/NSwag.Sample.NETCore21/appsettings.json deleted file mode 100644 index 09cf536c1e..0000000000 --- a/src/NSwag.Sample.NETCore21/appsettings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Warning" - } - } -} diff --git a/src/NSwag.Sample.NETCore21/nswag_assembly.nswag b/src/NSwag.Sample.NETCore21/nswag_assembly.nswag deleted file mode 100644 index 3e348e7642..0000000000 --- a/src/NSwag.Sample.NETCore21/nswag_assembly.nswag +++ /dev/null @@ -1,59 +0,0 @@ -{ - "runtime": "NetCore21", - "defaultVariables": null, - "documentGenerator": { - "aspNetCoreToOpenApi": { - "project": "", - "msBuildProjectExtensionsPath": null, - "configuration": null, - "runtime": null, - "targetFramework": null, - "noBuild": false, - "verbose": false, - "workingDirectory": null, - "requireParametersWithoutDefault": true, - "apiGroupNames": null, - "defaultPropertyNameHandling": "Default", - "defaultReferenceTypeNullHandling": "Null", - "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": "ljlkjlkj", - "infoDescription": null, - "infoVersion": "", - "documentTemplate": null, - "documentProcessorTypes": [], - "operationProcessorTypes": [], - "typeNameGeneratorType": null, - "schemaNameGeneratorType": null, - "contractResolverType": null, - "serializerSettingsType": null, - "useDocumentProvider": false, - "documentName": "v1", - "aspNetCoreEnvironment": null, - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": true, - "output": "swagger_assembly_cli.json", - "outputType": "Swagger2", - "assemblyPaths": [ - "bin/Debug/netcoreapp2.1/NSwag.Sample.NETCore21.dll" - ], - "assemblyConfig": null, - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": {} -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore21/nswag_project.nswag b/src/NSwag.Sample.NETCore21/nswag_project.nswag deleted file mode 100644 index cfd575a0e8..0000000000 --- a/src/NSwag.Sample.NETCore21/nswag_project.nswag +++ /dev/null @@ -1,57 +0,0 @@ -{ - "runtime": "NetCore21", - "defaultVariables": null, - "documentGenerator": { - "aspNetCoreToOpenApi": { - "project": "NSwag.Sample.NETCore21.csproj", - "msBuildProjectExtensionsPath": null, - "configuration": null, - "runtime": null, - "targetFramework": null, - "noBuild": true, - "verbose": false, - "workingDirectory": null, - "requireParametersWithoutDefault": true, - "apiGroupNames": null, - "defaultPropertyNameHandling": "Default", - "defaultReferenceTypeNullHandling": "Null", - "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, - "useDocumentProvider": false, - "documentName": "v1", - "aspNetCoreEnvironment": null, - "createWebHostBuilderMethod": null, - "startupType": null, - "allowNullableBodyParameters": false, - "output": "swagger_project_cli.json", - "outputType": "Swagger2", - "assemblyPaths": [], - "assemblyConfig": null, - "referencePaths": [], - "useNuGetCache": false - } - }, - "codeGenerators": {} -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore21/oldswagger.json b/src/NSwag.Sample.NETCore21/oldswagger.json deleted file mode 100644 index 456d392bb2..0000000000 --- a/src/NSwag.Sample.NETCore21/oldswagger.json +++ /dev/null @@ -1,376 +0,0 @@ -{ - "x-generator": "NSwag v11.15.4.0 (NJsonSchema v9.10.31.0 (Newtonsoft.Json v10.0.0.0))", - "swagger": "2.0", - "info": { - "title": "", - "version": "" - }, - "host": "localhost:5001", - "basePath": "", - "schemes": [ - "https" - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/pet": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_AddPet", - "parameters": [ - { - "name": "pet", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Pet" - }, - "x-nullable": true - } - ], - "responses": { - "400": { - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - }, - "x-nullable": true - } - } - }, - "put": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPet", - "parameters": [ - { - "name": "pet", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Pet" - }, - "x-nullable": true - } - ], - "responses": { - "400": { - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - }, - "x-nullable": true - } - } - } - }, - "/pet/findByStatus": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByStatus", - "parameters": [ - { - "type": "array", - "name": "status", - "in": "query", - "x-nullable": true, - "collectionFormat": "multi", - "items": { - "type": "string" - } - } - ], - "responses": { - "400": { - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - }, - "x-nullable": true - } - } - } - }, - "/pet/findByCategory": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByCategory", - "parameters": [ - { - "type": "string", - "name": "category", - "in": "query", - "required": true, - "x-nullable": true - } - ], - "responses": { - "400": { - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - }, - "x-nullable": true - } - } - } - }, - "/pet/{petId}": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindById", - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "x-nullable": false, - "format": "int32" - } - ], - "responses": { - "400": { - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - }, - "x-nullable": true - }, - "404": { - "description": "" - } - } - }, - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPet2", - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "x-nullable": false, - "format": "int32" - }, - { - "type": "object", - "name": "pet", - "in": "formData", - "x-schema": { - "$ref": "#/definitions/Pet" - }, - "x-nullable": true - } - ], - "responses": { - "400": { - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - }, - "x-nullable": true - }, - "404": { - "description": "" - } - } - }, - "delete": { - "tags": [ - "Pet" - ], - "operationId": "Pet_DeletePet", - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "x-nullable": false, - "format": "int32" - } - ], - "responses": { - "400": { - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - }, - "x-nullable": true - }, - "404": { - "description": "" - } - } - } - }, - "/pet/{petId}/uploadImage": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_UploadImage", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "x-nullable": false, - "format": "int32" - }, - { - "type": "file", - "name": "file", - "in": "formData", - "x-nullable": true - } - ], - "responses": { - "400": { - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - }, - "x-nullable": true - }, - "404": { - "description": "" - } - } - } - } - }, - "definitions": { - "Pet": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "age", - "hasVaccinations", - "name", - "status" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "age": { - "type": "integer", - "format": "int32", - "maximum": 150.0, - "minimum": 0.0 - }, - "category": { - "$ref": "#/definitions/Category" - }, - "hasVaccinations": { - "type": "boolean" - }, - "name": { - "type": "string", - "maxLength": 50, - "minLength": 2 - }, - "images": { - "type": "array", - "items": { - "$ref": "#/definitions/Image" - } - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/definitions/Tag" - } - }, - "status": { - "type": "string" - } - } - }, - "Category": { - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "Image": { - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "url": { - "type": "string" - } - } - }, - "Tag": { - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "SerializableError": { - "type": "object", - "additionalProperties": false, - "allOf": [ - { - "type": "object", - "additionalProperties": {} - } - ] - } - }, - "parameters": {}, - "responses": {}, - "securityDefinitions": {} -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore21/swagger.json b/src/NSwag.Sample.NETCore21/swagger.json deleted file mode 100644 index 663b26f9b5..0000000000 --- a/src/NSwag.Sample.NETCore21/swagger.json +++ /dev/null @@ -1,514 +0,0 @@ -{ - "x-generator": "NSwag v11.17.15.0 (NJsonSchema v9.10.53.0 (Newtonsoft.Json v10.0.0.0))", - "swagger": "2.0", - "info": { - "title": "My Title", - "version": "1.0.0" - }, - "host": "localhost:44370", - "schemes": [ - "https" - ], - "consumes": [ - "application/json", - "application/json-patch+json", - "text/json", - "application/*+json", - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "paths": { - "/pet": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_AddPet", - "consumes": [ - "application/json" - ], - "parameters": [ - { - "name": "pet", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Pet" - }, - "x-nullable": true - } - ], - "responses": { - "204": { - "description": "" - }, - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - }, - "put": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPet", - "consumes": [ - "application/json" - ], - "parameters": [ - { - "name": "pet", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Pet" - }, - "x-nullable": true - } - ], - "responses": { - "204": { - "description": "" - }, - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - } - }, - "/pet/findByStatus": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByStatus", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "parameters": [ - { - "name": "status", - "in": "body", - "required": true, - "schema": { - "type": "array", - "items": { - "type": "string" - } - }, - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - } - } - } - }, - "/pet/findByCategory": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByCategory", - "parameters": [ - { - "type": "string", - "name": "category", - "in": "query", - "required": true, - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - }, - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - } - }, - "/pet/{petId}": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindById", - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/Pet" - } - }, - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - }, - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPet2", - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "integer", - "name": "Id", - "in": "formData", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "integer", - "name": "Age", - "in": "formData", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "integer", - "name": "Category.Id", - "in": "formData", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "string", - "name": "Category.Name", - "in": "formData", - "required": true, - "x-nullable": true - }, - { - "type": "boolean", - "name": "HasVaccinations", - "in": "formData", - "required": true, - "x-nullable": false - }, - { - "type": "string", - "name": "Name", - "in": "formData", - "required": true, - "x-nullable": true - }, - { - "type": "array", - "name": "Images", - "in": "formData", - "required": true, - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "$ref": "#/definitions/Image" - } - }, - { - "type": "array", - "name": "Tags", - "in": "formData", - "required": true, - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "$ref": "#/definitions/Tag" - } - }, - { - "type": "string", - "name": "Status", - "in": "formData", - "required": true, - "x-nullable": true - } - ], - "responses": { - "204": { - "description": "" - }, - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - }, - "delete": { - "tags": [ - "Pet" - ], - "operationId": "Pet_DeletePet", - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "204": { - "description": "" - }, - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - } - }, - "/pet/{petId}/uploadImage": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_UploadImage", - "consumes": [ - "multipart/form-data" - ], - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "file", - "name": "file", - "in": "formData", - "required": true, - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/ApiResponse" - } - }, - "400": { - "x-nullable": true, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - } - } - }, - "definitions": { - "Pet": { - "type": "object", - "additionalProperties": false, - "required": [ - "id", - "age", - "hasVaccinations", - "name", - "status" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "age": { - "type": "integer", - "format": "int32", - "maximum": 150.0, - "minimum": 0.0 - }, - "category": { - "$ref": "#/definitions/Category" - }, - "hasVaccinations": { - "type": "boolean" - }, - "name": { - "type": "string", - "maxLength": 50, - "minLength": 2 - }, - "images": { - "type": "array", - "items": { - "$ref": "#/definitions/Image" - } - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/definitions/Tag" - } - }, - "status": { - "type": "string" - } - } - }, - "Category": { - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "Image": { - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "url": { - "type": "string" - } - } - }, - "Tag": { - "type": "object", - "additionalProperties": false, - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "SerializableError": { - "type": "object", - "additionalProperties": false, - "allOf": [ - { - "type": "object", - "additionalProperties": {} - } - ] - }, - "ApiResponse": { - "type": "object", - "additionalProperties": false, - "required": [ - "code" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore21/swagger_assembly_cli.json b/src/NSwag.Sample.NETCore21/swagger_assembly_cli.json deleted file mode 100644 index d118dea644..0000000000 --- a/src/NSwag.Sample.NETCore21/swagger_assembly_cli.json +++ /dev/null @@ -1,563 +0,0 @@ -{ - "x-generator": "NSwag v13.15.5.0 (NJsonSchema v10.6.6.0 (Newtonsoft.Json v11.0.0.0))", - "swagger": "2.0", - "info": { - "title": "ljlkjlkj", - "version": "1.0.0" - }, - "paths": { - "/pet/createOrder": { - "post": { - "tags": [ - "Pet" - ], - "summary": "Creates an order", - "operationId": "Pet_CreateOrder", - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "responses": { - "201": { - "x-nullable": false, - "description": "Order created", - "schema": { - "type": "integer", - "format": "int32" - } - }, - "400": { - "x-nullable": false, - "description": "Order invalid", - "schema": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - } - }, - "/pet": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_AddPet", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "pet", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Pet" - }, - "x-nullable": false - } - ], - "responses": { - "204": { - "description": "My success response description." - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - }, - "put": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPetPUT", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "pet", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Pet" - }, - "x-nullable": false - } - ], - "responses": { - "204": { - "description": "" - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - } - }, - "/pet/findByStatus": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByStatus", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "array", - "name": "status", - "in": "query", - "required": true, - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "type": "string" - } - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - } - } - } - }, - "/pet/findByCategory": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByCategory", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "string", - "name": "category", - "in": "query", - "required": true, - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - } - }, - "/pet/{petId}": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindById", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/Pet" - } - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - }, - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPetPOST", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "integer", - "name": "Id", - "in": "formData", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "integer", - "name": "Age", - "in": "formData", - "required": true, - "format": "int32", - "maximum": 150.0, - "minimum": 0.0, - "x-nullable": false - }, - { - "type": "integer", - "name": "Category.Id", - "in": "formData", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "string", - "name": "Category.Name", - "in": "formData", - "required": true, - "x-nullable": true - }, - { - "type": "boolean", - "name": "HasVaccinations", - "in": "formData", - "required": true, - "x-nullable": false - }, - { - "type": "string", - "name": "Name", - "in": "formData", - "required": true, - "maxLength": 50, - "minLength": 2, - "x-nullable": true - }, - { - "type": "array", - "name": "Images", - "in": "formData", - "required": true, - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "$ref": "#/definitions/Image" - } - }, - { - "type": "array", - "name": "Tags", - "in": "formData", - "required": true, - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "$ref": "#/definitions/Tag" - } - }, - { - "type": "string", - "name": "Status", - "in": "formData", - "required": true, - "x-nullable": true - } - ], - "responses": { - "204": { - "description": "" - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - }, - "delete": { - "tags": [ - "Pet" - ], - "operationId": "Pet_DeletePet", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "204": { - "description": "" - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - } - }, - "/pet/{petId}/uploadImage": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_UploadImage", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "file", - "name": "file", - "in": "formData", - "required": true, - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/ApiResponse" - } - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - } - }, - "/pet/file": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_GetFile", - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "file" - } - } - } - } - } - }, - "definitions": { - "SerializableError": { - "type": "object", - "description": "Defines a serializable container for storing ModelState information.\nThis information is stored as key/value pairs.", - "additionalProperties": {} - }, - "Pet": { - "type": "object", - "required": [ - "id", - "age", - "hasVaccinations", - "name", - "status" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "age": { - "type": "integer", - "format": "int32", - "maximum": 150.0, - "minimum": 0.0 - }, - "category": { - "$ref": "#/definitions/Category" - }, - "hasVaccinations": { - "type": "boolean" - }, - "name": { - "type": "string", - "maxLength": 50, - "minLength": 2 - }, - "images": { - "type": "array", - "items": { - "$ref": "#/definitions/Image" - } - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/definitions/Tag" - } - }, - "status": { - "type": "string", - "minLength": 1 - } - } - }, - "Category": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "Image": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "url": { - "type": "string" - } - } - }, - "Tag": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "ApiResponse": { - "type": "object", - "required": [ - "code" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore21/swagger_project_cli.json b/src/NSwag.Sample.NETCore21/swagger_project_cli.json deleted file mode 100644 index 0b1425bbfa..0000000000 --- a/src/NSwag.Sample.NETCore21/swagger_project_cli.json +++ /dev/null @@ -1,562 +0,0 @@ -{ - "x-generator": "NSwag v13.15.4.0 (NJsonSchema v10.6.5.0 (Newtonsoft.Json v11.0.0.0))", - "swagger": "2.0", - "info": { - "title": "My Title", - "version": "1.0.0" - }, - "paths": { - "/pet/createOrder": { - "post": { - "tags": [ - "Pet" - ], - "summary": "Creates an order", - "operationId": "Pet_CreateOrder", - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "responses": { - "201": { - "x-nullable": false, - "description": "Order created", - "schema": { - "type": "integer", - "format": "int32" - } - }, - "400": { - "x-nullable": false, - "description": "Order invalid", - "schema": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - } - } - }, - "/pet": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_AddPet", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "pet", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Pet" - }, - "x-nullable": false - } - ], - "responses": { - "204": { - "description": "My success response description." - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - }, - "put": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPetPUT", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "name": "pet", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Pet" - }, - "x-nullable": false - } - ], - "responses": { - "204": { - "description": "" - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - } - }, - "/pet/findByStatus": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByStatus", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "array", - "name": "status", - "in": "query", - "required": true, - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "type": "string" - } - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - } - } - } - }, - "/pet/findByCategory": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindByCategory", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "string", - "name": "category", - "in": "query", - "required": true, - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/Pet" - } - } - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - } - } - } - }, - "/pet/{petId}": { - "get": { - "tags": [ - "Pet" - ], - "operationId": "Pet_FindById", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/Pet" - } - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - }, - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_EditPetPOST", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "integer", - "name": "Id", - "in": "formData", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "integer", - "name": "Age", - "in": "formData", - "required": true, - "format": "int32", - "maximum": 150.0, - "minimum": 0.0, - "x-nullable": false - }, - { - "type": "integer", - "name": "Category.Id", - "in": "formData", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "string", - "name": "Category.Name", - "in": "formData", - "required": true, - "x-nullable": true - }, - { - "type": "boolean", - "name": "HasVaccinations", - "in": "formData", - "required": true, - "x-nullable": false - }, - { - "type": "string", - "name": "Name", - "in": "formData", - "required": true, - "maxLength": 50, - "minLength": 2, - "x-nullable": true - }, - { - "type": "array", - "name": "Images", - "in": "formData", - "required": true, - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "$ref": "#/definitions/Image" - } - }, - { - "type": "array", - "name": "Tags", - "in": "formData", - "required": true, - "collectionFormat": "multi", - "x-nullable": true, - "items": { - "$ref": "#/definitions/Tag" - } - }, - { - "type": "string", - "name": "Status", - "in": "formData", - "required": true, - "x-nullable": true - } - ], - "responses": { - "204": { - "description": "" - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - }, - "delete": { - "tags": [ - "Pet" - ], - "operationId": "Pet_DeletePet", - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - } - ], - "responses": { - "204": { - "description": "" - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - } - }, - "/pet/{petId}/uploadImage": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_UploadImage", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "parameters": [ - { - "type": "integer", - "name": "petId", - "in": "path", - "required": true, - "format": "int32", - "x-nullable": false - }, - { - "type": "file", - "name": "file", - "in": "formData", - "required": true, - "x-nullable": true - } - ], - "responses": { - "200": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/ApiResponse" - } - }, - "400": { - "x-nullable": false, - "description": "", - "schema": { - "$ref": "#/definitions/SerializableError" - } - }, - "404": { - "description": "" - } - } - } - }, - "/pet/file": { - "post": { - "tags": [ - "Pet" - ], - "operationId": "Pet_GetFile", - "responses": { - "200": { - "x-nullable": true, - "description": "", - "schema": { - "type": "file" - } - } - } - } - } - }, - "definitions": { - "SerializableError": { - "type": "object", - "additionalProperties": {} - }, - "Pet": { - "type": "object", - "required": [ - "id", - "age", - "hasVaccinations", - "name", - "status" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "age": { - "type": "integer", - "format": "int32", - "maximum": 150.0, - "minimum": 0.0 - }, - "category": { - "$ref": "#/definitions/Category" - }, - "hasVaccinations": { - "type": "boolean" - }, - "name": { - "type": "string", - "maxLength": 50, - "minLength": 2 - }, - "images": { - "type": "array", - "items": { - "$ref": "#/definitions/Image" - } - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/definitions/Tag" - } - }, - "status": { - "type": "string", - "minLength": 1 - } - } - }, - "Category": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "Image": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "url": { - "type": "string" - } - } - }, - "Tag": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32" - }, - "name": { - "type": "string" - } - } - }, - "ApiResponse": { - "type": "object", - "required": [ - "code" - ], - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCore31/Properties/launchSettings.json b/src/NSwag.Sample.NETCore31/Properties/launchSettings.json index 51a0293a3c..fdbcc46071 100644 --- a/src/NSwag.Sample.NETCore31/Properties/launchSettings.json +++ b/src/NSwag.Sample.NETCore31/Properties/launchSettings.json @@ -1,26 +1,10 @@ { - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:51340", - "sslPort": 44379 - } - }, "$schema": "http://json.schemastore.org/launchsettings.json", "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, "NSwag.Sample.NETCore31": { "commandName": "Project", "launchBrowser": true, - "launchUrl": "apimundo", + "launchUrl": "swagger", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" }, diff --git a/src/NSwag.Sample.NETCore31/Startup.cs b/src/NSwag.Sample.NETCore31/Startup.cs index db396e7764..7c5cfbde1d 100644 --- a/src/NSwag.Sample.NETCore31/Startup.cs +++ b/src/NSwag.Sample.NETCore31/Startup.cs @@ -28,7 +28,7 @@ public void ConfigureServices(IServiceCollection services) services.AddOpenApiDocument(document => { document.Description = "Hello world!"; - document.DefaultReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull; + document.SchemaSettings.DefaultReferenceTypeNullHandling = ReferenceTypeNullHandling.NotNull; }); } diff --git a/src/NSwag.Sample.NETCoreShared/Controllers/PetController.cs b/src/NSwag.Sample.NETCoreShared/Controllers/PetController.cs deleted file mode 100644 index 9966cbe3e0..0000000000 --- a/src/NSwag.Sample.NETCoreShared/Controllers/PetController.cs +++ /dev/null @@ -1,201 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Net; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using NJsonSchema.Annotations; - -namespace NSwag.Sample -{ - // This sample is similar to http://petstore.swagger.io/#/ - [Route("/pet")] - public class PetController : ControllerBase - { - [HttpPost] - [Consumes("application/json")] - [Produces("application/json")] - [ProducesResponseType(typeof(SerializableError), (int)HttpStatusCode.BadRequest)] - public async Task AddPet([FromBody] Pet pet) - { - if (!ModelState.IsValid) - { - return BadRequest(ModelState); - } - - await Task.Delay(0); - return new EmptyResult(); - } - - [HttpPut] - [Consumes("application/json")] - [Produces("application/json")] - [ProducesResponseType(typeof(SerializableError), (int)HttpStatusCode.BadRequest)] - public async Task EditPet([FromBody] Pet pet) - { - if (!ModelState.IsValid) - { - return BadRequest(ModelState); - } - - if (pet.Id == 0) - { - return NotFound(); - } - - await Task.Delay(0); - return new EmptyResult(); - } - - // 'status' is intended to be an optional query string parameter - [HttpGet("findByStatus")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)] - [ProducesResponseType(typeof(SerializableError), (int)HttpStatusCode.BadRequest)] - public async Task FindByStatus([FromQuery] string[] status) - { - if (!ModelState.IsValid) - { - return BadRequest(ModelState); - } - - await Task.Delay(0); - return new ObjectResult(Array.Empty()); - } - - // 'status' is intended to be an optional query string parameter - [HttpGet("findByStatus/{skip}/{sortOrder}")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)] - [ProducesResponseType(typeof(SerializableError), (int)HttpStatusCode.BadRequest)] - public async Task FindByStatus([FromQuery] string[] status, int skip, int sortOrder) - { - if (!ModelState.IsValid) - { - return BadRequest(ModelState); - } - - await Task.Delay(0); - return new ObjectResult(Array.Empty()); - } - - // Included this extra action not present in http://petstore.swagger.io/#/ - // to represent an action with a required query parameter. - [HttpGet("findByCategory")] - [Produces("application/json")] - [ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)] - [ProducesResponseType(typeof(SerializableError), (int)HttpStatusCode.BadRequest)] - public async Task FindByCategory([FromQuery] string category) - { - if (!ModelState.IsValid) - { - return BadRequest(ModelState); - } - - await Task.Delay(0); - return new ObjectResult(Array.Empty()); - } - - - [HttpGet("{petId}", Name = "FindPetById")] - [Produces("application/json")] - [ProducesResponseType(typeof(Pet), (int)HttpStatusCode.OK)] - [ProducesResponseType(typeof(SerializableError), (int)HttpStatusCode.BadRequest)] - [ProducesResponseType((int)HttpStatusCode.NotFound)] - public async Task FindById(int petId) - { - if (!ModelState.IsValid) - { - return BadRequest(ModelState); - } - - await Task.Delay(0); - if (petId == 0) - { - return NotFound(); - } - - return Ok(new Pet()); - } - - [HttpPost("{petId}")] - [Consumes("application/www-form-url-encoded")] - [Produces("application/json")] - [ProducesResponseType(typeof(SerializableError), (int)HttpStatusCode.BadRequest)] - [ProducesResponseType((int)HttpStatusCode.NotFound)] - public async Task EditPetWithFormData(int petId, [FromForm] Pet pet) - { - if (!ModelState.IsValid) - { - return BadRequest(ModelState); - } - - if (petId == 0) - { - return NotFound(); - } - - await Task.Delay(0); - return new EmptyResult(); - } - - [HttpDelete("{petId}")] - [Produces("application/json")] - [ProducesResponseType(typeof(SerializableError), (int)HttpStatusCode.BadRequest)] - [ProducesResponseType((int)HttpStatusCode.NotFound)] - public async Task DeletePet(int petId) - { - if (!ModelState.IsValid) - { - return BadRequest(ModelState); - } - - if (petId == 0) - { - return NotFound(); - } - - await Task.Delay(0); - return new EmptyResult(); - } - - - [HttpPost("{petId}/uploadImage")] - [Consumes("multipart/form-data")] - [Produces("application/json")] - [ProducesResponseType(typeof(ApiResponse), (int)HttpStatusCode.OK)] - [ProducesResponseType(typeof(SerializableError), (int)HttpStatusCode.BadRequest)] - [ProducesResponseType((int)HttpStatusCode.NotFound)] - public async Task UploadImage(int petId, IFormFile file) - { - if (!ModelState.IsValid) - { - return BadRequest(ModelState); - } - - if (petId == 0) - { - return NotFound(); - } - - await Task.Delay(0); - return Ok(new ApiResponse()); - } - - [HttpPost("RequiredAndOptional")] - public void RequiredAndOptional( - int int_RequiredAndNotNullable, - int? int_RequiredAndNullable, - string string_RequiredAndNullable, - [NotNull]string string_RequiredAndNotNullable, - - decimal decimalWithDefault_NotRequiredAndNotNullable = 1, - decimal? decimalWithDefault_NotRequiredAndNullable = 1, - string stringWithDefault_NotRequiredAndNullable = "foo", - [NotNull]string stringWithDefault_NotRequiredAndNotNullable = "foo") - { - - } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCoreShared/Models/ApiResponse.cs b/src/NSwag.Sample.NETCoreShared/Models/ApiResponse.cs deleted file mode 100644 index db15e5dc15..0000000000 --- a/src/NSwag.Sample.NETCoreShared/Models/ApiResponse.cs +++ /dev/null @@ -1,12 +0,0 @@ - -namespace NSwag.Sample -{ - public class ApiResponse - { - public int Code { get; set; } - - public string Message { get; set; } - - public string Type { get; set; } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCoreShared/Models/Category.cs b/src/NSwag.Sample.NETCoreShared/Models/Category.cs deleted file mode 100644 index 1d1db5fb46..0000000000 --- a/src/NSwag.Sample.NETCoreShared/Models/Category.cs +++ /dev/null @@ -1,10 +0,0 @@ - -namespace NSwag.Sample -{ - public class Category - { - public int Id { get; set; } - - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCoreShared/Models/Image.cs b/src/NSwag.Sample.NETCoreShared/Models/Image.cs deleted file mode 100644 index 2d91754a7e..0000000000 --- a/src/NSwag.Sample.NETCoreShared/Models/Image.cs +++ /dev/null @@ -1,10 +0,0 @@ - -namespace NSwag.Sample -{ - public class Image - { - public int Id { get; set; } - - public string Url { get; set; } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCoreShared/Models/Pet.cs b/src/NSwag.Sample.NETCoreShared/Models/Pet.cs deleted file mode 100644 index 39560a4fee..0000000000 --- a/src/NSwag.Sample.NETCoreShared/Models/Pet.cs +++ /dev/null @@ -1,29 +0,0 @@ - -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; - -namespace NSwag.Sample -{ - public class Pet - { - public int Id { get; set; } - - [Range(0, 150)] - public int Age { get; set; } - - public Category Category { get; set; } - - public bool HasVaccinations { get; set; } - - [Required] - [StringLength(50, MinimumLength = 2)] - public string Name { get; set; } - - public List Images { get; set; } - - public List Tags { get; set; } - - [Required] - public string Status { get; set; } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NETCoreShared/Models/Tag.cs b/src/NSwag.Sample.NETCoreShared/Models/Tag.cs deleted file mode 100644 index 7ff04bbfa1..0000000000 --- a/src/NSwag.Sample.NETCoreShared/Models/Tag.cs +++ /dev/null @@ -1,10 +0,0 @@ - -namespace NSwag.Sample -{ - public class Tag - { - public int Id { get; set; } - - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/src/NSwag.Sample.NetCoreAngular.Clients/Clients.cs b/src/NSwag.Sample.NetCoreAngular.Clients/Clients.cs deleted file mode 100644 index 3e491676f2..0000000000 --- a/src/NSwag.Sample.NetCoreAngular.Clients/Clients.cs +++ /dev/null @@ -1,764 +0,0 @@ -//---------------------- -// -// Generated using the NSwag toolchain v11.13.3.0 (NJsonSchema v9.10.22.0 (Newtonsoft.Json v9.0.0.0)) (http://NSwag.org) -// -//---------------------- - -using NSwag.Sample.NetCoreAngular.Clients.Contracts; - -namespace NSwag.Sample.NetCoreAngular.Clients -{ - #pragma warning disable // Disable all warnings - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.13.3.0 (NJsonSchema v9.10.22.0 (Newtonsoft.Json v9.0.0.0))")] - public partial class DateClient : IDateClient - { - private string _baseUrl = ""; - private System.Lazy _settings; - - public DateClient(string baseUrl) - { - BaseUrl = baseUrl; - _settings = new System.Lazy(() => - { - var settings = new Newtonsoft.Json.JsonSerializerSettings { PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.All }; - UpdateJsonSerializerSettings(settings); - return settings; - }); - } - - public string BaseUrl - { - get { return _baseUrl; } - set { _baseUrl = value; } - } - - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - - /// A server side error occurred. - public System.Threading.Tasks.Task AddDaysAsync(System.DateTime date, int days) - { - return AddDaysAsync(date, days, System.Threading.CancellationToken.None); - } - - /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - public async System.Threading.Tasks.Task AddDaysAsync(System.DateTime date, int days, System.Threading.CancellationToken cancellationToken) - { - if (date == null) - throw new System.ArgumentNullException("date"); - - if (days == null) - throw new System.ArgumentNullException("days"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Date/AddDays?"); - urlBuilder_.Append("date=").Append(System.Uri.EscapeDataString(date.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append("days=").Append(System.Uri.EscapeDataString(ConvertToString(days, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.DateTime); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception_) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception_); - } - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.DateTime); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task GetDayOfYearAsync(System.DateTime date) - { - return GetDayOfYearAsync(date, System.Threading.CancellationToken.None); - } - - /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - public async System.Threading.Tasks.Task GetDayOfYearAsync(System.DateTime date, System.Threading.CancellationToken cancellationToken) - { - if (date == null) - throw new System.ArgumentNullException("date"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Date/GetDayOfYear?"); - urlBuilder_.Append("date=").Append(System.Uri.EscapeDataString(date.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(int); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception_) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception_); - } - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(int); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value is System.Enum) - { - string name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value; - } - } - } - } - else if (value.GetType().IsArray) - { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); - } - - return System.Convert.ToString(value, cultureInfo); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.13.3.0 (NJsonSchema v9.10.22.0 (Newtonsoft.Json v9.0.0.0))")] - public partial class EnumerationClient : IEnumerationClient - { - private string _baseUrl = ""; - private System.Lazy _settings; - - public EnumerationClient(string baseUrl) - { - BaseUrl = baseUrl; - _settings = new System.Lazy(() => - { - var settings = new Newtonsoft.Json.JsonSerializerSettings { PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.All }; - UpdateJsonSerializerSettings(settings); - return settings; - }); - } - - public string BaseUrl - { - get { return _baseUrl; } - set { _baseUrl = value; } - } - - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - - /// A server side error occurred. - public System.Threading.Tasks.Task> ReverseQueryEnumListAsync(System.Collections.Generic.IEnumerable fileTypes) - { - return ReverseQueryEnumListAsync(fileTypes, System.Threading.CancellationToken.None); - } - - /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - public async System.Threading.Tasks.Task> ReverseQueryEnumListAsync(System.Collections.Generic.IEnumerable fileTypes, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Enumeration/ReverseQueryEnumList?"); - if (fileTypes != null) foreach (var item_ in fileTypes) { urlBuilder_.Append("fileTypes=").Append(System.Uri.EscapeDataString(ConvertToString(item_, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); } - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception_) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception_); - } - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value is System.Enum) - { - string name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value; - } - } - } - } - else if (value.GetType().IsArray) - { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); - } - - return System.Convert.ToString(value, cultureInfo); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.13.3.0 (NJsonSchema v9.10.22.0 (Newtonsoft.Json v9.0.0.0))")] - public partial class FileClient : IFileClient - { - private string _baseUrl = ""; - private System.Lazy _settings; - - public FileClient(string baseUrl) - { - BaseUrl = baseUrl; - _settings = new System.Lazy(() => - { - var settings = new Newtonsoft.Json.JsonSerializerSettings { PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.All }; - UpdateJsonSerializerSettings(settings); - return settings; - }); - } - - public string BaseUrl - { - get { return _baseUrl; } - set { _baseUrl = value; } - } - - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - - /// A server side error occurred. - public System.Threading.Tasks.Task GetFileAsync(string fileName) - { - return GetFileAsync(fileName, System.Threading.CancellationToken.None); - } - - /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - public async System.Threading.Tasks.Task GetFileAsync(string fileName, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/File/GetFile?"); - urlBuilder_.Append("fileName=").Append(System.Uri.EscapeDataString(fileName != null ? ConvertToString(fileName, System.Globalization.CultureInfo.InvariantCulture) : "")).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200" || status_ == "206") - { - var responseStream_ = await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); - var fileResponse_ = new FileResponse(status_, headers_, responseStream_, client_, response_); - client_ = null; response_ = null; // response and client are disposed by FileResponse - return fileResponse_; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(FileResponse); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value is System.Enum) - { - string name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value; - } - } - } - } - else if (value.GetType().IsArray) - { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); - } - - return System.Convert.ToString(value, cultureInfo); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.13.3.0 (NJsonSchema v9.10.22.0 (Newtonsoft.Json v9.0.0.0))")] - public partial class SampleDataClient : ISampleDataClient - { - private string _baseUrl = ""; - private System.Lazy _settings; - - public SampleDataClient(string baseUrl) - { - BaseUrl = baseUrl; - _settings = new System.Lazy(() => - { - var settings = new Newtonsoft.Json.JsonSerializerSettings { PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.All }; - UpdateJsonSerializerSettings(settings); - return settings; - }); - } - - public string BaseUrl - { - get { return _baseUrl; } - set { _baseUrl = value; } - } - - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - - /// A server side error occurred. - public System.Threading.Tasks.Task> WeatherForecastsAsync() - { - return WeatherForecastsAsync(System.Threading.CancellationToken.None); - } - - /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - public async System.Threading.Tasks.Task> WeatherForecastsAsync(System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/SampleData/WeatherForecasts"); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception_) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception_); - } - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task DeleteShopAsync(System.Guid id, System.Collections.Generic.IEnumerable additionalIds) - { - return DeleteShopAsync(id, additionalIds, System.Threading.CancellationToken.None); - } - - /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - public async System.Threading.Tasks.Task DeleteShopAsync(System.Guid id, System.Collections.Generic.IEnumerable additionalIds, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/SampleData?"); - urlBuilder_.Append("id=").Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - if (additionalIds != null) - request_.Headers.TryAddWithoutValidation("additionalIds", additionalIds); - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - return; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task> GetRolesAsync(System.DateTime? from, System.DateTime? to) - { - return GetRolesAsync(from, to, System.Threading.CancellationToken.None); - } - - /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - public async System.Threading.Tasks.Task> GetRolesAsync(System.DateTime? from, System.DateTime? to, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/SampleData/GetRoles?"); - urlBuilder_.Append("from=").Append(System.Uri.EscapeDataString(from != null ? from.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture) : "")).Append("&"); - if (to != null) urlBuilder_.Append("to=").Append(System.Uri.EscapeDataString(to.Value.ToString("s", System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception_) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception_); - } - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value is System.Enum) - { - string name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value; - } - } - } - } - else if (value.GetType().IsArray) - { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); - } - - return System.Convert.ToString(value, cultureInfo); - } - } - - - -} \ No newline at end of file diff --git a/src/NSwag.Sample.NetCoreAngular.Clients/Contracts.cs b/src/NSwag.Sample.NetCoreAngular.Clients/Contracts.cs deleted file mode 100644 index 165660a0c8..0000000000 --- a/src/NSwag.Sample.NetCoreAngular.Clients/Contracts.cs +++ /dev/null @@ -1,344 +0,0 @@ -//---------------------- -// -// Generated using the NSwag toolchain v11.13.3.0 (NJsonSchema v9.10.22.0 (Newtonsoft.Json v9.0.0.0)) (http://NSwag.org) -// -//---------------------- - -namespace NSwag.Sample.NetCoreAngular.Clients.Contracts -{ - #pragma warning disable // Disable all warnings - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.13.3.0 (NJsonSchema v9.10.22.0 (Newtonsoft.Json v9.0.0.0))")] - public partial interface IDateClient - { - /// A server side error occurred. - System.Threading.Tasks.Task AddDaysAsync(System.DateTime date, int days); - - /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - System.Threading.Tasks.Task AddDaysAsync(System.DateTime date, int days, System.Threading.CancellationToken cancellationToken); - - /// A server side error occurred. - System.Threading.Tasks.Task GetDayOfYearAsync(System.DateTime date); - - /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - System.Threading.Tasks.Task GetDayOfYearAsync(System.DateTime date, System.Threading.CancellationToken cancellationToken); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.13.3.0 (NJsonSchema v9.10.22.0 (Newtonsoft.Json v9.0.0.0))")] - public partial interface IEnumerationClient - { - /// A server side error occurred. - System.Threading.Tasks.Task> ReverseQueryEnumListAsync(System.Collections.Generic.IEnumerable fileTypes); - - /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - System.Threading.Tasks.Task> ReverseQueryEnumListAsync(System.Collections.Generic.IEnumerable fileTypes, System.Threading.CancellationToken cancellationToken); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.13.3.0 (NJsonSchema v9.10.22.0 (Newtonsoft.Json v9.0.0.0))")] - public partial interface IFileClient - { - /// A server side error occurred. - System.Threading.Tasks.Task GetFileAsync(string fileName); - - /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - System.Threading.Tasks.Task GetFileAsync(string fileName, System.Threading.CancellationToken cancellationToken); - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.13.3.0 (NJsonSchema v9.10.22.0 (Newtonsoft.Json v9.0.0.0))")] - public partial interface ISampleDataClient - { - /// A server side error occurred. - System.Threading.Tasks.Task> WeatherForecastsAsync(); - - /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - System.Threading.Tasks.Task> WeatherForecastsAsync(System.Threading.CancellationToken cancellationToken); - - /// A server side error occurred. - System.Threading.Tasks.Task DeleteShopAsync(System.Guid id, System.Collections.Generic.IEnumerable additionalIds); - - /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - System.Threading.Tasks.Task DeleteShopAsync(System.Guid id, System.Collections.Generic.IEnumerable additionalIds, System.Threading.CancellationToken cancellationToken); - - /// A server side error occurred. - System.Threading.Tasks.Task> GetRolesAsync(System.DateTime? from, System.DateTime? to); - - /// A server side error occurred. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - System.Threading.Tasks.Task> GetRolesAsync(System.DateTime? from, System.DateTime? to, System.Threading.CancellationToken cancellationToken); - - } - - - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.22.0 (Newtonsoft.Json v9.0.0.0)")] - public enum FileType - { - [System.Runtime.Serialization.EnumMember(Value = "Document")] - Document = 0, - - [System.Runtime.Serialization.EnumMember(Value = "Audio")] - Audio = 1, - - [System.Runtime.Serialization.EnumMember(Value = "Video")] - Video = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.22.0 (Newtonsoft.Json v9.0.0.0)")] - public partial class WeatherForecast : System.ComponentModel.INotifyPropertyChanged - { - private Station _station; - private string _dateFormatted; - private int _temperatureC; - private string _summary; - private int _temperatureF; - - [Newtonsoft.Json.JsonProperty("station", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Station Station - { - get { return _station; } - set - { - if (_station != value) - { - _station = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("dateFormatted", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string DateFormatted - { - get { return _dateFormatted; } - set - { - if (_dateFormatted != value) - { - _dateFormatted = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("temperatureC", Required = Newtonsoft.Json.Required.Always)] - public int TemperatureC - { - get { return _temperatureC; } - set - { - if (_temperatureC != value) - { - _temperatureC = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("summary", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Summary - { - get { return _summary; } - set - { - if (_summary != value) - { - _summary = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("temperatureF", Required = Newtonsoft.Json.Required.Always)] - public int TemperatureF - { - get { return _temperatureF; } - set - { - if (_temperatureF != value) - { - _temperatureF = value; - RaisePropertyChanged(); - } - } - } - - public string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, new Newtonsoft.Json.JsonSerializerSettings { PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.All }); - } - - public static WeatherForecast FromJson(string data) - { - return Newtonsoft.Json.JsonConvert.DeserializeObject(data, new Newtonsoft.Json.JsonSerializerSettings { PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.All }); - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.22.0 (Newtonsoft.Json v9.0.0.0)")] - public partial class Station : System.ComponentModel.INotifyPropertyChanged - { - private string _name; - private ExtensionData _data; - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Name - { - get { return _name; } - set - { - if (_name != value) - { - _name = value; - RaisePropertyChanged(); - } - } - } - - [Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public ExtensionData Data - { - get { return _data; } - set - { - if (_data != value) - { - _data = value; - RaisePropertyChanged(); - } - } - } - - public string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, new Newtonsoft.Json.JsonSerializerSettings { PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.All }); - } - - public static Station FromJson(string data) - { - return Newtonsoft.Json.JsonConvert.DeserializeObject(data, new Newtonsoft.Json.JsonSerializerSettings { PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.All }); - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.10.22.0 (Newtonsoft.Json v9.0.0.0)")] - public partial class ExtensionData : System.Collections.Generic.Dictionary, System.ComponentModel.INotifyPropertyChanged - { - - public string ToJson() - { - return Newtonsoft.Json.JsonConvert.SerializeObject(this, new Newtonsoft.Json.JsonSerializerSettings { PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.All }); - } - - public static ExtensionData FromJson(string data) - { - return Newtonsoft.Json.JsonConvert.DeserializeObject(data, new Newtonsoft.Json.JsonSerializerSettings { PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.All }); - } - - public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; - - protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) - { - var handler = PropertyChanged; - if (handler != null) - handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); - } - } - - public partial class FileResponse : System.IDisposable - { - private System.IDisposable _client; - private System.IDisposable _response; - - public string StatusCode { get; private set; } - - public System.Collections.Generic.Dictionary> Headers { get; private set; } - - public System.IO.Stream Stream { get; private set; } - - public bool IsPartial - { - get { return StatusCode == "206"; } - } - - public FileResponse(string statusCode, System.Collections.Generic.Dictionary> headers, System.IO.Stream stream, System.IDisposable client, System.IDisposable response) - { - StatusCode = statusCode; - Headers = headers; - Stream = stream; - _client = client; - _response = response; - } - - public void Dispose() - { - if (Stream != null) - Stream.Dispose(); - if (_response != null) - _response.Dispose(); - if (_client != null) - _client.Dispose(); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.13.3.0 (NJsonSchema v9.10.22.0 (Newtonsoft.Json v9.0.0.0))")] - public partial class SwaggerException : System.Exception - { - public string StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.Dictionary> Headers { get; private set; } - - public SwaggerException(string message, string statusCode, string response, System.Collections.Generic.Dictionary> headers, System.Exception innerException) - : base(message, innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.13.3.0 (NJsonSchema v9.10.22.0 (Newtonsoft.Json v9.0.0.0))")] - public partial class SwaggerException : SwaggerException - { - public TResult Result { get; private set; } - - public SwaggerException(string message, string statusCode, string response, System.Collections.Generic.Dictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - -} \ No newline at end of file diff --git a/src/NSwag.Sample.NetCoreAngular.Clients/GitHubClients.cs b/src/NSwag.Sample.NetCoreAngular.Clients/GitHubClients.cs deleted file mode 100644 index fb34a44775..0000000000 --- a/src/NSwag.Sample.NetCoreAngular.Clients/GitHubClients.cs +++ /dev/null @@ -1,67598 +0,0 @@ -//---------------------- -// -// Generated using the NSwag toolchain v11.4.3.0 (NJsonSchema v9.4.10.0) (http://NSwag.org) -// -//---------------------- - -namespace MyGitHubTest -{ - #pragma warning disable // Disable all warnings - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.4.3.0")] - public partial class GitHubClient - { - private System.Lazy _settings; - private string _baseUrl = "https://api.github.com"; - - public GitHubClient() - { - _settings = new System.Lazy(() => - { - var settings = new Newtonsoft.Json.JsonSerializerSettings(); - UpdateJsonSerializerSettings(settings); - return settings; - }); - } - - public string BaseUrl - { - get { return _baseUrl; } - set { _baseUrl = value; } - } - - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task EmojisAsync(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return EmojisAsync(x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task EmojisAsync(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/emojis"); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Emojis); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Emojis); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task EventsAsync(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return EventsAsync(x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task EventsAsync(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/events"); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Events); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Events); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task FeedsAsync(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return FeedsAsync(x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task FeedsAsync(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/feeds"); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Feeds); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Feeds); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Timestamp in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ. - /// Only gists updated at or after this time are returned. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> GistsAllAsync(string since, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return GistsAllAsync(since, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Timestamp in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ. - /// Only gists updated at or after this time are returned. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> GistsAllAsync(string since, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gists?"); - if (since != null) urlBuilder_.Append("since=").Append(System.Uri.EscapeDataString(System.Convert.ToString(since, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Created - /// A server side error occurred. - public System.Threading.Tasks.Task GistsAsync(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, PostGist body) - { - return GistsAsync(x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Created - /// A server side error occurred. - public async System.Threading.Tasks.Task GistsAsync(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, PostGist body, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gists"); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Gist); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Gist); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Timestamp in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ. - /// Only gists updated at or after this time are returned. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> PublicAllAsync(string since, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return PublicAllAsync(since, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Timestamp in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ. - /// Only gists updated at or after this time are returned. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> PublicAllAsync(string since, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gists/public?"); - if (since != null) urlBuilder_.Append("since=").Append(System.Uri.EscapeDataString(System.Convert.ToString(since, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Timestamp in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ. - /// Only gists updated at or after this time are returned. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> StarredAllAsync(string since, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return StarredAllAsync(since, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Timestamp in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ. - /// Only gists updated at or after this time are returned. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> StarredAllAsync(string since, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gists/starred?"); - if (since != null) urlBuilder_.Append("since=").Append(System.Uri.EscapeDataString(System.Convert.ToString(since, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// No content. - /// A server side error occurred. - public System.Threading.Tasks.Task Gists2Async(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Gists2Async(id, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// No content. - /// A server side error occurred. - public async System.Threading.Tasks.Task Gists2Async(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gists/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Gists3Async(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Gists3Async(id, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Gists3Async(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gists/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Gist); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Gist); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Gists4Async(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, PatchGist body) - { - return Gists4Async(id, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Gists4Async(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, PatchGist body, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gists/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PATCH"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Gist); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Gist); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> CommentsAllAsync(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return CommentsAllAsync(id, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> CommentsAllAsync(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gists/{id}/comments"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Created - /// A server side error occurred. - public System.Threading.Tasks.Task CommentsAsync(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, CommentBody body) - { - return CommentsAsync(id, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Created - /// A server side error occurred. - public async System.Threading.Tasks.Task CommentsAsync(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, CommentBody body, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gists/{id}/comments"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Comment); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Comment); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of gist. - /// Id of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// No content. - /// A server side error occurred. - public System.Threading.Tasks.Task Comments2Async(int id, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Comments2Async(id, commentId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Id of gist. - /// Id of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// No content. - /// A server side error occurred. - public async System.Threading.Tasks.Task Comments2Async(int id, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - if (commentId == null) - throw new System.ArgumentNullException("commentId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gists/{id}/comments/{commentId}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{commentId}", System.Uri.EscapeDataString(System.Convert.ToString(commentId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of gist. - /// Id of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Comments3Async(int id, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Comments3Async(id, commentId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Id of gist. - /// Id of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Comments3Async(int id, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - if (commentId == null) - throw new System.ArgumentNullException("commentId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gists/{id}/comments/{commentId}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{commentId}", System.Uri.EscapeDataString(System.Convert.ToString(commentId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Comment); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Comment); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of gist. - /// Id of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Comments4Async(int id, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, Comment body) - { - return Comments4Async(id, commentId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Id of gist. - /// Id of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Comments4Async(int id, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, Comment body, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - if (commentId == null) - throw new System.ArgumentNullException("commentId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gists/{id}/comments/{commentId}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{commentId}", System.Uri.EscapeDataString(System.Convert.ToString(commentId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PATCH"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Comment); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Comment); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Exists. - /// A server side error occurred. - public System.Threading.Tasks.Task ForksAsync(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return ForksAsync(id, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Exists. - /// A server side error occurred. - public async System.Threading.Tasks.Task ForksAsync(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gists/{id}/forks"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(string.Empty); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ == "404") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Not exists.", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Item removed. - /// A server side error occurred. - public System.Threading.Tasks.Task StarAsync(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return StarAsync(id, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Item removed. - /// A server side error occurred. - public async System.Threading.Tasks.Task StarAsync(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gists/{id}/star"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Exists. - /// A server side error occurred. - public System.Threading.Tasks.Task Star2Async(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Star2Async(id, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Exists. - /// A server side error occurred. - public async System.Threading.Tasks.Task Star2Async(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gists/{id}/star"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ == "404") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Not exists.", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Starred. - /// A server side error occurred. - public System.Threading.Tasks.Task Star3Async(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Star3Async(id, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Id of gist. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Starred. - /// A server side error occurred. - public async System.Threading.Tasks.Task Star3Async(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gists/{id}/star"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(string.Empty); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> TemplatesAllAsync(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return TemplatesAllAsync(x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> TemplatesAllAsync(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gitignore/templates"); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task TemplatesAsync(string language, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return TemplatesAsync(language, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task TemplatesAsync(string language, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (language == null) - throw new System.ArgumentNullException("language"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/gitignore/templates/{language}"); - urlBuilder_.Replace("{language}", System.Uri.EscapeDataString(System.Convert.ToString(language, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(GitignoreLang); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(GitignoreLang); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Issues assigned to you / created by you / mentioning you / you're - /// subscribed to updates for / All issues the authenticated user can see - /// String list of comma separated Label names. Example - bug,ui,@high. - /// Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. - /// Only issues updated at or after this time are returned. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> IssuesAllAsync(Filter filter, State state, string labels, Sort sort, Direction direction, string since, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return IssuesAllAsync(filter, state, labels, sort, direction, since, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Issues assigned to you / created by you / mentioning you / you're - /// subscribed to updates for / All issues the authenticated user can see - /// String list of comma separated Label names. Example - bug,ui,@high. - /// Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. - /// Only issues updated at or after this time are returned. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> IssuesAllAsync(Filter filter, State state, string labels, Sort sort, Direction direction, string since, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (filter == null) - throw new System.ArgumentNullException("filter"); - - if (state == null) - throw new System.ArgumentNullException("state"); - - if (labels == null) - throw new System.ArgumentNullException("labels"); - - if (sort == null) - throw new System.ArgumentNullException("sort"); - - if (direction == null) - throw new System.ArgumentNullException("direction"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/issues?"); - urlBuilder_.Append("filter=").Append(System.Uri.EscapeDataString(System.Convert.ToString(filter, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append("state=").Append(System.Uri.EscapeDataString(System.Convert.ToString(state, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append("labels=").Append(System.Uri.EscapeDataString(System.Convert.ToString(labels, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append("sort=").Append(System.Uri.EscapeDataString(System.Convert.ToString(sort, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append("direction=").Append(System.Uri.EscapeDataString(System.Convert.ToString(direction, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (since != null) urlBuilder_.Append("since=").Append(System.Uri.EscapeDataString(System.Convert.ToString(since, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// The search term. - /// Indicates the state of the issues to return. Can be either open or closed. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task SearchAsync(string keyword, State2 state, string owner, string repository, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return SearchAsync(keyword, state, owner, repository, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// The search term. - /// Indicates the state of the issues to return. Can be either open or closed. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task SearchAsync(string keyword, State2 state, string owner, string repository, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (keyword == null) - throw new System.ArgumentNullException("keyword"); - - if (state == null) - throw new System.ArgumentNullException("state"); - - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repository == null) - throw new System.ArgumentNullException("repository"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/legacy/issues/search/{owner}/{repository}/{state}/{keyword}"); - urlBuilder_.Replace("{keyword}", System.Uri.EscapeDataString(System.Convert.ToString(keyword, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{state}", System.Uri.EscapeDataString(System.Convert.ToString(state, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repository}", System.Uri.EscapeDataString(System.Convert.ToString(repository, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(SearchIssuesByKeyword); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(SearchIssuesByKeyword); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// The search term - /// The sort field. if sort param is provided. Can be either asc or desc. - /// Filter results by language - /// The page number to fetch - /// The sort field. One of stars, forks, or updated. Default: results are sorted by best match. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Search2Async(string keyword, Order? order, string language, string start_page, Sort2? sort, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Search2Async(keyword, order, language, start_page, sort, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// The search term - /// The sort field. if sort param is provided. Can be either asc or desc. - /// Filter results by language - /// The page number to fetch - /// The sort field. One of stars, forks, or updated. Default: results are sorted by best match. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Search2Async(string keyword, Order? order, string language, string start_page, Sort2? sort, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (keyword == null) - throw new System.ArgumentNullException("keyword"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/legacy/repos/search/{keyword}?"); - urlBuilder_.Replace("{keyword}", System.Uri.EscapeDataString(System.Convert.ToString(keyword, System.Globalization.CultureInfo.InvariantCulture))); - if (order != null) urlBuilder_.Append("order=").Append(System.Uri.EscapeDataString(System.Convert.ToString(order.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (language != null) urlBuilder_.Append("language=").Append(System.Uri.EscapeDataString(System.Convert.ToString(language, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (start_page != null) urlBuilder_.Append("start_page=").Append(System.Uri.EscapeDataString(System.Convert.ToString(start_page, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (sort != null) urlBuilder_.Append("sort=").Append(System.Uri.EscapeDataString(System.Convert.ToString(sort.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(SearchRepositoriesByKeyword); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(SearchRepositoriesByKeyword); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// The email address - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task EmailAsync(string email, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return EmailAsync(email, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// The email address - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task EmailAsync(string email, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (email == null) - throw new System.ArgumentNullException("email"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/legacy/user/email/{email}"); - urlBuilder_.Replace("{email}", System.Uri.EscapeDataString(System.Convert.ToString(email, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(SearchUserByEmail); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(SearchUserByEmail); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// The search term - /// The sort field. if sort param is provided. Can be either asc or desc. - /// The page number to fetch - /// The sort field. One of stars, forks, or updated. Default: results are sorted by best match. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Search3Async(string keyword, Order2? order, string start_page, Sort3? sort, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Search3Async(keyword, order, start_page, sort, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// The search term - /// The sort field. if sort param is provided. Can be either asc or desc. - /// The page number to fetch - /// The sort field. One of stars, forks, or updated. Default: results are sorted by best match. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Search3Async(string keyword, Order2? order, string start_page, Sort3? sort, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (keyword == null) - throw new System.ArgumentNullException("keyword"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/legacy/user/search/{keyword}?"); - urlBuilder_.Replace("{keyword}", System.Uri.EscapeDataString(System.Convert.ToString(keyword, System.Globalization.CultureInfo.InvariantCulture))); - if (order != null) urlBuilder_.Append("order=").Append(System.Uri.EscapeDataString(System.Convert.ToString(order.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (start_page != null) urlBuilder_.Append("start_page=").Append(System.Uri.EscapeDataString(System.Convert.ToString(start_page, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (sort != null) urlBuilder_.Append("sort=").Append(System.Uri.EscapeDataString(System.Convert.ToString(sort.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(SearchUsersByKeyword); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(SearchUsersByKeyword); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task MarkdownAsync(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, Markdown body) - { - return MarkdownAsync(x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task MarkdownAsync(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, Markdown body, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/markdown"); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task RawAsync(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return RawAsync(x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task RawAsync(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/markdown/raw"); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(string.Empty); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task MetaAsync(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return MetaAsync(x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task MetaAsync(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/meta"); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Meta); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Meta); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of the owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Events2Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Events2Async(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of the owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Events2Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/networks/{owner}/{repo}/events"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Events); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Events); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// True to show notifications marked as read. - /// True to show only notifications in which the user is directly participating - /// or mentioned. - /// The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. - /// Example: "2012-10-09T23:39:01Z". - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task NotificationsAsync(bool? all, bool? participating, string since, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return NotificationsAsync(all, participating, since, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// True to show notifications marked as read. - /// True to show only notifications in which the user is directly participating - /// or mentioned. - /// The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. - /// Example: "2012-10-09T23:39:01Z". - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task NotificationsAsync(bool? all, bool? participating, string since, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/notifications?"); - if (all != null) urlBuilder_.Append("all=").Append(System.Uri.EscapeDataString(System.Convert.ToString(all.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (participating != null) urlBuilder_.Append("participating=").Append(System.Uri.EscapeDataString(System.Convert.ToString(participating.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (since != null) urlBuilder_.Append("since=").Append(System.Uri.EscapeDataString(System.Convert.ToString(since, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Notifications); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Notifications); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Marked as read. - /// A server side error occurred. - public System.Threading.Tasks.Task Notifications2Async(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, NotificationMarkRead body) - { - return Notifications2Async(x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Marked as read. - /// A server side error occurred. - public async System.Threading.Tasks.Task Notifications2Async(string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, NotificationMarkRead body, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/notifications"); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "205") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of thread. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task ThreadsAsync(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return ThreadsAsync(id, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Id of thread. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task ThreadsAsync(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/notifications/threads/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Notifications); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Notifications); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of thread. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Thread marked as read. - /// A server side error occurred. - public System.Threading.Tasks.Task Threads2Async(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Threads2Async(id, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Id of thread. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Thread marked as read. - /// A server side error occurred. - public async System.Threading.Tasks.Task Threads2Async(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/notifications/threads/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(string.Empty); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PATCH"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "205") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of thread. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// No Content - /// A server side error occurred. - public System.Threading.Tasks.Task SubscriptionAsync(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return SubscriptionAsync(id, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Id of thread. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// No Content - /// A server side error occurred. - public async System.Threading.Tasks.Task SubscriptionAsync(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/notifications/threads/{id}/subscription"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of thread. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Subscription2Async(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Subscription2Async(id, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Id of thread. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Subscription2Async(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/notifications/threads/{id}/subscription"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Subscription); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Subscription); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Id of thread. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Subscription3Async(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, PutSubscription body) - { - return Subscription3Async(id, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Id of thread. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Subscription3Async(int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, PutSubscription body, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/notifications/threads/{id}/subscription"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Subscription); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Subscription); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of organisation. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task OrgsAsync(string org, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return OrgsAsync(org, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of organisation. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task OrgsAsync(string org, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (org == null) - throw new System.ArgumentNullException("org"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/orgs/{org}"); - urlBuilder_.Replace("{org}", System.Uri.EscapeDataString(System.Convert.ToString(org, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Organization); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Organization); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of organisation. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Orgs2Async(string org, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, PatchOrg body) - { - return Orgs2Async(org, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of organisation. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Orgs2Async(string org, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, PatchOrg body, System.Threading.CancellationToken cancellationToken) - { - if (org == null) - throw new System.ArgumentNullException("org"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/orgs/{org}"); - urlBuilder_.Replace("{org}", System.Uri.EscapeDataString(System.Convert.ToString(org, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PATCH"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Organization); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Organization); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of organisation. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Events3Async(string org, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Events3Async(org, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of organisation. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Events3Async(string org, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (org == null) - throw new System.ArgumentNullException("org"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/orgs/{org}/events"); - urlBuilder_.Replace("{org}", System.Uri.EscapeDataString(System.Convert.ToString(org, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Events); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Events); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of organisation. - /// Issues assigned to you / created by you / mentioning you / you're - /// subscribed to updates for / All issues the authenticated user can see - /// String list of comma separated Label names. Example - bug,ui,@high. - /// Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. - /// Only issues updated at or after this time are returned. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> IssuesAsync(string org, Filter2 filter, State3 state, string labels, Sort4 sort, Direction2 direction, string since, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return IssuesAsync(org, filter, state, labels, sort, direction, since, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of organisation. - /// Issues assigned to you / created by you / mentioning you / you're - /// subscribed to updates for / All issues the authenticated user can see - /// String list of comma separated Label names. Example - bug,ui,@high. - /// Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. - /// Only issues updated at or after this time are returned. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> IssuesAsync(string org, Filter2 filter, State3 state, string labels, Sort4 sort, Direction2 direction, string since, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (org == null) - throw new System.ArgumentNullException("org"); - - if (filter == null) - throw new System.ArgumentNullException("filter"); - - if (state == null) - throw new System.ArgumentNullException("state"); - - if (labels == null) - throw new System.ArgumentNullException("labels"); - - if (sort == null) - throw new System.ArgumentNullException("sort"); - - if (direction == null) - throw new System.ArgumentNullException("direction"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/orgs/{org}/issues?"); - urlBuilder_.Replace("{org}", System.Uri.EscapeDataString(System.Convert.ToString(org, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("filter=").Append(System.Uri.EscapeDataString(System.Convert.ToString(filter, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append("state=").Append(System.Uri.EscapeDataString(System.Convert.ToString(state, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append("labels=").Append(System.Uri.EscapeDataString(System.Convert.ToString(labels, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append("sort=").Append(System.Uri.EscapeDataString(System.Convert.ToString(sort, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append("direction=").Append(System.Uri.EscapeDataString(System.Convert.ToString(direction, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (since != null) urlBuilder_.Append("since=").Append(System.Uri.EscapeDataString(System.Convert.ToString(since, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of organisation. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> MembersAllAsync(string org, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return MembersAllAsync(org, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of organisation. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> MembersAllAsync(string org, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (org == null) - throw new System.ArgumentNullException("org"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/orgs/{org}/members"); - urlBuilder_.Replace("{org}", System.Uri.EscapeDataString(System.Convert.ToString(org, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "302") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Response if requester is not an organization member.", status_, responseData_, headers_, null); - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of organisation. - /// Name of the user. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// No content. - /// A server side error occurred. - public System.Threading.Tasks.Task MembersAsync(string org, string username, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return MembersAsync(org, username, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of organisation. - /// Name of the user. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// No content. - /// A server side error occurred. - public async System.Threading.Tasks.Task MembersAsync(string org, string username, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (org == null) - throw new System.ArgumentNullException("org"); - - if (username == null) - throw new System.ArgumentNullException("username"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/orgs/{org}/members/{username}"); - urlBuilder_.Replace("{org}", System.Uri.EscapeDataString(System.Convert.ToString(org, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{username}", System.Uri.EscapeDataString(System.Convert.ToString(username, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of organisation. - /// Name of the user. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// No content. Response if requester is an organization member and user is a member - /// A server side error occurred. - public System.Threading.Tasks.Task Members2Async(string org, string username, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Members2Async(org, username, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of organisation. - /// Name of the user. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// No content. Response if requester is an organization member and user is a member - /// A server side error occurred. - public async System.Threading.Tasks.Task Members2Async(string org, string username, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (org == null) - throw new System.ArgumentNullException("org"); - - if (username == null) - throw new System.ArgumentNullException("username"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/orgs/{org}/members/{username}"); - urlBuilder_.Replace("{org}", System.Uri.EscapeDataString(System.Convert.ToString(org, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{username}", System.Uri.EscapeDataString(System.Convert.ToString(username, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "302") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Found. Response if requester is not an organization member\n", status_, responseData_, headers_, null); - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ == "404") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("Not Found.\na. Response if requester is an organization member and user is not a member\nb. Response if requester is not an organization member and is inquiring about themselves\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of organisation. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> ReposAllAsync(string org, Type? type, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return ReposAllAsync(org, type, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of organisation. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> ReposAllAsync(string org, Type? type, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (org == null) - throw new System.ArgumentNullException("org"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/orgs/{org}/repos?"); - urlBuilder_.Replace("{org}", System.Uri.EscapeDataString(System.Convert.ToString(org, System.Globalization.CultureInfo.InvariantCulture))); - if (type != null) urlBuilder_.Append("type=").Append(System.Uri.EscapeDataString(System.Convert.ToString(type.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of organisation. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Created - /// A server side error occurred. - public System.Threading.Tasks.Task> ReposAsync(string org, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, PostRepo body) - { - return ReposAsync(org, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of organisation. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Created - /// A server side error occurred. - public async System.Threading.Tasks.Task> ReposAsync(string org, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, PostRepo body, System.Threading.CancellationToken cancellationToken) - { - if (org == null) - throw new System.ArgumentNullException("org"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/orgs/{org}/repos"); - urlBuilder_.Replace("{org}", System.Uri.EscapeDataString(System.Convert.ToString(org, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of organisation. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> TeamsAllAsync(string org, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return TeamsAllAsync(org, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of organisation. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> TeamsAllAsync(string org, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (org == null) - throw new System.ArgumentNullException("org"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/orgs/{org}/teams"); - urlBuilder_.Replace("{org}", System.Uri.EscapeDataString(System.Convert.ToString(org, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of organisation. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Created - /// A server side error occurred. - public System.Threading.Tasks.Task TeamsAsync(string org, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, OrgTeamsPost body) - { - return TeamsAsync(org, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of organisation. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Created - /// A server side error occurred. - public async System.Threading.Tasks.Task TeamsAsync(string org, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, OrgTeamsPost body, System.Threading.CancellationToken cancellationToken) - { - if (org == null) - throw new System.ArgumentNullException("org"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/orgs/{org}/teams"); - urlBuilder_.Replace("{org}", System.Uri.EscapeDataString(System.Convert.ToString(org, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Team); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Team); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Item removed. - /// A server side error occurred. - public System.Threading.Tasks.Task Repos2Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Repos2Async(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Item removed. - /// A server side error occurred. - public async System.Threading.Tasks.Task Repos2Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Repos3Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Repos3Async(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Repos3Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Repo); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Repo); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Repos4Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, RepoEdit body) - { - return Repos4Async(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Repos4Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, RepoEdit body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PATCH"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Repo); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Repo); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> AssigneesAllAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return AssigneesAllAsync(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> AssigneesAllAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/assignees"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Login of the assignee. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// User is an assignee. - /// A server side error occurred. - public System.Threading.Tasks.Task AssigneesAsync(string owner, string repo, string assignee, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return AssigneesAsync(owner, repo, assignee, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Login of the assignee. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// User is an assignee. - /// A server side error occurred. - public async System.Threading.Tasks.Task AssigneesAsync(string owner, string repo, string assignee, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (assignee == null) - throw new System.ArgumentNullException("assignee"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/assignees/{assignee}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{assignee}", System.Uri.EscapeDataString(System.Convert.ToString(assignee, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ == "404") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("User isn\'t an assignee.", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> BranchesAllAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return BranchesAllAsync(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> BranchesAllAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/branches"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Name of the branch. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task BranchesAsync(string owner, string repo, string branch, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return BranchesAsync(owner, repo, branch, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Name of the branch. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task BranchesAsync(string owner, string repo, string branch, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (branch == null) - throw new System.ArgumentNullException("branch"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/branches/{branch}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{branch}", System.Uri.EscapeDataString(System.Convert.ToString(branch, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Branch); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Branch); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> CollaboratorsAllAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return CollaboratorsAllAsync(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> CollaboratorsAllAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/collaborators"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Login of the user. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Collaborator removed. - /// A server side error occurred. - public System.Threading.Tasks.Task CollaboratorsAsync(string owner, string repo, string user, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return CollaboratorsAsync(owner, repo, user, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Login of the user. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Collaborator removed. - /// A server side error occurred. - public async System.Threading.Tasks.Task CollaboratorsAsync(string owner, string repo, string user, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (user == null) - throw new System.ArgumentNullException("user"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/collaborators/{user}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{user}", System.Uri.EscapeDataString(System.Convert.ToString(user, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Login of the user. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// User is a collaborator. - /// A server side error occurred. - public System.Threading.Tasks.Task Collaborators2Async(string owner, string repo, string user, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Collaborators2Async(owner, repo, user, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Login of the user. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// User is a collaborator. - /// A server side error occurred. - public async System.Threading.Tasks.Task Collaborators2Async(string owner, string repo, string user, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (user == null) - throw new System.ArgumentNullException("user"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/collaborators/{user}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{user}", System.Uri.EscapeDataString(System.Convert.ToString(user, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ == "404") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("User is not a collaborator.", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Login of the user. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Collaborator added. - /// A server side error occurred. - public System.Threading.Tasks.Task Collaborators3Async(string owner, string repo, string user, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Collaborators3Async(owner, repo, user, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Login of the user. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Collaborator added. - /// A server side error occurred. - public async System.Threading.Tasks.Task Collaborators3Async(string owner, string repo, string user, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (user == null) - throw new System.ArgumentNullException("user"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/collaborators/{user}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{user}", System.Uri.EscapeDataString(System.Convert.ToString(user, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(string.Empty); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> Comments5Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Comments5Async(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> Comments5Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/comments"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Id of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// No content. - /// A server side error occurred. - public System.Threading.Tasks.Task Comments6Async(string owner, string repo, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Comments6Async(owner, repo, commentId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Id of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// No content. - /// A server side error occurred. - public async System.Threading.Tasks.Task Comments6Async(string owner, string repo, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (commentId == null) - throw new System.ArgumentNullException("commentId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/comments/{commentId}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{commentId}", System.Uri.EscapeDataString(System.Convert.ToString(commentId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Id of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Comments7Async(string owner, string repo, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Comments7Async(owner, repo, commentId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Id of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Comments7Async(string owner, string repo, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (commentId == null) - throw new System.ArgumentNullException("commentId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/comments/{commentId}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{commentId}", System.Uri.EscapeDataString(System.Convert.ToString(commentId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(CommitComments); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(CommitComments); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Id of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Comments8Async(string owner, string repo, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, CommentBody body) - { - return Comments8Async(owner, repo, commentId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Id of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Comments8Async(string owner, string repo, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, CommentBody body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (commentId == null) - throw new System.ArgumentNullException("commentId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/comments/{commentId}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{commentId}", System.Uri.EscapeDataString(System.Convert.ToString(commentId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PATCH"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(CommitComments); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(CommitComments); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. - /// Example: "2012-10-09T23:39:01Z". - /// Sha or branch to start listing commits from. - /// Only commits containing this file path will be returned. - /// GitHub login, name, or email by which to filter by commit author. - /// ISO 8601 Date - Only commits before this date will be returned. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> CommitsAllAsync(string owner, string repo, string since, string sha, string path, string author, string until, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return CommitsAllAsync(owner, repo, since, sha, path, author, until, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. - /// Example: "2012-10-09T23:39:01Z". - /// Sha or branch to start listing commits from. - /// Only commits containing this file path will be returned. - /// GitHub login, name, or email by which to filter by commit author. - /// ISO 8601 Date - Only commits before this date will be returned. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> CommitsAllAsync(string owner, string repo, string since, string sha, string path, string author, string until, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/commits?"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - if (since != null) urlBuilder_.Append("since=").Append(System.Uri.EscapeDataString(System.Convert.ToString(since, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (sha != null) urlBuilder_.Append("sha=").Append(System.Uri.EscapeDataString(System.Convert.ToString(sha, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (path != null) urlBuilder_.Append("path=").Append(System.Uri.EscapeDataString(System.Convert.ToString(path, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (author != null) urlBuilder_.Append("author=").Append(System.Uri.EscapeDataString(System.Convert.ToString(author, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (until != null) urlBuilder_.Append("until=").Append(System.Uri.EscapeDataString(System.Convert.ToString(until, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> StatusAsync(string owner, string repo, string @ref, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return StatusAsync(owner, repo, @ref, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> StatusAsync(string owner, string repo, string @ref, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (@ref == null) - throw new System.ArgumentNullException("@ref"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/commits/{ref}/status"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{ref}", System.Uri.EscapeDataString(System.Convert.ToString(@ref, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// SHA-1 code of the commit. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task CommitsAsync(string owner, string repo, string shaCode, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return CommitsAsync(owner, repo, shaCode, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// SHA-1 code of the commit. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task CommitsAsync(string owner, string repo, string shaCode, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (shaCode == null) - throw new System.ArgumentNullException("shaCode"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/commits/{shaCode}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{shaCode}", System.Uri.EscapeDataString(System.Convert.ToString(shaCode, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Commit); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Commit); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// SHA-1 code of the commit. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> Comments9Async(string owner, string repo, string shaCode, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Comments9Async(owner, repo, shaCode, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// SHA-1 code of the commit. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> Comments9Async(string owner, string repo, string shaCode, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (shaCode == null) - throw new System.ArgumentNullException("shaCode"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/commits/{shaCode}/comments"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{shaCode}", System.Uri.EscapeDataString(System.Convert.ToString(shaCode, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// SHA-1 code of the commit. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Created - /// A server side error occurred. - public System.Threading.Tasks.Task Comments10Async(string owner, string repo, string shaCode, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, CommitBody body) - { - return Comments10Async(owner, repo, shaCode, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// SHA-1 code of the commit. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Created - /// A server side error occurred. - public async System.Threading.Tasks.Task Comments10Async(string owner, string repo, string shaCode, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, CommitBody body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (shaCode == null) - throw new System.ArgumentNullException("shaCode"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/commits/{shaCode}/comments"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{shaCode}", System.Uri.EscapeDataString(System.Convert.ToString(shaCode, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(CommitComments); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(CommitComments); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task CompareAsync(string owner, string repo, string baseId, string headId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return CompareAsync(owner, repo, baseId, headId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task CompareAsync(string owner, string repo, string baseId, string headId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (baseId == null) - throw new System.ArgumentNullException("baseId"); - - if (headId == null) - throw new System.ArgumentNullException("headId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/compare/{baseId}...{headId}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{baseId}", System.Uri.EscapeDataString(System.Convert.ToString(baseId, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{headId}", System.Uri.EscapeDataString(System.Convert.ToString(headId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(CompareCommits); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(CompareCommits); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task ContentsAsync(string owner, string repo, string path, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, DeleteFileBody body) - { - return ContentsAsync(owner, repo, path, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task ContentsAsync(string owner, string repo, string path, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, DeleteFileBody body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (path == null) - throw new System.ArgumentNullException("path"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/contents/{path}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{path}", System.Uri.EscapeDataString(System.Convert.ToString(path, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(DeleteFile); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(DeleteFile); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// The content path. - /// The String name of the Commit/Branch/Tag. Defaults to 'master'. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Contents2Async(string owner, string repo, string pathPath, string pathQuery, string @ref, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Contents2Async(owner, repo, pathPath, pathQuery, @ref, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// The content path. - /// The String name of the Commit/Branch/Tag. Defaults to 'master'. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Contents2Async(string owner, string repo, string pathPath, string pathQuery, string @ref, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (pathPath == null) - throw new System.ArgumentNullException("pathPath"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/contents/{path}?"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{path}", System.Uri.EscapeDataString(System.Convert.ToString(pathPath, System.Globalization.CultureInfo.InvariantCulture))); - if (pathQuery != null) urlBuilder_.Append("path=").Append(System.Uri.EscapeDataString(System.Convert.ToString(pathQuery, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (@ref != null) urlBuilder_.Append("ref=").Append(System.Uri.EscapeDataString(System.Convert.ToString(@ref, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(ContentsPath); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(ContentsPath); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Contents3Async(string owner, string repo, string path, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, CreateFileBody body) - { - return Contents3Async(owner, repo, path, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Contents3Async(string owner, string repo, string path, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, CreateFileBody body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (path == null) - throw new System.ArgumentNullException("path"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/contents/{path}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{path}", System.Uri.EscapeDataString(System.Convert.ToString(path, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(CreateFile); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(CreateFile); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Set to 1 or true to include anonymous contributors in results. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> ContributorsAllAsync(string owner, string repo, string anon, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return ContributorsAllAsync(owner, repo, anon, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Set to 1 or true to include anonymous contributors in results. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> ContributorsAllAsync(string owner, string repo, string anon, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (anon == null) - throw new System.ArgumentNullException("anon"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/contributors?"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("anon=").Append(System.Uri.EscapeDataString(System.Convert.ToString(anon, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> DeploymentsAllAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return DeploymentsAllAsync(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> DeploymentsAllAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/deployments"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Created - /// A server side error occurred. - public System.Threading.Tasks.Task DeploymentsAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, Deployment body) - { - return DeploymentsAsync(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Created - /// A server side error occurred. - public async System.Threading.Tasks.Task DeploymentsAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, Deployment body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/deployments"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(DeploymentResp); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(DeploymentResp); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// The Deployment ID to list the statuses from. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> StatusesAllAsync(string owner, string repo, int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return StatusesAllAsync(owner, repo, id, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// The Deployment ID to list the statuses from. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> StatusesAllAsync(string owner, string repo, int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/deployments/{id}/statuses"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// The Deployment ID to list the statuses from. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// ok - /// A server side error occurred. - public System.Threading.Tasks.Task StatusesAsync(string owner, string repo, int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, DeploymentStatusesCreate body) - { - return StatusesAsync(owner, repo, id, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// The Deployment ID to list the statuses from. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// ok - /// A server side error occurred. - public async System.Threading.Tasks.Task StatusesAsync(string owner, string repo, int id, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, DeploymentStatusesCreate body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/deployments/{id}/statuses"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(System.Convert.ToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task DownloadsAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return DownloadsAsync(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task DownloadsAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/downloads"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Downloads); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Downloads); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Id of download. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// No content. - /// A server side error occurred. - public System.Threading.Tasks.Task Downloads2Async(string owner, string repo, int downloadId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Downloads2Async(owner, repo, downloadId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Id of download. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// No content. - /// A server side error occurred. - public async System.Threading.Tasks.Task Downloads2Async(string owner, string repo, int downloadId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (downloadId == null) - throw new System.ArgumentNullException("downloadId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/downloads/{downloadId}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{downloadId}", System.Uri.EscapeDataString(System.Convert.ToString(downloadId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Id of download. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Downloads3Async(string owner, string repo, int downloadId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Downloads3Async(owner, repo, downloadId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Id of download. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Downloads3Async(string owner, string repo, int downloadId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (downloadId == null) - throw new System.ArgumentNullException("downloadId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/downloads/{downloadId}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{downloadId}", System.Uri.EscapeDataString(System.Convert.ToString(downloadId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Downloads); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Downloads); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Events4Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Events4Async(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Events4Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/events"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Events); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Events); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> ForksAllAsync(string owner, string repo, Sort5? sort, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return ForksAllAsync(owner, repo, sort, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> ForksAllAsync(string owner, string repo, Sort5? sort, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/forks?"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - if (sort != null) urlBuilder_.Append("sort=").Append(System.Uri.EscapeDataString(System.Convert.ToString(sort.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Created - /// A server side error occurred. - public System.Threading.Tasks.Task Forks2Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, ForkBody body) - { - return Forks2Async(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Created - /// A server side error occurred. - public async System.Threading.Tasks.Task Forks2Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, ForkBody body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/forks"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Fork); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Fork); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Created - /// A server side error occurred. - public System.Threading.Tasks.Task BlobsAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, Blob body) - { - return BlobsAsync(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Created - /// A server side error occurred. - public async System.Threading.Tasks.Task BlobsAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, Blob body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/git/blobs"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Blobs); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Blobs); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// SHA-1 code. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Blobs2Async(string owner, string repo, string shaCode, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Blobs2Async(owner, repo, shaCode, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// SHA-1 code. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Blobs2Async(string owner, string repo, string shaCode, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (shaCode == null) - throw new System.ArgumentNullException("shaCode"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/git/blobs/{shaCode}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{shaCode}", System.Uri.EscapeDataString(System.Convert.ToString(shaCode, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Blob); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Blob); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Created - /// A server side error occurred. - public System.Threading.Tasks.Task Commits2Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, RepoCommitBody body) - { - return Commits2Async(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Created - /// A server side error occurred. - public async System.Threading.Tasks.Task Commits2Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, RepoCommitBody body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/git/commits"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(GitCommit); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(GitCommit); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// SHA-1 code. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Commits3Async(string owner, string repo, string shaCode, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Commits3Async(owner, repo, shaCode, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// SHA-1 code. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Commits3Async(string owner, string repo, string shaCode, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (shaCode == null) - throw new System.ArgumentNullException("shaCode"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/git/commits/{shaCode}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{shaCode}", System.Uri.EscapeDataString(System.Convert.ToString(shaCode, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(RepoCommit); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(RepoCommit); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> RefsAllAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return RefsAllAsync(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> RefsAllAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/git/refs"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Created - /// A server side error occurred. - public System.Threading.Tasks.Task RefsAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, RefsBody body) - { - return RefsAsync(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Created - /// A server side error occurred. - public async System.Threading.Tasks.Task RefsAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, RefsBody body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/git/refs"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(HeadBranch); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(HeadBranch); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// No Content - /// A server side error occurred. - public System.Threading.Tasks.Task Refs2Async(string owner, string repo, string @ref, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Refs2Async(owner, repo, @ref, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// No Content - /// A server side error occurred. - public async System.Threading.Tasks.Task Refs2Async(string owner, string repo, string @ref, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (@ref == null) - throw new System.ArgumentNullException("@ref"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/git/refs/{ref}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{ref}", System.Uri.EscapeDataString(System.Convert.ToString(@ref, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Refs3Async(string owner, string repo, string @ref, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Refs3Async(owner, repo, @ref, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Refs3Async(string owner, string repo, string @ref, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (@ref == null) - throw new System.ArgumentNullException("@ref"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/git/refs/{ref}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{ref}", System.Uri.EscapeDataString(System.Convert.ToString(@ref, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(HeadBranch); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(HeadBranch); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Refs4Async(string owner, string repo, string @ref, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, GitRefPatch body) - { - return Refs4Async(owner, repo, @ref, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Refs4Async(string owner, string repo, string @ref, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, GitRefPatch body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (@ref == null) - throw new System.ArgumentNullException("@ref"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/git/refs/{ref}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{ref}", System.Uri.EscapeDataString(System.Convert.ToString(@ref, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PATCH"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(HeadBranch); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(HeadBranch); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Created - /// A server side error occurred. - public System.Threading.Tasks.Task TagsAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, Tag body) - { - return TagsAsync(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Created - /// A server side error occurred. - public async System.Threading.Tasks.Task TagsAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, Tag body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/git/tags"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Tags); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Tags); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Tags2Async(string owner, string repo, string shaCode, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Tags2Async(owner, repo, shaCode, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Tags2Async(string owner, string repo, string shaCode, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (shaCode == null) - throw new System.ArgumentNullException("shaCode"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/git/tags/{shaCode}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{shaCode}", System.Uri.EscapeDataString(System.Convert.ToString(shaCode, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Tag); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Tag); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Created - /// A server side error occurred. - public System.Threading.Tasks.Task TreesAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, Tree body) - { - return TreesAsync(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Created - /// A server side error occurred. - public async System.Threading.Tasks.Task TreesAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, Tree body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/git/trees"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Trees); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Trees); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Tree SHA. - /// Get a Tree Recursively. (0 or 1) - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Trees2Async(string owner, string repo, string shaCode, int? recursive, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Trees2Async(owner, repo, shaCode, recursive, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Tree SHA. - /// Get a Tree Recursively. (0 or 1) - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Trees2Async(string owner, string repo, string shaCode, int? recursive, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (shaCode == null) - throw new System.ArgumentNullException("shaCode"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/git/trees/{shaCode}?"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{shaCode}", System.Uri.EscapeDataString(System.Convert.ToString(shaCode, System.Globalization.CultureInfo.InvariantCulture))); - if (recursive != null) urlBuilder_.Append("recursive=").Append(System.Uri.EscapeDataString(System.Convert.ToString(recursive.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Tree); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Tree); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> HooksAllAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return HooksAllAsync(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> HooksAllAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/hooks"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Created - /// A server side error occurred. - public System.Threading.Tasks.Task> HooksAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, HookBody body) - { - return HooksAsync(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Created - /// A server side error occurred. - public async System.Threading.Tasks.Task> HooksAsync(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, HookBody body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/hooks"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Id of hook. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// No content. - /// A server side error occurred. - public System.Threading.Tasks.Task Hooks2Async(string owner, string repo, int hookId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Hooks2Async(owner, repo, hookId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Id of hook. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// No content. - /// A server side error occurred. - public async System.Threading.Tasks.Task Hooks2Async(string owner, string repo, int hookId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (hookId == null) - throw new System.ArgumentNullException("hookId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/hooks/{hookId}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{hookId}", System.Uri.EscapeDataString(System.Convert.ToString(hookId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Id of hook. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> Hooks3Async(string owner, string repo, int hookId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Hooks3Async(owner, repo, hookId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Id of hook. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> Hooks3Async(string owner, string repo, int hookId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (hookId == null) - throw new System.ArgumentNullException("hookId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/hooks/{hookId}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{hookId}", System.Uri.EscapeDataString(System.Convert.ToString(hookId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Id of hook. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> Hooks4Async(string owner, string repo, int hookId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, HookBody body) - { - return Hooks4Async(owner, repo, hookId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Id of hook. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> Hooks4Async(string owner, string repo, int hookId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, HookBody body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (hookId == null) - throw new System.ArgumentNullException("hookId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/hooks/{hookId}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{hookId}", System.Uri.EscapeDataString(System.Convert.ToString(hookId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PATCH"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Id of hook. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Hook is triggered. - /// A server side error occurred. - public System.Threading.Tasks.Task TestsAsync(string owner, string repo, int hookId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return TestsAsync(owner, repo, hookId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Id of hook. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Hook is triggered. - /// A server side error occurred. - public async System.Threading.Tasks.Task TestsAsync(string owner, string repo, int hookId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (hookId == null) - throw new System.ArgumentNullException("hookId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/hooks/{hookId}/tests"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{hookId}", System.Uri.EscapeDataString(System.Convert.ToString(hookId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(string.Empty); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Issues assigned to you / created by you / mentioning you / you're - /// subscribed to updates for / All issues the authenticated user can see - /// String list of comma separated Label names. Example - bug,ui,@high. - /// Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. - /// Only issues updated at or after this time are returned. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> Issues2Async(string owner, string repo, Filter3 filter, State4 state, string labels, Sort6 sort, Direction3 direction, string since, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Issues2Async(owner, repo, filter, state, labels, sort, direction, since, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Issues assigned to you / created by you / mentioning you / you're - /// subscribed to updates for / All issues the authenticated user can see - /// String list of comma separated Label names. Example - bug,ui,@high. - /// Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. - /// Only issues updated at or after this time are returned. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> Issues2Async(string owner, string repo, Filter3 filter, State4 state, string labels, Sort6 sort, Direction3 direction, string since, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (filter == null) - throw new System.ArgumentNullException("filter"); - - if (state == null) - throw new System.ArgumentNullException("state"); - - if (labels == null) - throw new System.ArgumentNullException("labels"); - - if (sort == null) - throw new System.ArgumentNullException("sort"); - - if (direction == null) - throw new System.ArgumentNullException("direction"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/issues?"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Append("filter=").Append(System.Uri.EscapeDataString(System.Convert.ToString(filter, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append("state=").Append(System.Uri.EscapeDataString(System.Convert.ToString(state, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append("labels=").Append(System.Uri.EscapeDataString(System.Convert.ToString(labels, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append("sort=").Append(System.Uri.EscapeDataString(System.Convert.ToString(sort, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append("direction=").Append(System.Uri.EscapeDataString(System.Convert.ToString(direction, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (since != null) urlBuilder_.Append("since=").Append(System.Uri.EscapeDataString(System.Convert.ToString(since, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Created - /// A server side error occurred. - public System.Threading.Tasks.Task Issues3Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, Issue body) - { - return Issues3Async(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Created - /// A server side error occurred. - public async System.Threading.Tasks.Task Issues3Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, Issue body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/issues"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Issue); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Issue); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Ignored without 'sort' parameter. - /// The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. - /// Example: "2012-10-09T23:39:01Z". - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> Comments11Async(string owner, string repo, string direction, Sort7? sort, string since, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Comments11Async(owner, repo, direction, sort, since, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Ignored without 'sort' parameter. - /// The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. - /// Example: "2012-10-09T23:39:01Z". - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> Comments11Async(string owner, string repo, string direction, Sort7? sort, string since, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/issues/comments?"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - if (direction != null) urlBuilder_.Append("direction=").Append(System.Uri.EscapeDataString(System.Convert.ToString(direction, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (sort != null) urlBuilder_.Append("sort=").Append(System.Uri.EscapeDataString(System.Convert.ToString(sort.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (since != null) urlBuilder_.Append("since=").Append(System.Uri.EscapeDataString(System.Convert.ToString(since, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// ID of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// No content. - /// A server side error occurred. - public System.Threading.Tasks.Task Comments12Async(string owner, string repo, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Comments12Async(owner, repo, commentId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// ID of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// No content. - /// A server side error occurred. - public async System.Threading.Tasks.Task Comments12Async(string owner, string repo, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (commentId == null) - throw new System.ArgumentNullException("commentId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/issues/comments/{commentId}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{commentId}", System.Uri.EscapeDataString(System.Convert.ToString(commentId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// ID of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Comments13Async(string owner, string repo, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Comments13Async(owner, repo, commentId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// ID of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Comments13Async(string owner, string repo, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (commentId == null) - throw new System.ArgumentNullException("commentId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/issues/comments/{commentId}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{commentId}", System.Uri.EscapeDataString(System.Convert.ToString(commentId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(IssuesComment); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(IssuesComment); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// ID of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Comments14Async(string owner, string repo, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, CommentBody body) - { - return Comments14Async(owner, repo, commentId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// ID of comment. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Comments14Async(string owner, string repo, int commentId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, CommentBody body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (commentId == null) - throw new System.ArgumentNullException("commentId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/issues/comments/{commentId}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{commentId}", System.Uri.EscapeDataString(System.Convert.ToString(commentId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PATCH"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(IssuesComment); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(IssuesComment); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Events5Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Events5Async(owner, repo, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Events5Async(string owner, string repo, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/issues/events"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Events); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Events); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Id of the event. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Events6Async(string owner, string repo, int eventId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Events6Async(owner, repo, eventId, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Id of the event. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Events6Async(string owner, string repo, int eventId, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (eventId == null) - throw new System.ArgumentNullException("eventId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/issues/events/{eventId}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{eventId}", System.Uri.EscapeDataString(System.Convert.ToString(eventId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Event); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Event); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Number of issue. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Issues4Async(string owner, string repo, int number, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Issues4Async(owner, repo, number, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Number of issue. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Issues4Async(string owner, string repo, int number, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (number == null) - throw new System.ArgumentNullException("number"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/issues/{number}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{number}", System.Uri.EscapeDataString(System.Convert.ToString(number, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Issue); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Issue); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Number of issue. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Issues5Async(string owner, string repo, int number, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, Issue body) - { - return Issues5Async(owner, repo, number, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Number of issue. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Issues5Async(string owner, string repo, int number, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, Issue body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (number == null) - throw new System.ArgumentNullException("number"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/issues/{number}"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{number}", System.Uri.EscapeDataString(System.Convert.ToString(number, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PATCH"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Issue); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Issue); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Number of issue. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> Comments15Async(string owner, string repo, int number, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Comments15Async(owner, repo, number, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Number of issue. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> Comments15Async(string owner, string repo, int number, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (number == null) - throw new System.ArgumentNullException("number"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/issues/{number}/comments"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{number}", System.Uri.EscapeDataString(System.Convert.ToString(number, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Number of issue. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Created - /// A server side error occurred. - public System.Threading.Tasks.Task Comments16Async(string owner, string repo, int number, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, CommentBody body) - { - return Comments16Async(owner, repo, number, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, body, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Number of issue. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Created - /// A server side error occurred. - public async System.Threading.Tasks.Task Comments16Async(string owner, string repo, int number, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, CommentBody body, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (number == null) - throw new System.ArgumentNullException("number"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/issues/{number}/comments"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{number}", System.Uri.EscapeDataString(System.Convert.ToString(number, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType.MediaType = "application/json"; - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(IssuesComment); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(IssuesComment); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Number of issue. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task Events7Async(string owner, string repo, int number, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return Events7Async(owner, repo, number, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Number of issue. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task Events7Async(string owner, string repo, int number, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (number == null) - throw new System.ArgumentNullException("number"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/issues/{number}/events"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{number}", System.Uri.EscapeDataString(System.Convert.ToString(number, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(Events); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(Events); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Number of issue. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// No content. - /// A server side error occurred. - public System.Threading.Tasks.Task LabelsAsync(string owner, string repo, int number, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return LabelsAsync(owner, repo, number, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Number of issue. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// No content. - /// A server side error occurred. - public async System.Threading.Tasks.Task LabelsAsync(string owner, string repo, int number, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (number == null) - throw new System.ArgumentNullException("number"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/issues/{number}/labels"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{number}", System.Uri.EscapeDataString(System.Convert.ToString(number, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "204") - { - return; - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Number of issue. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// OK - /// A server side error occurred. - public System.Threading.Tasks.Task> LabelsAllAsync(string owner, string repo, int number, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id) - { - return LabelsAllAsync(owner, repo, number, x_GitHub_Media_Type, accept, x_RateLimit_Limit, x_RateLimit_Remaining, x_RateLimit_Reset, x_GitHub_Request_Id, System.Threading.CancellationToken.None); - } - - /// Name of repository owner. - /// Name of repository. - /// Number of issue. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// OK - /// A server side error occurred. - public async System.Threading.Tasks.Task> LabelsAllAsync(string owner, string repo, int number, string x_GitHub_Media_Type, string accept, int? x_RateLimit_Limit, int? x_RateLimit_Remaining, int? x_RateLimit_Reset, int? x_GitHub_Request_Id, System.Threading.CancellationToken cancellationToken) - { - if (owner == null) - throw new System.ArgumentNullException("owner"); - - if (repo == null) - throw new System.ArgumentNullException("repo"); - - if (number == null) - throw new System.ArgumentNullException("number"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl).Append("/repos/{owner}/{repo}/issues/{number}/labels"); - urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(System.Convert.ToString(owner, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{repo}", System.Uri.EscapeDataString(System.Convert.ToString(repo, System.Globalization.CultureInfo.InvariantCulture))); - urlBuilder_.Replace("{number}", System.Uri.EscapeDataString(System.Convert.ToString(number, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = new System.Net.Http.HttpClient(); - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Headers.TryAddWithoutValidation("X-GitHub-Media-Type", x_GitHub_Media_Type != null ? System.Convert.ToString(x_GitHub_Media_Type, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("Accept", accept != null ? System.Convert.ToString(accept, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Limit", x_RateLimit_Limit != null ? System.Convert.ToString(x_RateLimit_Limit, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Remaining", x_RateLimit_Remaining != null ? System.Convert.ToString(x_RateLimit_Remaining, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-RateLimit-Reset", x_RateLimit_Reset != null ? System.Convert.ToString(x_RateLimit_Reset, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Headers.TryAddWithoutValidation("X-GitHub-Request-Id", x_GitHub_Request_Id != null ? System.Convert.ToString(x_GitHub_Request_Id, System.Globalization.CultureInfo.InvariantCulture) : null); - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - var result_ = default(System.Collections.ObjectModel.ObservableCollection); - try - { - result_ = Newtonsoft.Json.JsonConvert.DeserializeObject>(responseData_, _settings.Value); - return result_; - } - catch (System.Exception exception) - { - throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); - } - } - else - if (status_ == "403") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting\nfor details.\n", status_, responseData_, headers_, null); - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); - } - - return default(System.Collections.ObjectModel.ObservableCollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - if (client_ != null) - client_.Dispose(); - } - } - - /// Name of repository owner. - /// Name of repository. - /// Number of issue. - /// You can check the current version of media type in responses. - /// Is used to set specified media type. - /// Created - /// A server side error occurred. - public System.Threading.Tasks.Task