From dca8e8a861932a5f8ed3bf0cbe874b027094fa8d Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 24 Feb 2024 10:56:23 +0100
Subject: [PATCH 01/17] Rename project JsonApiDotNetCore.OpenApi.Client to
JsonApiDotNetCore.OpenApi.Client.NSwag
---
JsonApiDotNetCore.sln | 2 +-
docs/usage/openapi-client.md | 8 ++++----
.../ExampleApiClient.cs | 2 +-
.../JsonApiDotNetCoreExampleClient.csproj | 4 ++--
.../JsonApiDotNetCoreExampleClient/Program.cs | 2 +-
.../ApiException.cs | 2 +-
.../ApiResponse.cs | 2 +-
.../ArgumentGuard.cs | 2 +-
.../AssemblyInfo.cs | 0
.../IJsonApiClient.cs | 4 +++-
.../JsonApiClient.cs | 2 +-
...nApiDotNetCore.OpenApi.Client.NSwag.csproj} | 2 +-
.../UnreachableCodeException.cs | 2 +-
.../BaseOpenApiClientTests.cs | 2 +-
.../FakeHttpClientWrapper.cs | 2 +-
.../GeneratedCode/IOpenApiClient.cs | 2 +-
.../GeneratedCode/OpenApiClient.cs | 2 +-
...rtialAttributeSerializationLifetimeTests.cs | 2 +-
.../LegacyClient/RequestTests.cs | 2 +-
.../LegacyClient/ResponseTests.cs | 2 +-
test/OpenApiClientTests/ObjectExtensions.cs | 2 +-
.../OpenApiClientTests.csproj | 18 +++++++++---------
.../CreateResourceTests.cs | 2 +-
.../GeneratedCode/NrtOffMsvOffClient.cs | 2 +-
.../UpdateResourceTests.cs | 2 +-
.../CreateResourceTests.cs | 2 +-
.../GeneratedCode/NrtOffMsvOnClient.cs | 2 +-
.../UpdateResourceTests.cs | 2 +-
.../CreateResourceTests.cs | 2 +-
.../GeneratedCode/NrtOnMsvOffClient.cs | 2 +-
.../UpdateResourceTests.cs | 2 +-
.../CreateResourceTests.cs | 2 +-
.../GeneratedCode/NrtOnMsvOnClient.cs | 2 +-
.../UpdateResourceTests.cs | 2 +-
test/OpenApiEndToEndTests/Headers/ETagTests.cs | 2 +-
.../OpenApiEndToEndTests.csproj | 6 +++---
.../QueryStrings/FilterTests.cs | 2 +-
.../GeneratedCode/QueryStringsClient.cs | 2 +-
.../QueryStrings/PaginationTests.cs | 2 +-
.../QueryStrings/SortTests.cs | 2 +-
40 files changed, 55 insertions(+), 53 deletions(-)
rename src/{JsonApiDotNetCore.OpenApi.Client => JsonApiDotNetCore.OpenApi.Client.NSwag}/ApiException.cs (96%)
rename src/{JsonApiDotNetCore.OpenApi.Client => JsonApiDotNetCore.OpenApi.Client.NSwag}/ApiResponse.cs (98%)
rename src/{JsonApiDotNetCore.OpenApi.Client => JsonApiDotNetCore.OpenApi.Client.NSwag}/ArgumentGuard.cs (90%)
rename src/{JsonApiDotNetCore.OpenApi.Client => JsonApiDotNetCore.OpenApi.Client.NSwag}/AssemblyInfo.cs (100%)
rename src/{JsonApiDotNetCore.OpenApi.Client => JsonApiDotNetCore.OpenApi.Client.NSwag}/IJsonApiClient.cs (95%)
rename src/{JsonApiDotNetCore.OpenApi.Client => JsonApiDotNetCore.OpenApi.Client.NSwag}/JsonApiClient.cs (99%)
rename src/{JsonApiDotNetCore.OpenApi.Client/JsonApiDotNetCore.OpenApi.Client.csproj => JsonApiDotNetCore.OpenApi.Client.NSwag/JsonApiDotNetCore.OpenApi.Client.NSwag.csproj} (93%)
rename src/{JsonApiDotNetCore.OpenApi.Client => JsonApiDotNetCore.OpenApi.Client.NSwag}/UnreachableCodeException.cs (66%)
diff --git a/JsonApiDotNetCore.sln b/JsonApiDotNetCore.sln
index 15ae0a00e3..3c22aa7a4c 100644
--- a/JsonApiDotNetCore.sln
+++ b/JsonApiDotNetCore.sln
@@ -66,7 +66,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCore.OpenApi",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenApiTests", "test\OpenApiTests\OpenApiTests.csproj", "{B693DE14-BB28-496F-AB39-B4E674ABCA80}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCore.OpenApi.Client", "src\JsonApiDotNetCore.OpenApi.Client\JsonApiDotNetCore.OpenApi.Client.csproj", "{5ADAA902-5A75-4ECB-B4B4-03291D63CE9C}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCore.OpenApi.Client.NSwag", "src\JsonApiDotNetCore.OpenApi.Client.NSwag\JsonApiDotNetCore.OpenApi.Client.NSwag.csproj", "{5ADAA902-5A75-4ECB-B4B4-03291D63CE9C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCoreExampleClient", "src\Examples\JsonApiDotNetCoreExampleClient\JsonApiDotNetCoreExampleClient.csproj", "{7FC5DFA3-6F66-4FD8-820D-81E93856F252}"
EndProject
diff --git a/docs/usage/openapi-client.md b/docs/usage/openapi-client.md
index 2acd8f2fe6..3a70004259 100644
--- a/docs/usage/openapi-client.md
+++ b/docs/usage/openapi-client.md
@@ -33,13 +33,13 @@ The next steps describe how to generate a JSON:API client library and use our pa
4. Add our client package to your project:
```
- dotnet add package JsonApiDotNetCore.OpenApi.Client
+ dotnet add package JsonApiDotNetCore.OpenApi.Client.NSwag
```
5. Add the next line inside the **OpenApiReference** section in your project file:
```xml
- /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client
+ /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag
```
6. Add the following glue code to connect our package with your generated code.
@@ -50,7 +50,7 @@ The next steps describe how to generate a JSON:API client library and use our pa
> For example, add `namespace GeneratedCode;` below the `using` lines.
```c#
- using JsonApiDotNetCore.OpenApi.Client;
+ using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
partial class ExampleApiClient : JsonApiClient
@@ -173,7 +173,7 @@ To use [ETags for caching](~/usage/caching.md), NSwag needs extra settings to ma
Specify the following in the `` element of your project file:
```
-/GenerateExceptionClasses:false /WrapResponses:true /GenerateResponseClasses:false /ResponseClass:ApiResponse /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client
+/GenerateExceptionClasses:false /WrapResponses:true /GenerateResponseClasses:false /ResponseClass:ApiResponse /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag
```
This enables the following code, which is explained below:
diff --git a/src/Examples/JsonApiDotNetCoreExampleClient/ExampleApiClient.cs b/src/Examples/JsonApiDotNetCoreExampleClient/ExampleApiClient.cs
index e55e79d97e..56748e8022 100644
--- a/src/Examples/JsonApiDotNetCoreExampleClient/ExampleApiClient.cs
+++ b/src/Examples/JsonApiDotNetCoreExampleClient/ExampleApiClient.cs
@@ -1,5 +1,5 @@
using JetBrains.Annotations;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
namespace JsonApiDotNetCoreExampleClient;
diff --git a/src/Examples/JsonApiDotNetCoreExampleClient/JsonApiDotNetCoreExampleClient.csproj b/src/Examples/JsonApiDotNetCoreExampleClient/JsonApiDotNetCoreExampleClient.csproj
index 326827e86f..17e1376e47 100644
--- a/src/Examples/JsonApiDotNetCoreExampleClient/JsonApiDotNetCoreExampleClient.csproj
+++ b/src/Examples/JsonApiDotNetCoreExampleClient/JsonApiDotNetCoreExampleClient.csproj
@@ -8,7 +8,7 @@
-
+
@@ -25,7 +25,7 @@
- /GenerateExceptionClasses:false /WrapResponses:true /GenerateResponseClasses:false /ResponseClass:ApiResponse /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client
+ /GenerateExceptionClasses:false /WrapResponses:true /GenerateResponseClasses:false /ResponseClass:ApiResponse /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag
diff --git a/src/Examples/JsonApiDotNetCoreExampleClient/Program.cs b/src/Examples/JsonApiDotNetCoreExampleClient/Program.cs
index 7f3926f00c..fcadbc7984 100644
--- a/src/Examples/JsonApiDotNetCoreExampleClient/Program.cs
+++ b/src/Examples/JsonApiDotNetCoreExampleClient/Program.cs
@@ -1,5 +1,5 @@
using System.Net;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using JsonApiDotNetCoreExampleClient;
using Microsoft.Net.Http.Headers;
diff --git a/src/JsonApiDotNetCore.OpenApi.Client/ApiException.cs b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/ApiException.cs
similarity index 96%
rename from src/JsonApiDotNetCore.OpenApi.Client/ApiException.cs
rename to src/JsonApiDotNetCore.OpenApi.Client.NSwag/ApiException.cs
index d05aaeb111..8b66839e9e 100644
--- a/src/JsonApiDotNetCore.OpenApi.Client/ApiException.cs
+++ b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/ApiException.cs
@@ -3,7 +3,7 @@
// We cannot rely on generating ApiException as soon as we are generating multiple clients, see https://github.com/RicoSuter/NSwag/issues/2839#issuecomment-776647377.
// Instead, we configure NSwag to point to the exception below in the generated code.
-namespace JsonApiDotNetCore.OpenApi.Client;
+namespace JsonApiDotNetCore.OpenApi.Client.NSwag;
[UsedImplicitly(ImplicitUseTargetFlags.Members)]
public class ApiException(string message, int statusCode, string? response, IReadOnlyDictionary> headers, Exception? innerException)
diff --git a/src/JsonApiDotNetCore.OpenApi.Client/ApiResponse.cs b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/ApiResponse.cs
similarity index 98%
rename from src/JsonApiDotNetCore.OpenApi.Client/ApiResponse.cs
rename to src/JsonApiDotNetCore.OpenApi.Client.NSwag/ApiResponse.cs
index b719371d58..0961b197b6 100644
--- a/src/JsonApiDotNetCore.OpenApi.Client/ApiResponse.cs
+++ b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/ApiResponse.cs
@@ -1,7 +1,7 @@
using System.Net;
using JetBrains.Annotations;
-namespace JsonApiDotNetCore.OpenApi.Client;
+namespace JsonApiDotNetCore.OpenApi.Client.NSwag;
[PublicAPI]
public class ApiResponse(int statusCode, IReadOnlyDictionary> headers)
diff --git a/src/JsonApiDotNetCore.OpenApi.Client/ArgumentGuard.cs b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/ArgumentGuard.cs
similarity index 90%
rename from src/JsonApiDotNetCore.OpenApi.Client/ArgumentGuard.cs
rename to src/JsonApiDotNetCore.OpenApi.Client.NSwag/ArgumentGuard.cs
index 8d7434f689..282f37ec45 100644
--- a/src/JsonApiDotNetCore.OpenApi.Client/ArgumentGuard.cs
+++ b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/ArgumentGuard.cs
@@ -4,7 +4,7 @@
#pragma warning disable AV1008 // Class should not be static
-namespace JsonApiDotNetCore.OpenApi.Client;
+namespace JsonApiDotNetCore.OpenApi.Client.NSwag;
internal static class ArgumentGuard
{
diff --git a/src/JsonApiDotNetCore.OpenApi.Client/AssemblyInfo.cs b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/AssemblyInfo.cs
similarity index 100%
rename from src/JsonApiDotNetCore.OpenApi.Client/AssemblyInfo.cs
rename to src/JsonApiDotNetCore.OpenApi.Client.NSwag/AssemblyInfo.cs
diff --git a/src/JsonApiDotNetCore.OpenApi.Client/IJsonApiClient.cs b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/IJsonApiClient.cs
similarity index 95%
rename from src/JsonApiDotNetCore.OpenApi.Client/IJsonApiClient.cs
rename to src/JsonApiDotNetCore.OpenApi.Client.NSwag/IJsonApiClient.cs
index 9c71e32380..df6a35d78e 100644
--- a/src/JsonApiDotNetCore.OpenApi.Client/IJsonApiClient.cs
+++ b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/IJsonApiClient.cs
@@ -1,7 +1,9 @@
using System.Linq.Expressions;
+using JetBrains.Annotations;
-namespace JsonApiDotNetCore.OpenApi.Client;
+namespace JsonApiDotNetCore.OpenApi.Client.NSwag;
+[PublicAPI]
public interface IJsonApiClient
{
///
diff --git a/src/JsonApiDotNetCore.OpenApi.Client/JsonApiClient.cs b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/JsonApiClient.cs
similarity index 99%
rename from src/JsonApiDotNetCore.OpenApi.Client/JsonApiClient.cs
rename to src/JsonApiDotNetCore.OpenApi.Client.NSwag/JsonApiClient.cs
index 98ff7a8d91..ea5bc7fddc 100644
--- a/src/JsonApiDotNetCore.OpenApi.Client/JsonApiClient.cs
+++ b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/JsonApiClient.cs
@@ -3,7 +3,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
-namespace JsonApiDotNetCore.OpenApi.Client;
+namespace JsonApiDotNetCore.OpenApi.Client.NSwag;
///
/// Base class to inherit auto-generated OpenAPI clients from. Provides support for partial POST/PATCH in JSON:API requests.
diff --git a/src/JsonApiDotNetCore.OpenApi.Client/JsonApiDotNetCore.OpenApi.Client.csproj b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/JsonApiDotNetCore.OpenApi.Client.NSwag.csproj
similarity index 93%
rename from src/JsonApiDotNetCore.OpenApi.Client/JsonApiDotNetCore.OpenApi.Client.csproj
rename to src/JsonApiDotNetCore.OpenApi.Client.NSwag/JsonApiDotNetCore.OpenApi.Client.NSwag.csproj
index 8feec15c9b..a77e9c28dd 100644
--- a/src/JsonApiDotNetCore.OpenApi.Client/JsonApiDotNetCore.OpenApi.Client.csproj
+++ b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/JsonApiDotNetCore.OpenApi.Client.NSwag.csproj
@@ -11,7 +11,7 @@
$(JsonApiDotNetCoreVersionPrefix)
jsonapidotnetcore;jsonapi;json:api;dotnet;asp.net;rest;web-api;openapi;swagger;client;nswag
- Provides support for OpenAPI generated clients in sending partial POST/PATCH requests against JSON:API endpoints.
+ Provides OpenAPI support for JSON:API generated clients using NSwag.
json-api-dotnet
https://www.jsonapi.net/
MIT
diff --git a/src/JsonApiDotNetCore.OpenApi.Client/UnreachableCodeException.cs b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/UnreachableCodeException.cs
similarity index 66%
rename from src/JsonApiDotNetCore.OpenApi.Client/UnreachableCodeException.cs
rename to src/JsonApiDotNetCore.OpenApi.Client.NSwag/UnreachableCodeException.cs
index 9778290d7d..137db782f5 100644
--- a/src/JsonApiDotNetCore.OpenApi.Client/UnreachableCodeException.cs
+++ b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/UnreachableCodeException.cs
@@ -1,3 +1,3 @@
-namespace JsonApiDotNetCore.OpenApi.Client;
+namespace JsonApiDotNetCore.OpenApi.Client.NSwag;
internal sealed class UnreachableCodeException() : Exception("This code should not be reachable.");
diff --git a/test/OpenApiClientTests/BaseOpenApiClientTests.cs b/test/OpenApiClientTests/BaseOpenApiClientTests.cs
index 6ebfa04e18..1d557a8410 100644
--- a/test/OpenApiClientTests/BaseOpenApiClientTests.cs
+++ b/test/OpenApiClientTests/BaseOpenApiClientTests.cs
@@ -1,6 +1,6 @@
using System.Linq.Expressions;
using System.Reflection;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
namespace OpenApiClientTests;
diff --git a/test/OpenApiClientTests/FakeHttpClientWrapper.cs b/test/OpenApiClientTests/FakeHttpClientWrapper.cs
index c965d30b0d..50ca8d7966 100644
--- a/test/OpenApiClientTests/FakeHttpClientWrapper.cs
+++ b/test/OpenApiClientTests/FakeHttpClientWrapper.cs
@@ -2,7 +2,7 @@
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
namespace OpenApiClientTests;
diff --git a/test/OpenApiClientTests/LegacyClient/GeneratedCode/IOpenApiClient.cs b/test/OpenApiClientTests/LegacyClient/GeneratedCode/IOpenApiClient.cs
index 82a29a09d0..0c7ccd4d4b 100644
--- a/test/OpenApiClientTests/LegacyClient/GeneratedCode/IOpenApiClient.cs
+++ b/test/OpenApiClientTests/LegacyClient/GeneratedCode/IOpenApiClient.cs
@@ -1,4 +1,4 @@
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
namespace OpenApiClientTests.LegacyClient.GeneratedCode;
diff --git a/test/OpenApiClientTests/LegacyClient/GeneratedCode/OpenApiClient.cs b/test/OpenApiClientTests/LegacyClient/GeneratedCode/OpenApiClient.cs
index c8592a563c..1fc05e7169 100644
--- a/test/OpenApiClientTests/LegacyClient/GeneratedCode/OpenApiClient.cs
+++ b/test/OpenApiClientTests/LegacyClient/GeneratedCode/OpenApiClient.cs
@@ -1,4 +1,4 @@
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
namespace OpenApiClientTests.LegacyClient.GeneratedCode;
diff --git a/test/OpenApiClientTests/LegacyClient/PartialAttributeSerializationLifetimeTests.cs b/test/OpenApiClientTests/LegacyClient/PartialAttributeSerializationLifetimeTests.cs
index 9b4d5b7fae..005d025a5f 100644
--- a/test/OpenApiClientTests/LegacyClient/PartialAttributeSerializationLifetimeTests.cs
+++ b/test/OpenApiClientTests/LegacyClient/PartialAttributeSerializationLifetimeTests.cs
@@ -1,6 +1,6 @@
using System.Net;
using FluentAssertions;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using OpenApiClientTests.LegacyClient.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
diff --git a/test/OpenApiClientTests/LegacyClient/RequestTests.cs b/test/OpenApiClientTests/LegacyClient/RequestTests.cs
index 7a8edc786f..19d9b805cd 100644
--- a/test/OpenApiClientTests/LegacyClient/RequestTests.cs
+++ b/test/OpenApiClientTests/LegacyClient/RequestTests.cs
@@ -3,7 +3,7 @@
using FluentAssertions.Common;
using FluentAssertions.Extensions;
using JsonApiDotNetCore.Middleware;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Microsoft.Net.Http.Headers;
using OpenApiClientTests.LegacyClient.GeneratedCode;
using TestBuildingBlocks;
diff --git a/test/OpenApiClientTests/LegacyClient/ResponseTests.cs b/test/OpenApiClientTests/LegacyClient/ResponseTests.cs
index a93789dea1..ac91774a96 100644
--- a/test/OpenApiClientTests/LegacyClient/ResponseTests.cs
+++ b/test/OpenApiClientTests/LegacyClient/ResponseTests.cs
@@ -1,7 +1,7 @@
using System.Globalization;
using System.Net;
using FluentAssertions;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using OpenApiClientTests.LegacyClient.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
diff --git a/test/OpenApiClientTests/ObjectExtensions.cs b/test/OpenApiClientTests/ObjectExtensions.cs
index 3f2633f5ff..82c3309ed6 100644
--- a/test/OpenApiClientTests/ObjectExtensions.cs
+++ b/test/OpenApiClientTests/ObjectExtensions.cs
@@ -1,5 +1,5 @@
using System.Reflection;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
namespace OpenApiClientTests;
diff --git a/test/OpenApiClientTests/OpenApiClientTests.csproj b/test/OpenApiClientTests/OpenApiClientTests.csproj
index 6d2fb45151..6ec90e4c2d 100644
--- a/test/OpenApiClientTests/OpenApiClientTests.csproj
+++ b/test/OpenApiClientTests/OpenApiClientTests.csproj
@@ -7,7 +7,7 @@
-
+
@@ -28,56 +28,56 @@
OpenApiClient
OpenApiClient.cs
NSwagCSharp
- /GenerateClientInterfaces:true /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client
+ /GenerateClientInterfaces:true /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag
OpenApiClientTests.NamingConventions.KebabCase.GeneratedCode
KebabCaseClient
KebabCaseClient.cs
NSwagCSharp
- /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client
+ /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag
OpenApiClientTests.NamingConventions.CamelCase.GeneratedCode
CamelCaseClient
CamelCaseClient.cs
NSwagCSharp
- /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client
+ /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag
OpenApiClientTests.NamingConventions.PascalCase.GeneratedCode
PascalCaseClient
PascalCaseClient.cs
NSwagCSharp
- /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client
+ /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag
NrtOffMsvOffClient
NrtOffMsvOffClient.cs
NSwagCSharp
OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff.GeneratedCode
- /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client /GenerateNullableReferenceTypes:false
+ /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag /GenerateNullableReferenceTypes:false
NrtOffMsvOnClient
NrtOffMsvOnClient.cs
NSwagCSharp
OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn.GeneratedCode
- /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client /GenerateNullableReferenceTypes:false
+ /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag /GenerateNullableReferenceTypes:false
NrtOnMsvOffClient
NrtOnMsvOffClient.cs
NSwagCSharp
OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff.GeneratedCode
- /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client /GenerateNullableReferenceTypes:true
+ /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag /GenerateNullableReferenceTypes:true
NrtOnMsvOnClient
NrtOnMsvOnClient.cs
NSwagCSharp
OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn.GeneratedCode
- /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client /GenerateNullableReferenceTypes:true
+ /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag /GenerateNullableReferenceTypes:true
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/CreateResourceTests.cs b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/CreateResourceTests.cs
index 5dbc88c8b2..43b004270c 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/CreateResourceTests.cs
+++ b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/CreateResourceTests.cs
@@ -3,7 +3,7 @@
using System.Text.Json;
using FluentAssertions;
using FluentAssertions.Specialized;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff.GeneratedCode;
using TestBuildingBlocks;
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedCode/NrtOffMsvOffClient.cs b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedCode/NrtOffMsvOffClient.cs
index f3ee9a9c53..0156947ea3 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedCode/NrtOffMsvOffClient.cs
+++ b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedCode/NrtOffMsvOffClient.cs
@@ -1,4 +1,4 @@
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff.GeneratedCode;
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/UpdateResourceTests.cs b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/UpdateResourceTests.cs
index 720a4821c5..78bf09c4d7 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/UpdateResourceTests.cs
+++ b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/UpdateResourceTests.cs
@@ -2,7 +2,7 @@
using System.Text.Json;
using FluentAssertions;
using FluentAssertions.Specialized;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff.GeneratedCode;
using TestBuildingBlocks;
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/CreateResourceTests.cs b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/CreateResourceTests.cs
index c8c1908070..3bb6b73a49 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/CreateResourceTests.cs
+++ b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/CreateResourceTests.cs
@@ -3,7 +3,7 @@
using System.Text.Json;
using FluentAssertions;
using FluentAssertions.Specialized;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn.GeneratedCode;
using TestBuildingBlocks;
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedCode/NrtOffMsvOnClient.cs b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedCode/NrtOffMsvOnClient.cs
index a722c5d49b..e0764a8fb1 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedCode/NrtOffMsvOnClient.cs
+++ b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedCode/NrtOffMsvOnClient.cs
@@ -1,4 +1,4 @@
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn.GeneratedCode;
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/UpdateResourceTests.cs b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/UpdateResourceTests.cs
index 9c7689c509..747253589a 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/UpdateResourceTests.cs
+++ b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/UpdateResourceTests.cs
@@ -2,7 +2,7 @@
using System.Text.Json;
using FluentAssertions;
using FluentAssertions.Specialized;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn.GeneratedCode;
using TestBuildingBlocks;
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/CreateResourceTests.cs b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/CreateResourceTests.cs
index 1810d76ade..83497f38b6 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/CreateResourceTests.cs
+++ b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/CreateResourceTests.cs
@@ -3,7 +3,7 @@
using System.Text.Json;
using FluentAssertions;
using FluentAssertions.Specialized;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff.GeneratedCode;
using TestBuildingBlocks;
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedCode/NrtOnMsvOffClient.cs b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedCode/NrtOnMsvOffClient.cs
index 77b0854984..0b056a3dc1 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedCode/NrtOnMsvOffClient.cs
+++ b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedCode/NrtOnMsvOffClient.cs
@@ -1,4 +1,4 @@
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff.GeneratedCode;
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/UpdateResourceTests.cs b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/UpdateResourceTests.cs
index 0e5b532aa2..f61aa6b497 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/UpdateResourceTests.cs
+++ b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/UpdateResourceTests.cs
@@ -2,7 +2,7 @@
using System.Text.Json;
using FluentAssertions;
using FluentAssertions.Specialized;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff.GeneratedCode;
using TestBuildingBlocks;
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/CreateResourceTests.cs b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/CreateResourceTests.cs
index c7d70892cc..d5ef2ccdc1 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/CreateResourceTests.cs
+++ b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/CreateResourceTests.cs
@@ -3,7 +3,7 @@
using System.Text.Json;
using FluentAssertions;
using FluentAssertions.Specialized;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn.GeneratedCode;
using TestBuildingBlocks;
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedCode/NrtOnMsvOnClient.cs b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedCode/NrtOnMsvOnClient.cs
index 6679b1c168..6e43419714 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedCode/NrtOnMsvOnClient.cs
+++ b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedCode/NrtOnMsvOnClient.cs
@@ -1,4 +1,4 @@
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn.GeneratedCode;
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/UpdateResourceTests.cs b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/UpdateResourceTests.cs
index 153aadc426..5fb1932f95 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/UpdateResourceTests.cs
+++ b/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/UpdateResourceTests.cs
@@ -2,7 +2,7 @@
using System.Text.Json;
using FluentAssertions;
using FluentAssertions.Specialized;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn.GeneratedCode;
using TestBuildingBlocks;
diff --git a/test/OpenApiEndToEndTests/Headers/ETagTests.cs b/test/OpenApiEndToEndTests/Headers/ETagTests.cs
index 97a4dd9467..ee6e386308 100644
--- a/test/OpenApiEndToEndTests/Headers/ETagTests.cs
+++ b/test/OpenApiEndToEndTests/Headers/ETagTests.cs
@@ -1,6 +1,6 @@
using System.Net;
using FluentAssertions;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Microsoft.Net.Http.Headers;
using OpenApiEndToEndTests.Headers.GeneratedCode;
using OpenApiTests;
diff --git a/test/OpenApiEndToEndTests/OpenApiEndToEndTests.csproj b/test/OpenApiEndToEndTests/OpenApiEndToEndTests.csproj
index 6566c17b4b..04b7fbecee 100644
--- a/test/OpenApiEndToEndTests/OpenApiEndToEndTests.csproj
+++ b/test/OpenApiEndToEndTests/OpenApiEndToEndTests.csproj
@@ -7,7 +7,7 @@
-
+
@@ -28,14 +28,14 @@
HeadersClient
HeadersClient.cs
NSwagCSharp
- /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /WrapResponses:true /GenerateResponseClasses:false /ResponseClass:ApiResponse /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client /GenerateNullableReferenceTypes:true
+ /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /WrapResponses:true /GenerateResponseClasses:false /ResponseClass:ApiResponse /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag /GenerateNullableReferenceTypes:true
OpenApiEndToEndTests.QueryStrings.GeneratedCode
QueryStringsClient
QueryStringsClient.cs
NSwagCSharp
- /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client /GenerateNullableReferenceTypes:true
+ /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag /GenerateNullableReferenceTypes:true
diff --git a/test/OpenApiEndToEndTests/QueryStrings/FilterTests.cs b/test/OpenApiEndToEndTests/QueryStrings/FilterTests.cs
index b4e2d82ebe..524b7f2496 100644
--- a/test/OpenApiEndToEndTests/QueryStrings/FilterTests.cs
+++ b/test/OpenApiEndToEndTests/QueryStrings/FilterTests.cs
@@ -1,6 +1,6 @@
using System.Net;
using FluentAssertions;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using OpenApiEndToEndTests.QueryStrings.GeneratedCode;
using OpenApiTests;
using OpenApiTests.QueryStrings;
diff --git a/test/OpenApiEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs b/test/OpenApiEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs
index 8a90cfa0f5..eb0b3e32b2 100644
--- a/test/OpenApiEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs
+++ b/test/OpenApiEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs
@@ -1,4 +1,4 @@
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using TestBuildingBlocks;
diff --git a/test/OpenApiEndToEndTests/QueryStrings/PaginationTests.cs b/test/OpenApiEndToEndTests/QueryStrings/PaginationTests.cs
index 35eb780024..0ed5075075 100644
--- a/test/OpenApiEndToEndTests/QueryStrings/PaginationTests.cs
+++ b/test/OpenApiEndToEndTests/QueryStrings/PaginationTests.cs
@@ -1,6 +1,6 @@
using System.Net;
using FluentAssertions;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using OpenApiEndToEndTests.QueryStrings.GeneratedCode;
using OpenApiTests;
using OpenApiTests.QueryStrings;
diff --git a/test/OpenApiEndToEndTests/QueryStrings/SortTests.cs b/test/OpenApiEndToEndTests/QueryStrings/SortTests.cs
index e988989632..23b57b7249 100644
--- a/test/OpenApiEndToEndTests/QueryStrings/SortTests.cs
+++ b/test/OpenApiEndToEndTests/QueryStrings/SortTests.cs
@@ -1,6 +1,6 @@
using System.Net;
using FluentAssertions;
-using JsonApiDotNetCore.OpenApi.Client;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
using OpenApiEndToEndTests.QueryStrings.GeneratedCode;
using OpenApiTests;
using OpenApiTests.QueryStrings;
From 04da44105f1a8554203e39946a3947e3cf6427e1 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 24 Feb 2024 11:37:14 +0100
Subject: [PATCH 02/17] Rename test and example projects to include NSwag in
their names
---
JsonApiDotNetCore.sln | 6 +++---
docs/usage/openapi-client.md | 2 +-
.../ColoredConsoleLogDelegatingHandler.cs | 2 +-
.../ExampleApiClient.cs | 2 +-
.../OpenApiNSwagClientExample.csproj} | 0
.../Program.cs | 2 +-
.../AssemblyInfo.cs | 2 +-
.../.editorconfig | 0
.../BaseOpenApiNSwagClientTests.cs} | 4 ++--
.../FakeHttpClientWrapper.cs | 2 +-
.../FakerFactory.cs | 2 +-
.../LegacyClient/GeneratedCode/IOpenApiClient.cs | 2 +-
.../LegacyClient/GeneratedCode/OpenApiClient.cs | 2 +-
...PartialAttributeSerializationLifetimeTests.cs | 4 ++--
.../LegacyClient/RequestTests.cs | 4 ++--
.../LegacyClient/ResponseTests.cs | 4 ++--
.../LegacyClient/swagger.g.json | 0
.../CamelCase}/GeneratedTypesTests.cs | 6 +++---
.../NamingConventions/CamelCase/swagger.g.json | 0
.../KebabCase}/GeneratedTypesTests.cs | 6 +++---
.../NamingConventions/KebabCase/swagger.g.json | 0
.../PascalCase}/GeneratedTypesTests.cs | 6 +++---
.../NamingConventions/PascalCase/swagger.g.json | 0
.../ObjectExtensions.cs | 2 +-
.../OpenApiNSwagClientTests.csproj} | 16 ++++++++--------
.../PropertyInfoAssertionsExtensions.cs | 2 +-
.../CreateResourceTests.cs | 6 +++---
.../GeneratedCode/NrtOffMsvOffClient.cs | 2 +-
.../NrtOffMsvOffFakers.cs | 4 ++--
.../ModelStateValidationOff/NullabilityTests.cs | 4 ++--
.../UpdateResourceTests.cs | 6 +++---
.../ModelStateValidationOff/swagger.g.json | 0
.../CreateResourceTests.cs | 6 +++---
.../GeneratedCode/NrtOffMsvOnClient.cs | 2 +-
.../ModelStateValidationOn/NrtOffMsvOnFakers.cs | 4 ++--
.../ModelStateValidationOn/NullabilityTests.cs | 4 ++--
.../UpdateResourceTests.cs | 6 +++---
.../ModelStateValidationOn/swagger.g.json | 0
.../CreateResourceTests.cs | 6 +++---
.../GeneratedCode/NrtOnMsvOffClient.cs | 2 +-
.../ModelStateValidationOff/NrtOnMsvOffFakers.cs | 4 ++--
.../ModelStateValidationOff/NullabilityTests.cs | 4 ++--
.../UpdateResourceTests.cs | 6 +++---
.../ModelStateValidationOff/swagger.g.json | 0
.../CreateResourceTests.cs | 6 +++---
.../GeneratedCode/NrtOnMsvOnClient.cs | 2 +-
.../ModelStateValidationOn/NrtOnMsvOnFakers.cs | 4 ++--
.../ModelStateValidationOn/NullabilityTests.cs | 4 ++--
.../UpdateResourceTests.cs | 6 +++---
.../ModelStateValidationOn/swagger.g.json | 0
.../.editorconfig | 0
.../Headers/ETagTests.cs | 4 ++--
.../Headers/swagger.g.json | 0
.../OpenApiNSwagEndToEndTests.csproj} | 4 ++--
.../QueryStrings/FilterTests.cs | 4 ++--
.../GeneratedCode/QueryStringsClient.cs | 2 +-
.../QueryStrings/IncludeTests.cs | 4 ++--
.../QueryStrings/PaginationTests.cs | 4 ++--
.../QueryStrings/SortTests.cs | 4 ++--
.../QueryStrings/SparseFieldSetTests.cs | 4 ++--
.../QueryStrings/swagger.g.json | 0
test/OpenApiTests/Headers/HeaderTests.cs | 2 +-
.../LegacyOpenApiIntegrationTests.cs | 2 +-
.../CamelCase/CamelCaseTests.cs | 2 +-
.../KebabCase/KebabCaseTests.cs | 2 +-
.../PascalCase/PascalCaseTests.cs | 2 +-
.../QueryStrings/QueryStringTests.cs | 2 +-
.../ModelStateValidationOff/NullabilityTests.cs | 2 +-
.../ModelStateValidationOn/NullabilityTests.cs | 2 +-
.../ModelStateValidationOff/NullabilityTests.cs | 2 +-
.../ModelStateValidationOn/NullabilityTests.cs | 2 +-
71 files changed, 108 insertions(+), 108 deletions(-)
rename src/Examples/{JsonApiDotNetCoreExampleClient => OpenApiNSwagClientExample}/ColoredConsoleLogDelegatingHandler.cs (97%)
rename src/Examples/{JsonApiDotNetCoreExampleClient => OpenApiNSwagClientExample}/ExampleApiClient.cs (90%)
rename src/Examples/{JsonApiDotNetCoreExampleClient/JsonApiDotNetCoreExampleClient.csproj => OpenApiNSwagClientExample/OpenApiNSwagClientExample.csproj} (100%)
rename src/Examples/{JsonApiDotNetCoreExampleClient => OpenApiNSwagClientExample}/Program.cs (98%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/.editorconfig (100%)
rename test/{OpenApiClientTests/BaseOpenApiClientTests.cs => OpenApiNSwagClientTests/BaseOpenApiNSwagClientTests.cs} (97%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/FakeHttpClientWrapper.cs (98%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/FakerFactory.cs (98%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/LegacyClient/GeneratedCode/IOpenApiClient.cs (71%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/LegacyClient/GeneratedCode/OpenApiClient.cs (83%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/LegacyClient/PartialAttributeSerializationLifetimeTests.cs (99%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/LegacyClient/RequestTests.cs (99%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/LegacyClient/ResponseTests.cs (99%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/LegacyClient/swagger.g.json (100%)
rename test/{OpenApiClientTests/NamingConventions/PascalCase => OpenApiNSwagClientTests/NamingConventions/CamelCase}/GeneratedTypesTests.cs (96%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/NamingConventions/CamelCase/swagger.g.json (100%)
rename test/{OpenApiClientTests/NamingConventions/CamelCase => OpenApiNSwagClientTests/NamingConventions/KebabCase}/GeneratedTypesTests.cs (96%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/NamingConventions/KebabCase/swagger.g.json (100%)
rename test/{OpenApiClientTests/NamingConventions/KebabCase => OpenApiNSwagClientTests/NamingConventions/PascalCase}/GeneratedTypesTests.cs (96%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/NamingConventions/PascalCase/swagger.g.json (100%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ObjectExtensions.cs (96%)
rename test/{OpenApiClientTests/OpenApiClientTests.csproj => OpenApiNSwagClientTests/OpenApiNSwagClientTests.csproj} (84%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/PropertyInfoAssertionsExtensions.cs (95%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/CreateResourceTests.cs (97%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedCode/NrtOffMsvOffClient.cs (72%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NrtOffMsvOffFakers.cs (83%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs (90%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/UpdateResourceTests.cs (94%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/swagger.g.json (100%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/CreateResourceTests.cs (97%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedCode/NrtOffMsvOnClient.cs (72%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NrtOffMsvOnFakers.cs (86%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs (90%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/UpdateResourceTests.cs (94%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/swagger.g.json (100%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/CreateResourceTests.cs (98%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedCode/NrtOnMsvOffClient.cs (72%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NrtOnMsvOffFakers.cs (86%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs (91%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/UpdateResourceTests.cs (95%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/swagger.g.json (100%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/CreateResourceTests.cs (98%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedCode/NrtOnMsvOnClient.cs (72%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NrtOnMsvOnFakers.cs (86%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs (91%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/UpdateResourceTests.cs (95%)
rename test/{OpenApiClientTests => OpenApiNSwagClientTests}/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/swagger.g.json (100%)
rename test/{OpenApiEndToEndTests => OpenApiNSwagEndToEndTests}/.editorconfig (100%)
rename test/{OpenApiEndToEndTests => OpenApiNSwagEndToEndTests}/Headers/ETagTests.cs (98%)
rename test/{OpenApiEndToEndTests => OpenApiNSwagEndToEndTests}/Headers/swagger.g.json (100%)
rename test/{OpenApiEndToEndTests/OpenApiEndToEndTests.csproj => OpenApiNSwagEndToEndTests/OpenApiNSwagEndToEndTests.csproj} (94%)
rename test/{OpenApiEndToEndTests => OpenApiNSwagEndToEndTests}/QueryStrings/FilterTests.cs (98%)
rename test/{OpenApiEndToEndTests => OpenApiNSwagEndToEndTests}/QueryStrings/GeneratedCode/QueryStringsClient.cs (96%)
rename test/{OpenApiEndToEndTests => OpenApiNSwagEndToEndTests}/QueryStrings/IncludeTests.cs (98%)
rename test/{OpenApiEndToEndTests => OpenApiNSwagEndToEndTests}/QueryStrings/PaginationTests.cs (98%)
rename test/{OpenApiEndToEndTests => OpenApiNSwagEndToEndTests}/QueryStrings/SortTests.cs (98%)
rename test/{OpenApiEndToEndTests => OpenApiNSwagEndToEndTests}/QueryStrings/SparseFieldSetTests.cs (98%)
rename test/{OpenApiEndToEndTests => OpenApiNSwagEndToEndTests}/QueryStrings/swagger.g.json (100%)
diff --git a/JsonApiDotNetCore.sln b/JsonApiDotNetCore.sln
index 3c22aa7a4c..857e908e1c 100644
--- a/JsonApiDotNetCore.sln
+++ b/JsonApiDotNetCore.sln
@@ -68,11 +68,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenApiTests", "test\OpenAp
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCore.OpenApi.Client.NSwag", "src\JsonApiDotNetCore.OpenApi.Client.NSwag\JsonApiDotNetCore.OpenApi.Client.NSwag.csproj", "{5ADAA902-5A75-4ECB-B4B4-03291D63CE9C}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonApiDotNetCoreExampleClient", "src\Examples\JsonApiDotNetCoreExampleClient\JsonApiDotNetCoreExampleClient.csproj", "{7FC5DFA3-6F66-4FD8-820D-81E93856F252}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenApiNSwagClientExample", "src\Examples\OpenApiNSwagClientExample\OpenApiNSwagClientExample.csproj", "{7FC5DFA3-6F66-4FD8-820D-81E93856F252}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenApiClientTests", "test\OpenApiClientTests\OpenApiClientTests.csproj", "{77F98215-3085-422E-B99D-4C404C2114CF}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenApiNSwagClientTests", "test\OpenApiNSwagClientTests\OpenApiNSwagClientTests.csproj", "{77F98215-3085-422E-B99D-4C404C2114CF}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenApiEndToEndTests", "test\OpenApiEndToEndTests\OpenApiEndToEndTests.csproj", "{3BA4F9B9-3D90-44B5-B09C-28D98E0B4225}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenApiNSwagEndToEndTests", "test\OpenApiNSwagEndToEndTests\OpenApiNSwagEndToEndTests.csproj", "{3BA4F9B9-3D90-44B5-B09C-28D98E0B4225}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/docs/usage/openapi-client.md b/docs/usage/openapi-client.md
index 3a70004259..dcdec89b94 100644
--- a/docs/usage/openapi-client.md
+++ b/docs/usage/openapi-client.md
@@ -63,7 +63,7 @@ The next steps describe how to generate a JSON:API client library and use our pa
```
> [!TIP]
- > The project at src/Examples/JsonApiDotNetCoreExampleClient contains an enhanced version that logs the HTTP requests and responses.
+ > The project at src/Examples/OpenApiNSwagClientExample contains an enhanced version that logs the HTTP requests and responses.
> Additionally, the example shows how to write the swagger.json file to disk when building the server, which is imported from the client project. This keeps the server and client automatically in sync, which is handy when both are in the same solution.
7. Add code that calls one of your JSON:API endpoints.
diff --git a/src/Examples/JsonApiDotNetCoreExampleClient/ColoredConsoleLogDelegatingHandler.cs b/src/Examples/OpenApiNSwagClientExample/ColoredConsoleLogDelegatingHandler.cs
similarity index 97%
rename from src/Examples/JsonApiDotNetCoreExampleClient/ColoredConsoleLogDelegatingHandler.cs
rename to src/Examples/OpenApiNSwagClientExample/ColoredConsoleLogDelegatingHandler.cs
index 88679e112f..ab505324c3 100644
--- a/src/Examples/JsonApiDotNetCoreExampleClient/ColoredConsoleLogDelegatingHandler.cs
+++ b/src/Examples/OpenApiNSwagClientExample/ColoredConsoleLogDelegatingHandler.cs
@@ -1,6 +1,6 @@
using JetBrains.Annotations;
-namespace JsonApiDotNetCoreExampleClient;
+namespace OpenApiNSwagClientExample;
///
/// Writes incoming and outgoing HTTP messages to the console.
diff --git a/src/Examples/JsonApiDotNetCoreExampleClient/ExampleApiClient.cs b/src/Examples/OpenApiNSwagClientExample/ExampleApiClient.cs
similarity index 90%
rename from src/Examples/JsonApiDotNetCoreExampleClient/ExampleApiClient.cs
rename to src/Examples/OpenApiNSwagClientExample/ExampleApiClient.cs
index 56748e8022..c60fb8f50f 100644
--- a/src/Examples/JsonApiDotNetCoreExampleClient/ExampleApiClient.cs
+++ b/src/Examples/OpenApiNSwagClientExample/ExampleApiClient.cs
@@ -2,7 +2,7 @@
using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
-namespace JsonApiDotNetCoreExampleClient;
+namespace OpenApiNSwagClientExample;
[UsedImplicitly(ImplicitUseTargetFlags.Itself)]
public partial class ExampleApiClient : JsonApiClient
diff --git a/src/Examples/JsonApiDotNetCoreExampleClient/JsonApiDotNetCoreExampleClient.csproj b/src/Examples/OpenApiNSwagClientExample/OpenApiNSwagClientExample.csproj
similarity index 100%
rename from src/Examples/JsonApiDotNetCoreExampleClient/JsonApiDotNetCoreExampleClient.csproj
rename to src/Examples/OpenApiNSwagClientExample/OpenApiNSwagClientExample.csproj
diff --git a/src/Examples/JsonApiDotNetCoreExampleClient/Program.cs b/src/Examples/OpenApiNSwagClientExample/Program.cs
similarity index 98%
rename from src/Examples/JsonApiDotNetCoreExampleClient/Program.cs
rename to src/Examples/OpenApiNSwagClientExample/Program.cs
index fcadbc7984..53dadd1a84 100644
--- a/src/Examples/JsonApiDotNetCoreExampleClient/Program.cs
+++ b/src/Examples/OpenApiNSwagClientExample/Program.cs
@@ -1,7 +1,7 @@
using System.Net;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
-using JsonApiDotNetCoreExampleClient;
using Microsoft.Net.Http.Headers;
+using OpenApiNSwagClientExample;
#if DEBUG
using var httpClient = new HttpClient(new ColoredConsoleLogDelegatingHandler
diff --git a/src/JsonApiDotNetCore.OpenApi.Client.NSwag/AssemblyInfo.cs b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/AssemblyInfo.cs
index 2871965d43..1ac53bb335 100644
--- a/src/JsonApiDotNetCore.OpenApi.Client.NSwag/AssemblyInfo.cs
+++ b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/AssemblyInfo.cs
@@ -1,3 +1,3 @@
using System.Runtime.CompilerServices;
-[assembly: InternalsVisibleTo("OpenApiClientTests")]
+[assembly: InternalsVisibleTo("OpenApiNSwagClientTests")]
diff --git a/test/OpenApiClientTests/.editorconfig b/test/OpenApiNSwagClientTests/.editorconfig
similarity index 100%
rename from test/OpenApiClientTests/.editorconfig
rename to test/OpenApiNSwagClientTests/.editorconfig
diff --git a/test/OpenApiClientTests/BaseOpenApiClientTests.cs b/test/OpenApiNSwagClientTests/BaseOpenApiNSwagClientTests.cs
similarity index 97%
rename from test/OpenApiClientTests/BaseOpenApiClientTests.cs
rename to test/OpenApiNSwagClientTests/BaseOpenApiNSwagClientTests.cs
index 1d557a8410..828d368c7e 100644
--- a/test/OpenApiClientTests/BaseOpenApiClientTests.cs
+++ b/test/OpenApiNSwagClientTests/BaseOpenApiNSwagClientTests.cs
@@ -2,9 +2,9 @@
using System.Reflection;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
-namespace OpenApiClientTests;
+namespace OpenApiNSwagClientTests;
-public abstract class BaseOpenApiClientTests
+public abstract class BaseOpenApiNSwagClientTests
{
private const string AttributesObjectParameterName = "attributesObject";
diff --git a/test/OpenApiClientTests/FakeHttpClientWrapper.cs b/test/OpenApiNSwagClientTests/FakeHttpClientWrapper.cs
similarity index 98%
rename from test/OpenApiClientTests/FakeHttpClientWrapper.cs
rename to test/OpenApiNSwagClientTests/FakeHttpClientWrapper.cs
index 50ca8d7966..05631bcf53 100644
--- a/test/OpenApiClientTests/FakeHttpClientWrapper.cs
+++ b/test/OpenApiNSwagClientTests/FakeHttpClientWrapper.cs
@@ -4,7 +4,7 @@
using System.Text.Json;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
-namespace OpenApiClientTests;
+namespace OpenApiNSwagClientTests;
///
/// Enables to inject an outgoing response body and inspect the incoming request.
diff --git a/test/OpenApiClientTests/FakerFactory.cs b/test/OpenApiNSwagClientTests/FakerFactory.cs
similarity index 98%
rename from test/OpenApiClientTests/FakerFactory.cs
rename to test/OpenApiNSwagClientTests/FakerFactory.cs
index 74b6a81223..b13be6f795 100644
--- a/test/OpenApiClientTests/FakerFactory.cs
+++ b/test/OpenApiNSwagClientTests/FakerFactory.cs
@@ -3,7 +3,7 @@
using JetBrains.Annotations;
using TestBuildingBlocks;
-namespace OpenApiClientTests;
+namespace OpenApiNSwagClientTests;
internal sealed class FakerFactory
{
diff --git a/test/OpenApiClientTests/LegacyClient/GeneratedCode/IOpenApiClient.cs b/test/OpenApiNSwagClientTests/LegacyClient/GeneratedCode/IOpenApiClient.cs
similarity index 71%
rename from test/OpenApiClientTests/LegacyClient/GeneratedCode/IOpenApiClient.cs
rename to test/OpenApiNSwagClientTests/LegacyClient/GeneratedCode/IOpenApiClient.cs
index 0c7ccd4d4b..0f6f05177b 100644
--- a/test/OpenApiClientTests/LegacyClient/GeneratedCode/IOpenApiClient.cs
+++ b/test/OpenApiNSwagClientTests/LegacyClient/GeneratedCode/IOpenApiClient.cs
@@ -1,6 +1,6 @@
using JsonApiDotNetCore.OpenApi.Client.NSwag;
-namespace OpenApiClientTests.LegacyClient.GeneratedCode;
+namespace OpenApiNSwagClientTests.LegacyClient.GeneratedCode;
// ReSharper disable once MemberCanBeInternal
public partial interface IOpenApiClient : IJsonApiClient;
diff --git a/test/OpenApiClientTests/LegacyClient/GeneratedCode/OpenApiClient.cs b/test/OpenApiNSwagClientTests/LegacyClient/GeneratedCode/OpenApiClient.cs
similarity index 83%
rename from test/OpenApiClientTests/LegacyClient/GeneratedCode/OpenApiClient.cs
rename to test/OpenApiNSwagClientTests/LegacyClient/GeneratedCode/OpenApiClient.cs
index 1fc05e7169..3f1b385d9e 100644
--- a/test/OpenApiClientTests/LegacyClient/GeneratedCode/OpenApiClient.cs
+++ b/test/OpenApiNSwagClientTests/LegacyClient/GeneratedCode/OpenApiClient.cs
@@ -1,7 +1,7 @@
using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
-namespace OpenApiClientTests.LegacyClient.GeneratedCode;
+namespace OpenApiNSwagClientTests.LegacyClient.GeneratedCode;
internal partial class OpenApiClient : JsonApiClient
{
diff --git a/test/OpenApiClientTests/LegacyClient/PartialAttributeSerializationLifetimeTests.cs b/test/OpenApiNSwagClientTests/LegacyClient/PartialAttributeSerializationLifetimeTests.cs
similarity index 99%
rename from test/OpenApiClientTests/LegacyClient/PartialAttributeSerializationLifetimeTests.cs
rename to test/OpenApiNSwagClientTests/LegacyClient/PartialAttributeSerializationLifetimeTests.cs
index 005d025a5f..9019111e9a 100644
--- a/test/OpenApiClientTests/LegacyClient/PartialAttributeSerializationLifetimeTests.cs
+++ b/test/OpenApiNSwagClientTests/LegacyClient/PartialAttributeSerializationLifetimeTests.cs
@@ -1,11 +1,11 @@
using System.Net;
using FluentAssertions;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
-using OpenApiClientTests.LegacyClient.GeneratedCode;
+using OpenApiNSwagClientTests.LegacyClient.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
-namespace OpenApiClientTests.LegacyClient;
+namespace OpenApiNSwagClientTests.LegacyClient;
public sealed class PartialAttributeSerializationLifetimeTests
{
diff --git a/test/OpenApiClientTests/LegacyClient/RequestTests.cs b/test/OpenApiNSwagClientTests/LegacyClient/RequestTests.cs
similarity index 99%
rename from test/OpenApiClientTests/LegacyClient/RequestTests.cs
rename to test/OpenApiNSwagClientTests/LegacyClient/RequestTests.cs
index 19d9b805cd..587a9f88ff 100644
--- a/test/OpenApiClientTests/LegacyClient/RequestTests.cs
+++ b/test/OpenApiNSwagClientTests/LegacyClient/RequestTests.cs
@@ -5,11 +5,11 @@
using JsonApiDotNetCore.Middleware;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Microsoft.Net.Http.Headers;
-using OpenApiClientTests.LegacyClient.GeneratedCode;
+using OpenApiNSwagClientTests.LegacyClient.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
-namespace OpenApiClientTests.LegacyClient;
+namespace OpenApiNSwagClientTests.LegacyClient;
public sealed class RequestTests
{
diff --git a/test/OpenApiClientTests/LegacyClient/ResponseTests.cs b/test/OpenApiNSwagClientTests/LegacyClient/ResponseTests.cs
similarity index 99%
rename from test/OpenApiClientTests/LegacyClient/ResponseTests.cs
rename to test/OpenApiNSwagClientTests/LegacyClient/ResponseTests.cs
index ac91774a96..e3d5e8a932 100644
--- a/test/OpenApiClientTests/LegacyClient/ResponseTests.cs
+++ b/test/OpenApiNSwagClientTests/LegacyClient/ResponseTests.cs
@@ -2,11 +2,11 @@
using System.Net;
using FluentAssertions;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
-using OpenApiClientTests.LegacyClient.GeneratedCode;
+using OpenApiNSwagClientTests.LegacyClient.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
-namespace OpenApiClientTests.LegacyClient;
+namespace OpenApiNSwagClientTests.LegacyClient;
public sealed class ResponseTests
{
diff --git a/test/OpenApiClientTests/LegacyClient/swagger.g.json b/test/OpenApiNSwagClientTests/LegacyClient/swagger.g.json
similarity index 100%
rename from test/OpenApiClientTests/LegacyClient/swagger.g.json
rename to test/OpenApiNSwagClientTests/LegacyClient/swagger.g.json
diff --git a/test/OpenApiClientTests/NamingConventions/PascalCase/GeneratedTypesTests.cs b/test/OpenApiNSwagClientTests/NamingConventions/CamelCase/GeneratedTypesTests.cs
similarity index 96%
rename from test/OpenApiClientTests/NamingConventions/PascalCase/GeneratedTypesTests.cs
rename to test/OpenApiNSwagClientTests/NamingConventions/CamelCase/GeneratedTypesTests.cs
index 4c33a27eec..c46e126b25 100644
--- a/test/OpenApiClientTests/NamingConventions/PascalCase/GeneratedTypesTests.cs
+++ b/test/OpenApiNSwagClientTests/NamingConventions/CamelCase/GeneratedTypesTests.cs
@@ -1,8 +1,8 @@
-using OpenApiClientTests.NamingConventions.PascalCase.GeneratedCode;
+using OpenApiNSwagClientTests.NamingConventions.CamelCase.GeneratedCode;
using Xunit;
-using GeneratedClient = OpenApiClientTests.NamingConventions.PascalCase.GeneratedCode.PascalCaseClient;
+using GeneratedClient = OpenApiNSwagClientTests.NamingConventions.CamelCase.GeneratedCode.CamelCaseClient;
-namespace OpenApiClientTests.NamingConventions.PascalCase;
+namespace OpenApiNSwagClientTests.NamingConventions.CamelCase;
public sealed class GeneratedTypesTests
{
diff --git a/test/OpenApiClientTests/NamingConventions/CamelCase/swagger.g.json b/test/OpenApiNSwagClientTests/NamingConventions/CamelCase/swagger.g.json
similarity index 100%
rename from test/OpenApiClientTests/NamingConventions/CamelCase/swagger.g.json
rename to test/OpenApiNSwagClientTests/NamingConventions/CamelCase/swagger.g.json
diff --git a/test/OpenApiClientTests/NamingConventions/CamelCase/GeneratedTypesTests.cs b/test/OpenApiNSwagClientTests/NamingConventions/KebabCase/GeneratedTypesTests.cs
similarity index 96%
rename from test/OpenApiClientTests/NamingConventions/CamelCase/GeneratedTypesTests.cs
rename to test/OpenApiNSwagClientTests/NamingConventions/KebabCase/GeneratedTypesTests.cs
index b5adea1a5f..be720ca21f 100644
--- a/test/OpenApiClientTests/NamingConventions/CamelCase/GeneratedTypesTests.cs
+++ b/test/OpenApiNSwagClientTests/NamingConventions/KebabCase/GeneratedTypesTests.cs
@@ -1,8 +1,8 @@
-using OpenApiClientTests.NamingConventions.CamelCase.GeneratedCode;
+using OpenApiNSwagClientTests.NamingConventions.KebabCase.GeneratedCode;
using Xunit;
-using GeneratedClient = OpenApiClientTests.NamingConventions.CamelCase.GeneratedCode.CamelCaseClient;
+using GeneratedClient = OpenApiNSwagClientTests.NamingConventions.KebabCase.GeneratedCode.KebabCaseClient;
-namespace OpenApiClientTests.NamingConventions.CamelCase;
+namespace OpenApiNSwagClientTests.NamingConventions.KebabCase;
public sealed class GeneratedTypesTests
{
diff --git a/test/OpenApiClientTests/NamingConventions/KebabCase/swagger.g.json b/test/OpenApiNSwagClientTests/NamingConventions/KebabCase/swagger.g.json
similarity index 100%
rename from test/OpenApiClientTests/NamingConventions/KebabCase/swagger.g.json
rename to test/OpenApiNSwagClientTests/NamingConventions/KebabCase/swagger.g.json
diff --git a/test/OpenApiClientTests/NamingConventions/KebabCase/GeneratedTypesTests.cs b/test/OpenApiNSwagClientTests/NamingConventions/PascalCase/GeneratedTypesTests.cs
similarity index 96%
rename from test/OpenApiClientTests/NamingConventions/KebabCase/GeneratedTypesTests.cs
rename to test/OpenApiNSwagClientTests/NamingConventions/PascalCase/GeneratedTypesTests.cs
index e0408281c0..a6c40f8254 100644
--- a/test/OpenApiClientTests/NamingConventions/KebabCase/GeneratedTypesTests.cs
+++ b/test/OpenApiNSwagClientTests/NamingConventions/PascalCase/GeneratedTypesTests.cs
@@ -1,8 +1,8 @@
-using OpenApiClientTests.NamingConventions.KebabCase.GeneratedCode;
+using OpenApiNSwagClientTests.NamingConventions.PascalCase.GeneratedCode;
using Xunit;
-using GeneratedClient = OpenApiClientTests.NamingConventions.KebabCase.GeneratedCode.KebabCaseClient;
+using GeneratedClient = OpenApiNSwagClientTests.NamingConventions.PascalCase.GeneratedCode.PascalCaseClient;
-namespace OpenApiClientTests.NamingConventions.KebabCase;
+namespace OpenApiNSwagClientTests.NamingConventions.PascalCase;
public sealed class GeneratedTypesTests
{
diff --git a/test/OpenApiClientTests/NamingConventions/PascalCase/swagger.g.json b/test/OpenApiNSwagClientTests/NamingConventions/PascalCase/swagger.g.json
similarity index 100%
rename from test/OpenApiClientTests/NamingConventions/PascalCase/swagger.g.json
rename to test/OpenApiNSwagClientTests/NamingConventions/PascalCase/swagger.g.json
diff --git a/test/OpenApiClientTests/ObjectExtensions.cs b/test/OpenApiNSwagClientTests/ObjectExtensions.cs
similarity index 96%
rename from test/OpenApiClientTests/ObjectExtensions.cs
rename to test/OpenApiNSwagClientTests/ObjectExtensions.cs
index 82c3309ed6..fe6fb60da5 100644
--- a/test/OpenApiClientTests/ObjectExtensions.cs
+++ b/test/OpenApiNSwagClientTests/ObjectExtensions.cs
@@ -1,7 +1,7 @@
using System.Reflection;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
-namespace OpenApiClientTests;
+namespace OpenApiNSwagClientTests;
internal static class ObjectExtensions
{
diff --git a/test/OpenApiClientTests/OpenApiClientTests.csproj b/test/OpenApiNSwagClientTests/OpenApiNSwagClientTests.csproj
similarity index 84%
rename from test/OpenApiClientTests/OpenApiClientTests.csproj
rename to test/OpenApiNSwagClientTests/OpenApiNSwagClientTests.csproj
index 6ec90e4c2d..5fb968d5d3 100644
--- a/test/OpenApiClientTests/OpenApiClientTests.csproj
+++ b/test/OpenApiNSwagClientTests/OpenApiNSwagClientTests.csproj
@@ -24,28 +24,28 @@
- OpenApiClientTests.LegacyClient.GeneratedCode
+ OpenApiNSwagClientTests.LegacyClient.GeneratedCode
OpenApiClient
OpenApiClient.cs
NSwagCSharp
/GenerateClientInterfaces:true /ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag
- OpenApiClientTests.NamingConventions.KebabCase.GeneratedCode
+ OpenApiNSwagClientTests.NamingConventions.KebabCase.GeneratedCode
KebabCaseClient
KebabCaseClient.cs
NSwagCSharp
/ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag
- OpenApiClientTests.NamingConventions.CamelCase.GeneratedCode
+ OpenApiNSwagClientTests.NamingConventions.CamelCase.GeneratedCode
CamelCaseClient
CamelCaseClient.cs
NSwagCSharp
/ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag
- OpenApiClientTests.NamingConventions.PascalCase.GeneratedCode
+ OpenApiNSwagClientTests.NamingConventions.PascalCase.GeneratedCode
PascalCaseClient
PascalCaseClient.cs
NSwagCSharp
@@ -55,28 +55,28 @@
NrtOffMsvOffClient
NrtOffMsvOffClient.cs
NSwagCSharp
- OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff.GeneratedCode
+ OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff.GeneratedCode
/ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag /GenerateNullableReferenceTypes:false
NrtOffMsvOnClient
NrtOffMsvOnClient.cs
NSwagCSharp
- OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn.GeneratedCode
+ OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn.GeneratedCode
/ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag /GenerateNullableReferenceTypes:false
NrtOnMsvOffClient
NrtOnMsvOffClient.cs
NSwagCSharp
- OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff.GeneratedCode
+ OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff.GeneratedCode
/ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag /GenerateNullableReferenceTypes:true
NrtOnMsvOnClient
NrtOnMsvOnClient.cs
NSwagCSharp
- OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn.GeneratedCode
+ OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn.GeneratedCode
/ClientClassAccessModifier:internal /GenerateExceptionClasses:false /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag /GenerateNullableReferenceTypes:true
diff --git a/test/OpenApiClientTests/PropertyInfoAssertionsExtensions.cs b/test/OpenApiNSwagClientTests/PropertyInfoAssertionsExtensions.cs
similarity index 95%
rename from test/OpenApiClientTests/PropertyInfoAssertionsExtensions.cs
rename to test/OpenApiNSwagClientTests/PropertyInfoAssertionsExtensions.cs
index e49bef1a0d..bb0ff8dbd1 100644
--- a/test/OpenApiClientTests/PropertyInfoAssertionsExtensions.cs
+++ b/test/OpenApiNSwagClientTests/PropertyInfoAssertionsExtensions.cs
@@ -2,7 +2,7 @@
using FluentAssertions;
using FluentAssertions.Types;
-namespace OpenApiClientTests;
+namespace OpenApiNSwagClientTests;
internal static class PropertyInfoAssertionsExtensions
{
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/CreateResourceTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/CreateResourceTests.cs
similarity index 97%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/CreateResourceTests.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/CreateResourceTests.cs
index 43b004270c..4654462c60 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/CreateResourceTests.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/CreateResourceTests.cs
@@ -5,13 +5,13 @@
using FluentAssertions.Specialized;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
-using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff.GeneratedCode;
+using OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff;
-public sealed class CreateResourceTests : BaseOpenApiClientTests
+public sealed class CreateResourceTests : BaseOpenApiNSwagClientTests
{
private readonly NrtOffMsvOffFakers _fakers = new();
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedCode/NrtOffMsvOffClient.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedCode/NrtOffMsvOffClient.cs
similarity index 72%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedCode/NrtOffMsvOffClient.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedCode/NrtOffMsvOffClient.cs
index 0156947ea3..4a0eed4e39 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedCode/NrtOffMsvOffClient.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/GeneratedCode/NrtOffMsvOffClient.cs
@@ -1,7 +1,7 @@
using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff.GeneratedCode;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff.GeneratedCode;
internal partial class NrtOffMsvOffClient : JsonApiClient
{
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NrtOffMsvOffFakers.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NrtOffMsvOffFakers.cs
similarity index 83%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NrtOffMsvOffFakers.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NrtOffMsvOffFakers.cs
index adb0e97833..32f67157bd 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NrtOffMsvOffFakers.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NrtOffMsvOffFakers.cs
@@ -1,7 +1,7 @@
using Bogus;
-using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff.GeneratedCode;
+using OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff.GeneratedCode;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff;
internal sealed class NrtOffMsvOffFakers
{
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs
similarity index 90%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs
index d15ba31e2b..dd0da75e35 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs
@@ -1,10 +1,10 @@
using System.Reflection;
using FluentAssertions;
-using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff.GeneratedCode;
+using OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff;
public sealed class NullabilityTests
{
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/UpdateResourceTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/UpdateResourceTests.cs
similarity index 94%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/UpdateResourceTests.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/UpdateResourceTests.cs
index 78bf09c4d7..d29235e95a 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/UpdateResourceTests.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/UpdateResourceTests.cs
@@ -4,13 +4,13 @@
using FluentAssertions.Specialized;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
-using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff.GeneratedCode;
+using OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOff;
-public sealed class UpdateResourceTests : BaseOpenApiClientTests
+public sealed class UpdateResourceTests : BaseOpenApiNSwagClientTests
{
private readonly NrtOffMsvOffFakers _fakers = new();
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/swagger.g.json b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/swagger.g.json
similarity index 100%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/swagger.g.json
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/swagger.g.json
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/CreateResourceTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/CreateResourceTests.cs
similarity index 97%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/CreateResourceTests.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/CreateResourceTests.cs
index 3bb6b73a49..ac17bc38c1 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/CreateResourceTests.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/CreateResourceTests.cs
@@ -5,13 +5,13 @@
using FluentAssertions.Specialized;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
-using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn.GeneratedCode;
+using OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn;
-public sealed class CreateResourceTests : BaseOpenApiClientTests
+public sealed class CreateResourceTests : BaseOpenApiNSwagClientTests
{
private readonly NrtOffMsvOnFakers _fakers = new();
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedCode/NrtOffMsvOnClient.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedCode/NrtOffMsvOnClient.cs
similarity index 72%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedCode/NrtOffMsvOnClient.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedCode/NrtOffMsvOnClient.cs
index e0764a8fb1..1da4da6712 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedCode/NrtOffMsvOnClient.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/GeneratedCode/NrtOffMsvOnClient.cs
@@ -1,7 +1,7 @@
using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn.GeneratedCode;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn.GeneratedCode;
internal partial class NrtOffMsvOnClient : JsonApiClient
{
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NrtOffMsvOnFakers.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NrtOffMsvOnFakers.cs
similarity index 86%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NrtOffMsvOnFakers.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NrtOffMsvOnFakers.cs
index 14d23cb247..0ce74c214c 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NrtOffMsvOnFakers.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NrtOffMsvOnFakers.cs
@@ -1,7 +1,7 @@
using Bogus;
-using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn.GeneratedCode;
+using OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn.GeneratedCode;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn;
internal sealed class NrtOffMsvOnFakers
{
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs
similarity index 90%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs
index 11e082fdb9..9b0c3e7b1d 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs
@@ -1,10 +1,10 @@
using System.Reflection;
using FluentAssertions;
-using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn.GeneratedCode;
+using OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn;
public sealed class NullabilityTests
{
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/UpdateResourceTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/UpdateResourceTests.cs
similarity index 94%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/UpdateResourceTests.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/UpdateResourceTests.cs
index 747253589a..38b485d1dc 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/UpdateResourceTests.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/UpdateResourceTests.cs
@@ -4,13 +4,13 @@
using FluentAssertions.Specialized;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
-using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn.GeneratedCode;
+using OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOff.ModelStateValidationOn;
-public sealed class UpdateResourceTests : BaseOpenApiClientTests
+public sealed class UpdateResourceTests : BaseOpenApiNSwagClientTests
{
private readonly NrtOffMsvOnFakers _fakers = new();
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/swagger.g.json b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/swagger.g.json
similarity index 100%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/swagger.g.json
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/swagger.g.json
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/CreateResourceTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/CreateResourceTests.cs
similarity index 98%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/CreateResourceTests.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/CreateResourceTests.cs
index 83497f38b6..5f5d92e1a6 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/CreateResourceTests.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/CreateResourceTests.cs
@@ -5,13 +5,13 @@
using FluentAssertions.Specialized;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
-using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff.GeneratedCode;
+using OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff;
-public sealed class CreateResourceTests : BaseOpenApiClientTests
+public sealed class CreateResourceTests : BaseOpenApiNSwagClientTests
{
private readonly NrtOnMsvOffFakers _fakers = new();
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedCode/NrtOnMsvOffClient.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedCode/NrtOnMsvOffClient.cs
similarity index 72%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedCode/NrtOnMsvOffClient.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedCode/NrtOnMsvOffClient.cs
index 0b056a3dc1..f86a5229fc 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedCode/NrtOnMsvOffClient.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/GeneratedCode/NrtOnMsvOffClient.cs
@@ -1,7 +1,7 @@
using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff.GeneratedCode;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff.GeneratedCode;
internal partial class NrtOnMsvOffClient : JsonApiClient
{
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NrtOnMsvOffFakers.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NrtOnMsvOffFakers.cs
similarity index 86%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NrtOnMsvOffFakers.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NrtOnMsvOffFakers.cs
index 4b6365764e..99a015b6a2 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NrtOnMsvOffFakers.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NrtOnMsvOffFakers.cs
@@ -1,7 +1,7 @@
using Bogus;
-using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff.GeneratedCode;
+using OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff.GeneratedCode;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff;
internal sealed class NrtOnMsvOffFakers
{
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs
similarity index 91%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs
index 633133a63c..609d64bb15 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs
@@ -1,10 +1,10 @@
using System.Reflection;
using FluentAssertions;
-using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff.GeneratedCode;
+using OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff;
public sealed class NullabilityTests
{
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/UpdateResourceTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/UpdateResourceTests.cs
similarity index 95%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/UpdateResourceTests.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/UpdateResourceTests.cs
index f61aa6b497..c4b5789c0b 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/UpdateResourceTests.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/UpdateResourceTests.cs
@@ -4,13 +4,13 @@
using FluentAssertions.Specialized;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
-using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff.GeneratedCode;
+using OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOff;
-public sealed class UpdateResourceTests : BaseOpenApiClientTests
+public sealed class UpdateResourceTests : BaseOpenApiNSwagClientTests
{
private readonly NrtOnMsvOffFakers _fakers = new();
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/swagger.g.json b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/swagger.g.json
similarity index 100%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/swagger.g.json
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/swagger.g.json
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/CreateResourceTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/CreateResourceTests.cs
similarity index 98%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/CreateResourceTests.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/CreateResourceTests.cs
index d5ef2ccdc1..979338c5ed 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/CreateResourceTests.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/CreateResourceTests.cs
@@ -5,13 +5,13 @@
using FluentAssertions.Specialized;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
-using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn.GeneratedCode;
+using OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn;
-public sealed class CreateResourceTests : BaseOpenApiClientTests
+public sealed class CreateResourceTests : BaseOpenApiNSwagClientTests
{
private readonly NrtOnMsvOnFakers _fakers = new();
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedCode/NrtOnMsvOnClient.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedCode/NrtOnMsvOnClient.cs
similarity index 72%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedCode/NrtOnMsvOnClient.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedCode/NrtOnMsvOnClient.cs
index 6e43419714..0a506d41ec 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedCode/NrtOnMsvOnClient.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/GeneratedCode/NrtOnMsvOnClient.cs
@@ -1,7 +1,7 @@
using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn.GeneratedCode;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn.GeneratedCode;
internal partial class NrtOnMsvOnClient : JsonApiClient
{
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NrtOnMsvOnFakers.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NrtOnMsvOnFakers.cs
similarity index 86%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NrtOnMsvOnFakers.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NrtOnMsvOnFakers.cs
index 9906627046..acf9821095 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NrtOnMsvOnFakers.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NrtOnMsvOnFakers.cs
@@ -1,7 +1,7 @@
using Bogus;
-using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn.GeneratedCode;
+using OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn.GeneratedCode;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn;
internal sealed class NrtOnMsvOnFakers
{
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs
similarity index 91%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs
index 83fce2a945..10b3b1b2f2 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs
@@ -1,10 +1,10 @@
using System.Reflection;
using FluentAssertions;
-using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn.GeneratedCode;
+using OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn;
public sealed class NullabilityTests
{
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/UpdateResourceTests.cs b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/UpdateResourceTests.cs
similarity index 95%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/UpdateResourceTests.cs
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/UpdateResourceTests.cs
index 5fb1932f95..651368853c 100644
--- a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/UpdateResourceTests.cs
+++ b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/UpdateResourceTests.cs
@@ -4,13 +4,13 @@
using FluentAssertions.Specialized;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Newtonsoft.Json;
-using OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn.GeneratedCode;
+using OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn.GeneratedCode;
using TestBuildingBlocks;
using Xunit;
-namespace OpenApiClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn;
+namespace OpenApiNSwagClientTests.ResourceFieldValidation.NullableReferenceTypesOn.ModelStateValidationOn;
-public sealed class UpdateResourceTests : BaseOpenApiClientTests
+public sealed class UpdateResourceTests : BaseOpenApiNSwagClientTests
{
private readonly NrtOnMsvOnFakers _fakers = new();
diff --git a/test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/swagger.g.json b/test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/swagger.g.json
similarity index 100%
rename from test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/swagger.g.json
rename to test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/swagger.g.json
diff --git a/test/OpenApiEndToEndTests/.editorconfig b/test/OpenApiNSwagEndToEndTests/.editorconfig
similarity index 100%
rename from test/OpenApiEndToEndTests/.editorconfig
rename to test/OpenApiNSwagEndToEndTests/.editorconfig
diff --git a/test/OpenApiEndToEndTests/Headers/ETagTests.cs b/test/OpenApiNSwagEndToEndTests/Headers/ETagTests.cs
similarity index 98%
rename from test/OpenApiEndToEndTests/Headers/ETagTests.cs
rename to test/OpenApiNSwagEndToEndTests/Headers/ETagTests.cs
index ee6e386308..95507d1ed7 100644
--- a/test/OpenApiEndToEndTests/Headers/ETagTests.cs
+++ b/test/OpenApiNSwagEndToEndTests/Headers/ETagTests.cs
@@ -2,13 +2,13 @@
using FluentAssertions;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
using Microsoft.Net.Http.Headers;
-using OpenApiEndToEndTests.Headers.GeneratedCode;
+using OpenApiNSwagEndToEndTests.Headers.GeneratedCode;
using OpenApiTests;
using OpenApiTests.Headers;
using TestBuildingBlocks;
using Xunit;
-namespace OpenApiEndToEndTests.Headers;
+namespace OpenApiNSwagEndToEndTests.Headers;
public sealed class ETagTests : IClassFixture, HeadersDbContext>>
{
diff --git a/test/OpenApiEndToEndTests/Headers/swagger.g.json b/test/OpenApiNSwagEndToEndTests/Headers/swagger.g.json
similarity index 100%
rename from test/OpenApiEndToEndTests/Headers/swagger.g.json
rename to test/OpenApiNSwagEndToEndTests/Headers/swagger.g.json
diff --git a/test/OpenApiEndToEndTests/OpenApiEndToEndTests.csproj b/test/OpenApiNSwagEndToEndTests/OpenApiNSwagEndToEndTests.csproj
similarity index 94%
rename from test/OpenApiEndToEndTests/OpenApiEndToEndTests.csproj
rename to test/OpenApiNSwagEndToEndTests/OpenApiNSwagEndToEndTests.csproj
index 04b7fbecee..9ccd5243ca 100644
--- a/test/OpenApiEndToEndTests/OpenApiEndToEndTests.csproj
+++ b/test/OpenApiNSwagEndToEndTests/OpenApiNSwagEndToEndTests.csproj
@@ -24,14 +24,14 @@
- OpenApiEndToEndTests.Headers.GeneratedCode
+ OpenApiNSwagEndToEndTests.Headers.GeneratedCode
HeadersClient
HeadersClient.cs
NSwagCSharp
/ClientClassAccessModifier:internal /GenerateExceptionClasses:false /WrapResponses:true /GenerateResponseClasses:false /ResponseClass:ApiResponse /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag /GenerateNullableReferenceTypes:true
- OpenApiEndToEndTests.QueryStrings.GeneratedCode
+ OpenApiNSwagEndToEndTests.QueryStrings.GeneratedCode
QueryStringsClient
QueryStringsClient.cs
NSwagCSharp
diff --git a/test/OpenApiEndToEndTests/QueryStrings/FilterTests.cs b/test/OpenApiNSwagEndToEndTests/QueryStrings/FilterTests.cs
similarity index 98%
rename from test/OpenApiEndToEndTests/QueryStrings/FilterTests.cs
rename to test/OpenApiNSwagEndToEndTests/QueryStrings/FilterTests.cs
index 524b7f2496..c594205961 100644
--- a/test/OpenApiEndToEndTests/QueryStrings/FilterTests.cs
+++ b/test/OpenApiNSwagEndToEndTests/QueryStrings/FilterTests.cs
@@ -1,14 +1,14 @@
using System.Net;
using FluentAssertions;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
-using OpenApiEndToEndTests.QueryStrings.GeneratedCode;
+using OpenApiNSwagEndToEndTests.QueryStrings.GeneratedCode;
using OpenApiTests;
using OpenApiTests.QueryStrings;
using TestBuildingBlocks;
using Xunit;
using Xunit.Abstractions;
-namespace OpenApiEndToEndTests.QueryStrings;
+namespace OpenApiNSwagEndToEndTests.QueryStrings;
public sealed class FilterTests : IClassFixture, QueryStringsDbContext>>
{
diff --git a/test/OpenApiEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs b/test/OpenApiNSwagEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs
similarity index 96%
rename from test/OpenApiEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs
rename to test/OpenApiNSwagEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs
index eb0b3e32b2..233d5cbb9c 100644
--- a/test/OpenApiEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs
+++ b/test/OpenApiNSwagEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs
@@ -6,7 +6,7 @@
// ReSharper disable UnusedParameterInPartialMethod
-namespace OpenApiEndToEndTests.QueryStrings.GeneratedCode;
+namespace OpenApiNSwagEndToEndTests.QueryStrings.GeneratedCode;
internal partial class QueryStringsClient : JsonApiClient
{
diff --git a/test/OpenApiEndToEndTests/QueryStrings/IncludeTests.cs b/test/OpenApiNSwagEndToEndTests/QueryStrings/IncludeTests.cs
similarity index 98%
rename from test/OpenApiEndToEndTests/QueryStrings/IncludeTests.cs
rename to test/OpenApiNSwagEndToEndTests/QueryStrings/IncludeTests.cs
index 0892ff67fd..881148415d 100644
--- a/test/OpenApiEndToEndTests/QueryStrings/IncludeTests.cs
+++ b/test/OpenApiNSwagEndToEndTests/QueryStrings/IncludeTests.cs
@@ -1,12 +1,12 @@
using FluentAssertions;
-using OpenApiEndToEndTests.QueryStrings.GeneratedCode;
+using OpenApiNSwagEndToEndTests.QueryStrings.GeneratedCode;
using OpenApiTests;
using OpenApiTests.QueryStrings;
using TestBuildingBlocks;
using Xunit;
using Xunit.Abstractions;
-namespace OpenApiEndToEndTests.QueryStrings;
+namespace OpenApiNSwagEndToEndTests.QueryStrings;
public sealed class IncludeTests : IClassFixture, QueryStringsDbContext>>
{
diff --git a/test/OpenApiEndToEndTests/QueryStrings/PaginationTests.cs b/test/OpenApiNSwagEndToEndTests/QueryStrings/PaginationTests.cs
similarity index 98%
rename from test/OpenApiEndToEndTests/QueryStrings/PaginationTests.cs
rename to test/OpenApiNSwagEndToEndTests/QueryStrings/PaginationTests.cs
index 0ed5075075..efb63de25d 100644
--- a/test/OpenApiEndToEndTests/QueryStrings/PaginationTests.cs
+++ b/test/OpenApiNSwagEndToEndTests/QueryStrings/PaginationTests.cs
@@ -1,14 +1,14 @@
using System.Net;
using FluentAssertions;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
-using OpenApiEndToEndTests.QueryStrings.GeneratedCode;
+using OpenApiNSwagEndToEndTests.QueryStrings.GeneratedCode;
using OpenApiTests;
using OpenApiTests.QueryStrings;
using TestBuildingBlocks;
using Xunit;
using Xunit.Abstractions;
-namespace OpenApiEndToEndTests.QueryStrings;
+namespace OpenApiNSwagEndToEndTests.QueryStrings;
public sealed class PaginationTests : IClassFixture, QueryStringsDbContext>>
{
diff --git a/test/OpenApiEndToEndTests/QueryStrings/SortTests.cs b/test/OpenApiNSwagEndToEndTests/QueryStrings/SortTests.cs
similarity index 98%
rename from test/OpenApiEndToEndTests/QueryStrings/SortTests.cs
rename to test/OpenApiNSwagEndToEndTests/QueryStrings/SortTests.cs
index 23b57b7249..ebf7a46db7 100644
--- a/test/OpenApiEndToEndTests/QueryStrings/SortTests.cs
+++ b/test/OpenApiNSwagEndToEndTests/QueryStrings/SortTests.cs
@@ -1,14 +1,14 @@
using System.Net;
using FluentAssertions;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
-using OpenApiEndToEndTests.QueryStrings.GeneratedCode;
+using OpenApiNSwagEndToEndTests.QueryStrings.GeneratedCode;
using OpenApiTests;
using OpenApiTests.QueryStrings;
using TestBuildingBlocks;
using Xunit;
using Xunit.Abstractions;
-namespace OpenApiEndToEndTests.QueryStrings;
+namespace OpenApiNSwagEndToEndTests.QueryStrings;
public sealed class SortTests : IClassFixture, QueryStringsDbContext>>
{
diff --git a/test/OpenApiEndToEndTests/QueryStrings/SparseFieldSetTests.cs b/test/OpenApiNSwagEndToEndTests/QueryStrings/SparseFieldSetTests.cs
similarity index 98%
rename from test/OpenApiEndToEndTests/QueryStrings/SparseFieldSetTests.cs
rename to test/OpenApiNSwagEndToEndTests/QueryStrings/SparseFieldSetTests.cs
index 05fa1f710a..547bd98bfc 100644
--- a/test/OpenApiEndToEndTests/QueryStrings/SparseFieldSetTests.cs
+++ b/test/OpenApiNSwagEndToEndTests/QueryStrings/SparseFieldSetTests.cs
@@ -1,12 +1,12 @@
using FluentAssertions;
-using OpenApiEndToEndTests.QueryStrings.GeneratedCode;
+using OpenApiNSwagEndToEndTests.QueryStrings.GeneratedCode;
using OpenApiTests;
using OpenApiTests.QueryStrings;
using TestBuildingBlocks;
using Xunit;
using Xunit.Abstractions;
-namespace OpenApiEndToEndTests.QueryStrings;
+namespace OpenApiNSwagEndToEndTests.QueryStrings;
public sealed class SparseFieldSetTests : IClassFixture, QueryStringsDbContext>>
{
diff --git a/test/OpenApiEndToEndTests/QueryStrings/swagger.g.json b/test/OpenApiNSwagEndToEndTests/QueryStrings/swagger.g.json
similarity index 100%
rename from test/OpenApiEndToEndTests/QueryStrings/swagger.g.json
rename to test/OpenApiNSwagEndToEndTests/QueryStrings/swagger.g.json
diff --git a/test/OpenApiTests/Headers/HeaderTests.cs b/test/OpenApiTests/Headers/HeaderTests.cs
index 99b8738a05..8901fe5eba 100644
--- a/test/OpenApiTests/Headers/HeaderTests.cs
+++ b/test/OpenApiTests/Headers/HeaderTests.cs
@@ -15,7 +15,7 @@ public HeaderTests(OpenApiTestContext, HeadersD
testContext.UseController();
- testContext.SwaggerDocumentOutputDirectory = "test/OpenApiEndToEndTests/Headers";
+ testContext.SwaggerDocumentOutputDirectory = "test/OpenApiNSwagEndToEndTests/Headers";
}
[Theory]
diff --git a/test/OpenApiTests/LegacyOpenApiIntegration/LegacyOpenApiIntegrationTests.cs b/test/OpenApiTests/LegacyOpenApiIntegration/LegacyOpenApiIntegrationTests.cs
index 75bc093b25..c3cca11cfc 100644
--- a/test/OpenApiTests/LegacyOpenApiIntegration/LegacyOpenApiIntegrationTests.cs
+++ b/test/OpenApiTests/LegacyOpenApiIntegration/LegacyOpenApiIntegrationTests.cs
@@ -15,7 +15,7 @@ public LegacyOpenApiIntegrationTests()
UseController();
UseController();
- SwaggerDocumentOutputDirectory = "test/OpenApiClientTests/LegacyClient";
+ SwaggerDocumentOutputDirectory = "test/OpenApiNSwagClientTests/LegacyClient";
}
[Fact]
diff --git a/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs b/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs
index ea72e0ba11..5c065c2bb6 100644
--- a/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs
+++ b/test/OpenApiTests/NamingConventions/CamelCase/CamelCaseTests.cs
@@ -15,7 +15,7 @@ public CamelCaseTests(OpenApiTestContext();
testContext.UseController();
- testContext.SwaggerDocumentOutputDirectory = "test/OpenApiClientTests/NamingConventions/CamelCase";
+ testContext.SwaggerDocumentOutputDirectory = "test/OpenApiNSwagClientTests/NamingConventions/CamelCase";
}
[Fact]
diff --git a/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs b/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs
index 6c170ed024..cee3a1e7db 100644
--- a/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs
+++ b/test/OpenApiTests/NamingConventions/KebabCase/KebabCaseTests.cs
@@ -15,7 +15,7 @@ public KebabCaseTests(OpenApiTestContext();
testContext.UseController();
- testContext.SwaggerDocumentOutputDirectory = "test/OpenApiClientTests/NamingConventions/KebabCase";
+ testContext.SwaggerDocumentOutputDirectory = "test/OpenApiNSwagClientTests/NamingConventions/KebabCase";
}
[Fact]
diff --git a/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs b/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs
index f501828e36..92bac6c602 100644
--- a/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs
+++ b/test/OpenApiTests/NamingConventions/PascalCase/PascalCaseTests.cs
@@ -16,7 +16,7 @@ public PascalCaseTests(OpenApiTestContext();
testContext.UseController();
- testContext.SwaggerDocumentOutputDirectory = "test/OpenApiClientTests/NamingConventions/PascalCase";
+ testContext.SwaggerDocumentOutputDirectory = "test/OpenApiNSwagClientTests/NamingConventions/PascalCase";
}
[Fact]
diff --git a/test/OpenApiTests/QueryStrings/QueryStringTests.cs b/test/OpenApiTests/QueryStrings/QueryStringTests.cs
index ecff8a33ed..a3a78a1c0e 100644
--- a/test/OpenApiTests/QueryStrings/QueryStringTests.cs
+++ b/test/OpenApiTests/QueryStrings/QueryStringTests.cs
@@ -16,7 +16,7 @@ public QueryStringTests(OpenApiTestContext
testContext.UseController();
testContext.UseController();
- testContext.SwaggerDocumentOutputDirectory = "test/OpenApiEndToEndTests/QueryStrings";
+ testContext.SwaggerDocumentOutputDirectory = "test/OpenApiNSwagEndToEndTests/QueryStrings";
}
[Theory]
diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs
index 5927cd79a8..4b018c6e76 100644
--- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs
+++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff/NullabilityTests.cs
@@ -14,7 +14,7 @@ public NullabilityTests(OpenApiTestContext, NrtOf
_testContext = testContext;
testContext.UseController();
- testContext.SwaggerDocumentOutputDirectory = "test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff";
+ testContext.SwaggerDocumentOutputDirectory = "test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOff";
}
[Theory]
diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs
index db0c7363e7..c9dd150cc8 100644
--- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs
+++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn/NullabilityTests.cs
@@ -14,7 +14,7 @@ public NullabilityTests(OpenApiTestContext, NrtO
_testContext = testContext;
testContext.UseController();
- testContext.SwaggerDocumentOutputDirectory = "test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn";
+ testContext.SwaggerDocumentOutputDirectory = "test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOff/ModelStateValidationOn";
}
[Theory]
diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs
index 370d6b57a8..2131929bd2 100644
--- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs
+++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff/NullabilityTests.cs
@@ -14,7 +14,7 @@ public NullabilityTests(OpenApiTestContext, NrtOnD
_testContext = testContext;
testContext.UseController();
- testContext.SwaggerDocumentOutputDirectory = "test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff";
+ testContext.SwaggerDocumentOutputDirectory = "test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOff";
}
[Theory]
diff --git a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs
index f2b997a74d..3aaa834c5b 100644
--- a/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs
+++ b/test/OpenApiTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn/NullabilityTests.cs
@@ -14,7 +14,7 @@ public NullabilityTests(OpenApiTestContext, NrtOn
_testContext = testContext;
testContext.UseController();
- testContext.SwaggerDocumentOutputDirectory = "test/OpenApiClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn";
+ testContext.SwaggerDocumentOutputDirectory = "test/OpenApiNSwagClientTests/ResourceFieldValidation/NullableReferenceTypesOn/ModelStateValidationOn";
}
[Theory]
From 8b25f1c2e8a7b162048f598ef83d492663866b55 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 24 Feb 2024 11:56:29 +0100
Subject: [PATCH 03/17] Align example project settings with tests
---
.../OpenApiNSwagClientExample.csproj | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/Examples/OpenApiNSwagClientExample/OpenApiNSwagClientExample.csproj b/src/Examples/OpenApiNSwagClientExample/OpenApiNSwagClientExample.csproj
index 17e1376e47..a74e8a52eb 100644
--- a/src/Examples/OpenApiNSwagClientExample/OpenApiNSwagClientExample.csproj
+++ b/src/Examples/OpenApiNSwagClientExample/OpenApiNSwagClientExample.csproj
@@ -24,7 +24,10 @@
-
+
+ ExampleApiClient
+ ExampleApiClient.cs
+ NSwagCSharp
/GenerateExceptionClasses:false /WrapResponses:true /GenerateResponseClasses:false /ResponseClass:ApiResponse /AdditionalNamespaceUsages:JsonApiDotNetCore.OpenApi.Client.NSwag
From 2e6e9a026f2c1e1b785bcd16a7c05f69a2982d87 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 24 Feb 2024 12:38:23 +0100
Subject: [PATCH 04/17] Clean up references to Swashbuckle* packages
---
docs/usage/openapi-client.md | 2 +-
package-versions.props | 1 +
.../JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj | 4 ++--
src/Examples/OpenApiNSwagClientExample/Program.cs | 3 +--
.../JsonApiDotNetCore.OpenApi.Client.NSwag.csproj | 4 +---
.../JsonApiDotNetCore.OpenApi.csproj | 1 -
6 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/docs/usage/openapi-client.md b/docs/usage/openapi-client.md
index dcdec89b94..5bbb8bd480 100644
--- a/docs/usage/openapi-client.md
+++ b/docs/usage/openapi-client.md
@@ -180,7 +180,7 @@ This enables the following code, which is explained below:
```c#
var getResponse = await ApiResponse.TranslateAsync(() => apiClient.GetPersonCollectionAsync(null, null));
-string eTag = getResponse.Headers[HeaderNames.ETag].Single();
+string eTag = getResponse.Headers["ETag"].Single();
Console.WriteLine($"Retrieved {getResponse.Result.Data.Count} people.");
// wait some time...
diff --git a/package-versions.props b/package-versions.props
index 0129d2aee2..8ab08f0fd0 100644
--- a/package-versions.props
+++ b/package-versions.props
@@ -5,6 +5,7 @@
0.4.1
2.14.1
6.5.0
+ 13.0.3
8.0.*
diff --git a/src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj b/src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj
index 5335a96b42..654abe9a88 100644
--- a/src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj
+++ b/src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj
@@ -16,8 +16,8 @@
-
-
+
+
diff --git a/src/Examples/OpenApiNSwagClientExample/Program.cs b/src/Examples/OpenApiNSwagClientExample/Program.cs
index 53dadd1a84..653cab7007 100644
--- a/src/Examples/OpenApiNSwagClientExample/Program.cs
+++ b/src/Examples/OpenApiNSwagClientExample/Program.cs
@@ -1,6 +1,5 @@
using System.Net;
using JsonApiDotNetCore.OpenApi.Client.NSwag;
-using Microsoft.Net.Http.Headers;
using OpenApiNSwagClientExample;
#if DEBUG
@@ -15,7 +14,7 @@
var apiClient = new ExampleApiClient(httpClient);
ApiResponse getResponse1 = await GetPersonCollectionAsync(apiClient, null);
-ApiResponse getResponse2 = await GetPersonCollectionAsync(apiClient, getResponse1.Headers[HeaderNames.ETag].First());
+ApiResponse getResponse2 = await GetPersonCollectionAsync(apiClient, getResponse1.Headers["ETag"].First());
if (getResponse2 is { StatusCode: (int)HttpStatusCode.NotModified, Result: null })
{
diff --git a/src/JsonApiDotNetCore.OpenApi.Client.NSwag/JsonApiDotNetCore.OpenApi.Client.NSwag.csproj b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/JsonApiDotNetCore.OpenApi.Client.NSwag.csproj
index a77e9c28dd..71d4b9de36 100644
--- a/src/JsonApiDotNetCore.OpenApi.Client.NSwag/JsonApiDotNetCore.OpenApi.Client.NSwag.csproj
+++ b/src/JsonApiDotNetCore.OpenApi.Client.NSwag/JsonApiDotNetCore.OpenApi.Client.NSwag.csproj
@@ -31,9 +31,7 @@
+
-
-
-
diff --git a/src/JsonApiDotNetCore.OpenApi/JsonApiDotNetCore.OpenApi.csproj b/src/JsonApiDotNetCore.OpenApi/JsonApiDotNetCore.OpenApi.csproj
index 2f74aff5da..c7e68196e2 100644
--- a/src/JsonApiDotNetCore.OpenApi/JsonApiDotNetCore.OpenApi.csproj
+++ b/src/JsonApiDotNetCore.OpenApi/JsonApiDotNetCore.OpenApi.csproj
@@ -37,6 +37,5 @@
-
From c29a2e6c43ef9dc7128a6f6ff170e611401ddc35 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 24 Feb 2024 14:23:58 +0100
Subject: [PATCH 05/17] Convert OpenAPI client example into worker service
---
...=> ColoredConsoleLogHttpMessageHandler.cs} | 9 +-
.../OpenApiNSwagClientExample.csproj | 16 ++--
.../PeopleMessageFormatter.cs | 66 +++++++++++++
.../OpenApiNSwagClientExample/Program.cs | 93 ++-----------------
.../Properties/launchSettings.json | 12 +++
.../OpenApiNSwagClientExample/Worker.cs | 72 ++++++++++++++
.../appsettings.json | 9 ++
7 files changed, 179 insertions(+), 98 deletions(-)
rename src/Examples/OpenApiNSwagClientExample/{ColoredConsoleLogDelegatingHandler.cs => ColoredConsoleLogHttpMessageHandler.cs} (92%)
create mode 100644 src/Examples/OpenApiNSwagClientExample/PeopleMessageFormatter.cs
create mode 100644 src/Examples/OpenApiNSwagClientExample/Properties/launchSettings.json
create mode 100644 src/Examples/OpenApiNSwagClientExample/Worker.cs
create mode 100644 src/Examples/OpenApiNSwagClientExample/appsettings.json
diff --git a/src/Examples/OpenApiNSwagClientExample/ColoredConsoleLogDelegatingHandler.cs b/src/Examples/OpenApiNSwagClientExample/ColoredConsoleLogHttpMessageHandler.cs
similarity index 92%
rename from src/Examples/OpenApiNSwagClientExample/ColoredConsoleLogDelegatingHandler.cs
rename to src/Examples/OpenApiNSwagClientExample/ColoredConsoleLogHttpMessageHandler.cs
index ab505324c3..d999a7d9bf 100644
--- a/src/Examples/OpenApiNSwagClientExample/ColoredConsoleLogDelegatingHandler.cs
+++ b/src/Examples/OpenApiNSwagClientExample/ColoredConsoleLogHttpMessageHandler.cs
@@ -5,20 +5,24 @@ namespace OpenApiNSwagClientExample;
///
/// Writes incoming and outgoing HTTP messages to the console.
///
-[UsedImplicitly]
-internal sealed class ColoredConsoleLogDelegatingHandler : DelegatingHandler
+internal sealed class ColoredConsoleLogHttpMessageHandler : DelegatingHandler
{
protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
+#if DEBUG
await LogRequestAsync(request, cancellationToken);
+#endif
HttpResponseMessage response = await base.SendAsync(request, cancellationToken);
+#if DEBUG
await LogResponseAsync(response, cancellationToken);
+#endif
return response;
}
+ [UsedImplicitly]
private static async Task LogRequestAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
using var _ = new ConsoleColorScope(ConsoleColor.Green);
@@ -33,6 +37,7 @@ private static async Task LogRequestAsync(HttpRequestMessage request, Cancellati
}
}
+ [UsedImplicitly]
private static async Task LogResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
{
using var _ = new ConsoleColorScope(ConsoleColor.Cyan);
diff --git a/src/Examples/OpenApiNSwagClientExample/OpenApiNSwagClientExample.csproj b/src/Examples/OpenApiNSwagClientExample/OpenApiNSwagClientExample.csproj
index a74e8a52eb..72cbdf00e9 100644
--- a/src/Examples/OpenApiNSwagClientExample/OpenApiNSwagClientExample.csproj
+++ b/src/Examples/OpenApiNSwagClientExample/OpenApiNSwagClientExample.csproj
@@ -1,8 +1,7 @@
-
+
net8.0
- Exe
@@ -12,19 +11,16 @@
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
+
+
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
+ OpenApiNSwagClientExample
ExampleApiClient
ExampleApiClient.cs
NSwagCSharp
diff --git a/src/Examples/OpenApiNSwagClientExample/PeopleMessageFormatter.cs b/src/Examples/OpenApiNSwagClientExample/PeopleMessageFormatter.cs
new file mode 100644
index 0000000000..4fd5bdc6b6
--- /dev/null
+++ b/src/Examples/OpenApiNSwagClientExample/PeopleMessageFormatter.cs
@@ -0,0 +1,66 @@
+using System.Net;
+using System.Text;
+using JetBrains.Annotations;
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
+
+namespace OpenApiNSwagClientExample;
+
+///
+/// Prints the specified people, their assigned todo-items, and its tags.
+///
+[UsedImplicitly(ImplicitUseKindFlags.InstantiatedNoFixedConstructorSignature)]
+internal sealed class PeopleMessageFormatter
+{
+ public static void PrintPeople(ApiResponse peopleResponse)
+ {
+ string message = WritePeople(peopleResponse);
+ Console.WriteLine(message);
+ }
+
+ private static string WritePeople(ApiResponse peopleResponse)
+ {
+ if (peopleResponse is { StatusCode: (int)HttpStatusCode.NotModified, Result: null })
+ {
+ return "The HTTP response hasn't changed, so no response body was returned.";
+ }
+
+ var builder = new StringBuilder();
+ builder.AppendLine($"Found {peopleResponse.Result!.Data.Count} people:");
+
+ foreach (PersonDataInResponse person in peopleResponse.Result!.Data)
+ {
+ WritePerson(person, peopleResponse.Result!.Included, builder);
+ }
+
+ return builder.ToString();
+ }
+
+ private static void WritePerson(PersonDataInResponse person, ICollection includes, StringBuilder builder)
+ {
+ ToManyTodoItemInResponse assignedTodoItems = person.Relationships.AssignedTodoItems;
+
+ builder.AppendLine($" Person {person.Id}: {person.Attributes.DisplayName} with {assignedTodoItems.Data.Count} assigned todo-items:");
+ WriteRelatedTodoItems(assignedTodoItems.Data, includes, builder);
+ }
+
+ private static void WriteRelatedTodoItems(IEnumerable todoItemIdentifiers, ICollection includes, StringBuilder builder)
+ {
+ foreach (TodoItemIdentifier todoItemIdentifier in todoItemIdentifiers)
+ {
+ TodoItemDataInResponse includedTodoItem = includes.OfType().Single(include => include.Id == todoItemIdentifier.Id);
+ ToManyTagInResponse tags = includedTodoItem.Relationships.Tags;
+
+ builder.AppendLine($" TodoItem {includedTodoItem.Id}: {includedTodoItem.Attributes.Description} with {tags.Data.Count} tags:");
+ WriteRelatedTags(tags.Data, includes, builder);
+ }
+ }
+
+ private static void WriteRelatedTags(IEnumerable tagIdentifiers, ICollection includes, StringBuilder builder)
+ {
+ foreach (TagIdentifier tagIdentifier in tagIdentifiers)
+ {
+ TagDataInResponse includedTag = includes.OfType().Single(include => include.Id == tagIdentifier.Id);
+ builder.AppendLine($" Tag {includedTag.Id}: {includedTag.Attributes.Name}");
+ }
+ }
+}
diff --git a/src/Examples/OpenApiNSwagClientExample/Program.cs b/src/Examples/OpenApiNSwagClientExample/Program.cs
index 653cab7007..67d81a7ad1 100644
--- a/src/Examples/OpenApiNSwagClientExample/Program.cs
+++ b/src/Examples/OpenApiNSwagClientExample/Program.cs
@@ -1,89 +1,10 @@
-using System.Net;
-using JsonApiDotNetCore.OpenApi.Client.NSwag;
using OpenApiNSwagClientExample;
-#if DEBUG
-using var httpClient = new HttpClient(new ColoredConsoleLogDelegatingHandler
-{
- InnerHandler = new HttpClientHandler()
-});
-#else
-using var httpClient = new HttpClient();
-#endif
+HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
+builder.Services.AddLogging(options => options.ClearProviders());
+builder.Services.AddHostedService();
+builder.Services.AddSingleton();
+builder.Services.AddHttpClient().AddHttpMessageHandler();
-var apiClient = new ExampleApiClient(httpClient);
-
-ApiResponse getResponse1 = await GetPersonCollectionAsync(apiClient, null);
-ApiResponse getResponse2 = await GetPersonCollectionAsync(apiClient, getResponse1.Headers["ETag"].First());
-
-if (getResponse2 is { StatusCode: (int)HttpStatusCode.NotModified, Result: null })
-{
- Console.WriteLine("The HTTP response hasn't changed, so no response body was returned.");
-}
-
-foreach (PersonDataInResponse person in getResponse1.Result!.Data)
-{
- PrintPerson(person, getResponse1.Result.Included);
-}
-
-var patchRequest = new PersonPatchRequestDocument
-{
- Data = new PersonDataInPatchRequest
- {
- Id = "1",
- Attributes = new PersonAttributesInPatchRequest
- {
- LastName = "Doe"
- }
- }
-};
-
-// This line results in sending "firstName: null" instead of omitting it.
-using (apiClient.WithPartialAttributeSerialization(patchRequest, person => person.FirstName))
-{
- // Workaround for https://github.com/RicoSuter/NSwag/issues/2499.
- await ApiResponse.TranslateAsync(() => apiClient.PatchPersonAsync(patchRequest.Data.Id, null, patchRequest));
-}
-
-Console.WriteLine("Press any key to close.");
-Console.ReadKey();
-
-static Task> GetPersonCollectionAsync(ExampleApiClient apiClient, string? ifNoneMatch)
-{
- return ApiResponse.TranslateAsync(() => apiClient.GetPersonCollectionAsync(new Dictionary
- {
- ["filter"] = "has(assignedTodoItems)",
- ["sort"] = "-lastName",
- ["page[size]"] = "5",
- ["include"] = "assignedTodoItems.tags"
- }, ifNoneMatch));
-}
-
-static void PrintPerson(PersonDataInResponse person, ICollection includes)
-{
- ToManyTodoItemInResponse assignedTodoItems = person.Relationships.AssignedTodoItems;
-
- Console.WriteLine($"Found person {person.Id}: {person.Attributes.DisplayName} with {assignedTodoItems.Data.Count} assigned todo-items:");
-
- PrintRelatedTodoItems(assignedTodoItems.Data, includes);
-}
-
-static void PrintRelatedTodoItems(IEnumerable todoItemIdentifiers, ICollection includes)
-{
- foreach (TodoItemIdentifier todoItemIdentifier in todoItemIdentifiers)
- {
- TodoItemDataInResponse includedTodoItem = includes.OfType().Single(include => include.Id == todoItemIdentifier.Id);
- Console.WriteLine($" TodoItem {includedTodoItem.Id}: {includedTodoItem.Attributes.Description}");
-
- PrintRelatedTags(includedTodoItem.Relationships.Tags.Data, includes);
- }
-}
-
-static void PrintRelatedTags(IEnumerable tagIdentifiers, ICollection includes)
-{
- foreach (TagIdentifier tagIdentifier in tagIdentifiers)
- {
- TagDataInResponse includedTag = includes.OfType().Single(include => include.Id == tagIdentifier.Id);
- Console.WriteLine($" Tag {includedTag.Id}: {includedTag.Attributes.Name}");
- }
-}
+IHost host = builder.Build();
+await host.RunAsync();
diff --git a/src/Examples/OpenApiNSwagClientExample/Properties/launchSettings.json b/src/Examples/OpenApiNSwagClientExample/Properties/launchSettings.json
new file mode 100644
index 0000000000..afb5e5dac4
--- /dev/null
+++ b/src/Examples/OpenApiNSwagClientExample/Properties/launchSettings.json
@@ -0,0 +1,12 @@
+{
+ "$schema": "http://json.schemastore.org/launchsettings.json",
+ "profiles": {
+ "Kestrel": {
+ "commandName": "Project",
+ "dotnetRunMessages": true,
+ "environmentVariables": {
+ "DOTNET_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/src/Examples/OpenApiNSwagClientExample/Worker.cs b/src/Examples/OpenApiNSwagClientExample/Worker.cs
new file mode 100644
index 0000000000..f4d8fe1166
--- /dev/null
+++ b/src/Examples/OpenApiNSwagClientExample/Worker.cs
@@ -0,0 +1,72 @@
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
+
+namespace OpenApiNSwagClientExample;
+
+public sealed class Worker(ExampleApiClient apiClient, IHostApplicationLifetime hostApplicationLifetime) : BackgroundService
+{
+ private readonly ExampleApiClient _apiClient = apiClient;
+ private readonly IHostApplicationLifetime _hostApplicationLifetime = hostApplicationLifetime;
+
+ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
+ {
+ try
+ {
+ var queryString = new Dictionary
+ {
+ ["filter"] = "has(assignedTodoItems)",
+ ["sort"] = "-lastName",
+ ["page[size]"] = "5",
+ ["include"] = "assignedTodoItems.tags"
+ };
+
+ ApiResponse getResponse = await GetPeopleAsync(_apiClient, queryString, null, stoppingToken);
+ PeopleMessageFormatter.PrintPeople(getResponse);
+
+ string eTag = getResponse.Headers["ETag"].Single();
+ ApiResponse getResponseAgain = await GetPeopleAsync(_apiClient, queryString, eTag, stoppingToken);
+ PeopleMessageFormatter.PrintPeople(getResponseAgain);
+
+ await UpdatePersonAsync(stoppingToken);
+
+ _ = await _apiClient.GetPersonAsync("999999", null, null, stoppingToken);
+ }
+ catch (ApiException exception)
+ {
+ Console.WriteLine($"JSON:API ERROR: {exception.Result.Errors.First().Detail}");
+ }
+ catch (HttpRequestException exception)
+ {
+ Console.WriteLine($"ERROR: {exception.Message}");
+ }
+
+ _hostApplicationLifetime.StopApplication();
+ }
+
+ private static Task> GetPeopleAsync(ExampleApiClient apiClient, IDictionary queryString,
+ string? ifNoneMatch, CancellationToken cancellationToken)
+ {
+ return ApiResponse.TranslateAsync(() => apiClient.GetPersonCollectionAsync(queryString, ifNoneMatch, cancellationToken));
+ }
+
+ private async Task UpdatePersonAsync(CancellationToken cancellationToken)
+ {
+ var patchRequest = new PersonPatchRequestDocument
+ {
+ Data = new PersonDataInPatchRequest
+ {
+ Id = "1",
+ Attributes = new PersonAttributesInPatchRequest
+ {
+ LastName = "Doe"
+ }
+ }
+ };
+
+ // This line results in sending "firstName: null" instead of omitting it.
+ using (_apiClient.WithPartialAttributeSerialization(patchRequest,
+ person => person.FirstName))
+ {
+ _ = await ApiResponse.TranslateAsync(() => _apiClient.PatchPersonAsync(patchRequest.Data.Id, null, patchRequest, cancellationToken));
+ }
+ }
+}
diff --git a/src/Examples/OpenApiNSwagClientExample/appsettings.json b/src/Examples/OpenApiNSwagClientExample/appsettings.json
new file mode 100644
index 0000000000..2b94cdb46d
--- /dev/null
+++ b/src/Examples/OpenApiNSwagClientExample/appsettings.json
@@ -0,0 +1,9 @@
+{
+ "Logging": {
+ "LogLevel": {
+ "Default": "Warning",
+ "Microsoft.Hosting.Lifetime": "Information",
+ "System.Net.Http.HttpClient": "Information"
+ }
+ }
+}
From 03d1c8615fc608b9772140a1d5c881fc11441259 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 24 Feb 2024 15:37:33 +0100
Subject: [PATCH 06/17] Capture network traffic during testruns
---
.../Headers/ETagTests.cs | 17 +++---
.../QueryStrings/FilterTests.cs | 20 +++----
.../GeneratedCode/QueryStringsClient.cs | 48 ----------------
.../QueryStrings/IncludeTests.cs | 24 ++++----
.../QueryStrings/PaginationTests.cs | 24 ++++----
.../QueryStrings/SortTests.cs | 20 +++----
.../QueryStrings/SparseFieldSetTests.cs | 24 ++++----
.../XUnitLogHttpMessageHandler.cs | 55 +++++++++++++++++++
8 files changed, 121 insertions(+), 111 deletions(-)
create mode 100644 test/TestBuildingBlocks/XUnitLogHttpMessageHandler.cs
diff --git a/test/OpenApiNSwagEndToEndTests/Headers/ETagTests.cs b/test/OpenApiNSwagEndToEndTests/Headers/ETagTests.cs
index 95507d1ed7..1163409c31 100644
--- a/test/OpenApiNSwagEndToEndTests/Headers/ETagTests.cs
+++ b/test/OpenApiNSwagEndToEndTests/Headers/ETagTests.cs
@@ -7,17 +7,20 @@
using OpenApiTests.Headers;
using TestBuildingBlocks;
using Xunit;
+using Xunit.Abstractions;
namespace OpenApiNSwagEndToEndTests.Headers;
public sealed class ETagTests : IClassFixture, HeadersDbContext>>
{
private readonly IntegrationTestContext, HeadersDbContext> _testContext;
+ private readonly XUnitLogHttpMessageHandler _logHttpMessageHandler;
private readonly HeaderFakers _fakers = new();
- public ETagTests(IntegrationTestContext, HeadersDbContext> testContext)
+ public ETagTests(IntegrationTestContext, HeadersDbContext> testContext, ITestOutputHelper testOutputHelper)
{
_testContext = testContext;
+ _logHttpMessageHandler = new XUnitLogHttpMessageHandler(testOutputHelper);
testContext.UseController();
}
@@ -35,7 +38,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
var apiClient = new HeadersClient(httpClient);
// Act
@@ -60,7 +63,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
var apiClient = new HeadersClient(httpClient);
// Act
@@ -78,7 +81,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
public async Task Returns_no_ETag_for_failed_GET_request()
{
// Arrange
- using HttpClient httpClient = _testContext.Factory.CreateClient();
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
var apiClient = new HeadersClient(httpClient);
// Act
@@ -97,7 +100,7 @@ public async Task Returns_no_ETag_for_POST_request()
// Arrange
Country newCountry = _fakers.Country.Generate();
- using HttpClient httpClient = _testContext.Factory.CreateClient();
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
var apiClient = new HeadersClient(httpClient);
// Act
@@ -135,7 +138,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
var apiClient = new HeadersClient(httpClient);
ApiResponse response1 = await ApiResponse.TranslateAsync(() => apiClient.GetCountryCollectionAsync(null, null));
@@ -167,7 +170,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
var apiClient = new HeadersClient(httpClient);
// Act
diff --git a/test/OpenApiNSwagEndToEndTests/QueryStrings/FilterTests.cs b/test/OpenApiNSwagEndToEndTests/QueryStrings/FilterTests.cs
index c594205961..1cf9a70389 100644
--- a/test/OpenApiNSwagEndToEndTests/QueryStrings/FilterTests.cs
+++ b/test/OpenApiNSwagEndToEndTests/QueryStrings/FilterTests.cs
@@ -13,13 +13,13 @@ namespace OpenApiNSwagEndToEndTests.QueryStrings;
public sealed class FilterTests : IClassFixture, QueryStringsDbContext>>
{
private readonly IntegrationTestContext, QueryStringsDbContext> _testContext;
- private readonly ITestOutputHelper _testOutputHelper;
+ private readonly XUnitLogHttpMessageHandler _logHttpMessageHandler;
private readonly QueryStringFakers _fakers = new();
public FilterTests(IntegrationTestContext, QueryStringsDbContext> testContext, ITestOutputHelper testOutputHelper)
{
_testContext = testContext;
- _testOutputHelper = testOutputHelper;
+ _logHttpMessageHandler = new XUnitLogHttpMessageHandler(testOutputHelper);
testContext.UseController();
}
@@ -39,8 +39,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -75,8 +75,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -111,8 +111,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -133,8 +133,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
public async Task Cannot_use_empty_filter()
{
// Arrange
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
diff --git a/test/OpenApiNSwagEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs b/test/OpenApiNSwagEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs
index 233d5cbb9c..9d507d3109 100644
--- a/test/OpenApiNSwagEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs
+++ b/test/OpenApiNSwagEndToEndTests/QueryStrings/GeneratedCode/QueryStringsClient.cs
@@ -1,62 +1,14 @@
using JsonApiDotNetCore.OpenApi.Client.NSwag;
-using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
-using TestBuildingBlocks;
-using Xunit.Abstractions;
-
-// ReSharper disable UnusedParameterInPartialMethod
namespace OpenApiNSwagEndToEndTests.QueryStrings.GeneratedCode;
internal partial class QueryStringsClient : JsonApiClient
{
- private readonly ILogger? _logger;
-
- public QueryStringsClient(HttpClient httpClient, ITestOutputHelper testOutputHelper)
- : this(httpClient, CreateLogger(testOutputHelper))
- {
- }
-
- private QueryStringsClient(HttpClient httpClient, ILogger logger)
- : this(httpClient)
- {
- _logger = logger;
- }
-
- private static ILogger CreateLogger(ITestOutputHelper testOutputHelper)
- {
- var loggerFactory = new LoggerFactory(new[]
- {
- new XUnitLoggerProvider(testOutputHelper, null, LogOutputFields.Message)
- });
-
- return loggerFactory.CreateLogger();
- }
-
partial void UpdateJsonSerializerSettings(JsonSerializerSettings settings)
{
SetSerializerSettingsForJsonApi(settings);
settings.Formatting = Formatting.Indented;
}
-
- partial void PrepareRequest(HttpClient client, HttpRequestMessage request, string url)
- {
- if (_logger != null && _logger.IsEnabled(LogLevel.Debug))
- {
- string? requestBody = request.Content?.ReadAsStringAsync().GetAwaiter().GetResult();
- _logger.LogDebug(requestBody != null ? $"--> {request}{Environment.NewLine}{Environment.NewLine}{requestBody}" : $"--> {request}");
- }
- }
-
- partial void ProcessResponse(HttpClient client, HttpResponseMessage response)
- {
- if (_logger != null && _logger.IsEnabled(LogLevel.Debug))
- {
- string responseBody = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
-
- _logger.LogDebug(
- !string.IsNullOrEmpty(responseBody) ? $"<-- {response}{Environment.NewLine}{Environment.NewLine}{responseBody}" : $"<-- {response}");
- }
- }
}
diff --git a/test/OpenApiNSwagEndToEndTests/QueryStrings/IncludeTests.cs b/test/OpenApiNSwagEndToEndTests/QueryStrings/IncludeTests.cs
index 881148415d..b8cdde9349 100644
--- a/test/OpenApiNSwagEndToEndTests/QueryStrings/IncludeTests.cs
+++ b/test/OpenApiNSwagEndToEndTests/QueryStrings/IncludeTests.cs
@@ -11,13 +11,13 @@ namespace OpenApiNSwagEndToEndTests.QueryStrings;
public sealed class IncludeTests : IClassFixture, QueryStringsDbContext>>
{
private readonly IntegrationTestContext, QueryStringsDbContext> _testContext;
- private readonly ITestOutputHelper _testOutputHelper;
+ private readonly XUnitLogHttpMessageHandler _logHttpMessageHandler;
private readonly QueryStringFakers _fakers = new();
public IncludeTests(IntegrationTestContext, QueryStringsDbContext> testContext, ITestOutputHelper testOutputHelper)
{
_testContext = testContext;
- _testOutputHelper = testOutputHelper;
+ _logHttpMessageHandler = new XUnitLogHttpMessageHandler(testOutputHelper);
testContext.UseController();
testContext.UseController();
@@ -37,8 +37,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -72,8 +72,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -107,8 +107,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -141,8 +141,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -175,8 +175,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
diff --git a/test/OpenApiNSwagEndToEndTests/QueryStrings/PaginationTests.cs b/test/OpenApiNSwagEndToEndTests/QueryStrings/PaginationTests.cs
index efb63de25d..b2252f25cd 100644
--- a/test/OpenApiNSwagEndToEndTests/QueryStrings/PaginationTests.cs
+++ b/test/OpenApiNSwagEndToEndTests/QueryStrings/PaginationTests.cs
@@ -13,13 +13,13 @@ namespace OpenApiNSwagEndToEndTests.QueryStrings;
public sealed class PaginationTests : IClassFixture, QueryStringsDbContext>>
{
private readonly IntegrationTestContext, QueryStringsDbContext> _testContext;
- private readonly ITestOutputHelper _testOutputHelper;
+ private readonly XUnitLogHttpMessageHandler _logHttpMessageHandler;
private readonly QueryStringFakers _fakers = new();
public PaginationTests(IntegrationTestContext, QueryStringsDbContext> testContext, ITestOutputHelper testOutputHelper)
{
_testContext = testContext;
- _testOutputHelper = testOutputHelper;
+ _logHttpMessageHandler = new XUnitLogHttpMessageHandler(testOutputHelper);
testContext.UseController();
}
@@ -37,8 +37,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -70,8 +70,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -104,8 +104,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -127,8 +127,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
public async Task Cannot_use_empty_page_size()
{
// Arrange
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -156,8 +156,8 @@ public async Task Cannot_use_empty_page_size()
public async Task Cannot_use_empty_page_number()
{
// Arrange
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
diff --git a/test/OpenApiNSwagEndToEndTests/QueryStrings/SortTests.cs b/test/OpenApiNSwagEndToEndTests/QueryStrings/SortTests.cs
index ebf7a46db7..c682057035 100644
--- a/test/OpenApiNSwagEndToEndTests/QueryStrings/SortTests.cs
+++ b/test/OpenApiNSwagEndToEndTests/QueryStrings/SortTests.cs
@@ -13,13 +13,13 @@ namespace OpenApiNSwagEndToEndTests.QueryStrings;
public sealed class SortTests : IClassFixture, QueryStringsDbContext>>
{
private readonly IntegrationTestContext, QueryStringsDbContext> _testContext;
- private readonly ITestOutputHelper _testOutputHelper;
+ private readonly XUnitLogHttpMessageHandler _logHttpMessageHandler;
private readonly QueryStringFakers _fakers = new();
public SortTests(IntegrationTestContext, QueryStringsDbContext> testContext, ITestOutputHelper testOutputHelper)
{
_testContext = testContext;
- _testOutputHelper = testOutputHelper;
+ _logHttpMessageHandler = new XUnitLogHttpMessageHandler(testOutputHelper);
testContext.UseController();
}
@@ -39,8 +39,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -72,8 +72,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -105,8 +105,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -126,8 +126,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
public async Task Cannot_use_empty_sort()
{
// Arrange
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
diff --git a/test/OpenApiNSwagEndToEndTests/QueryStrings/SparseFieldSetTests.cs b/test/OpenApiNSwagEndToEndTests/QueryStrings/SparseFieldSetTests.cs
index 547bd98bfc..f93d5ec487 100644
--- a/test/OpenApiNSwagEndToEndTests/QueryStrings/SparseFieldSetTests.cs
+++ b/test/OpenApiNSwagEndToEndTests/QueryStrings/SparseFieldSetTests.cs
@@ -11,14 +11,14 @@ namespace OpenApiNSwagEndToEndTests.QueryStrings;
public sealed class SparseFieldSetTests : IClassFixture, QueryStringsDbContext>>
{
private readonly IntegrationTestContext, QueryStringsDbContext> _testContext;
- private readonly ITestOutputHelper _testOutputHelper;
+ private readonly XUnitLogHttpMessageHandler _logHttpMessageHandler;
private readonly QueryStringFakers _fakers = new();
public SparseFieldSetTests(IntegrationTestContext, QueryStringsDbContext> testContext,
ITestOutputHelper testOutputHelper)
{
_testContext = testContext;
- _testOutputHelper = testOutputHelper;
+ _logHttpMessageHandler = new XUnitLogHttpMessageHandler(testOutputHelper);
testContext.UseController();
}
@@ -36,8 +36,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -67,8 +67,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -100,8 +100,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -133,8 +133,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
@@ -165,8 +165,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
await dbContext.SaveChangesAsync();
});
- using HttpClient httpClient = _testContext.Factory.CreateClient();
- var apiClient = new QueryStringsClient(httpClient, _testOutputHelper);
+ using HttpClient httpClient = _testContext.Factory.CreateDefaultClient(_logHttpMessageHandler);
+ var apiClient = new QueryStringsClient(httpClient);
var queryString = new Dictionary
{
diff --git a/test/TestBuildingBlocks/XUnitLogHttpMessageHandler.cs b/test/TestBuildingBlocks/XUnitLogHttpMessageHandler.cs
new file mode 100644
index 0000000000..5f321b2bd4
--- /dev/null
+++ b/test/TestBuildingBlocks/XUnitLogHttpMessageHandler.cs
@@ -0,0 +1,55 @@
+using Microsoft.Extensions.Logging;
+using Xunit.Abstractions;
+
+namespace TestBuildingBlocks;
+
+///
+/// Writes incoming and outgoing HTTP messages to the test output window.
+///
+public sealed class XUnitLogHttpMessageHandler : DelegatingHandler
+{
+ private readonly ILogger _logger;
+
+ public XUnitLogHttpMessageHandler(ITestOutputHelper testOutputHelper)
+ {
+ ArgumentNullException.ThrowIfNull(testOutputHelper);
+
+ _logger = CreateLogger(testOutputHelper);
+ }
+
+ protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
+ {
+ if (_logger.IsEnabled(LogLevel.Debug))
+ {
+ string? requestBody = request.Content == null ? null : await request.Content.ReadAsStringAsync(cancellationToken);
+
+ string requestMessage = string.IsNullOrEmpty(requestBody)
+ ? $"--> {request}"
+ : $"--> {request}{Environment.NewLine}{Environment.NewLine}{requestBody}";
+
+ _logger.LogDebug(requestMessage);
+ }
+
+ HttpResponseMessage response = await base.SendAsync(request, cancellationToken);
+
+ if (_logger.IsEnabled(LogLevel.Debug))
+ {
+ string responseBody = await response.Content.ReadAsStringAsync(cancellationToken);
+
+ string responseMessage = string.IsNullOrEmpty(responseBody)
+ ? $"<-- {response}"
+ : $"<-- {response}{Environment.NewLine}{Environment.NewLine}{responseBody}";
+
+ _logger.LogDebug(responseMessage);
+ }
+
+ return response;
+ }
+
+ private static ILogger CreateLogger(ITestOutputHelper testOutputHelper)
+ {
+ var loggerProvider = new XUnitLoggerProvider(testOutputHelper, null, LogOutputFields.Message);
+ var loggerFactory = new LoggerFactory([loggerProvider]);
+ return loggerFactory.CreateLogger();
+ }
+}
From f8d2a74dcff5491232543f571709fba928d98fb0 Mon Sep 17 00:00:00 2001
From: Bart Koelman <10324372+bkoelman@users.noreply.github.com>
Date: Sat, 24 Feb 2024 15:56:11 +0100
Subject: [PATCH 07/17] Put NSwag-generated clients under source control
---
Directory.Build.props | 1 +
.../GeneratedCode/ExampleApiClient.cs | 8292 +++++++++++
.../GeneratedCode/CamelCaseClient.cs | 4727 ++++++
.../GeneratedCode/KebabCaseClient.cs | 4727 ++++++
.../GeneratedCode/NrtOffMsvOffClient.cs | 4553 ++++++
.../GeneratedCode/NrtOffMsvOnClient.cs | 4611 ++++++
.../GeneratedCode/NrtOnMsvOffClient.cs | 5845 ++++++++
.../GeneratedCode/NrtOnMsvOnClient.cs | 5847 ++++++++
.../GeneratedCode/OpenApiClient.cs | 11884 ++++++++++++++++
.../GeneratedCode/PascalCaseClient.cs | 4727 ++++++
.../GeneratedCode/HeadersClient.cs | 2411 ++++
.../GeneratedCode/QueryStringsClient.cs | 5582 ++++++++
12 files changed, 63207 insertions(+)
create mode 100644 src/Examples/OpenApiNSwagClientExample/GeneratedCode/ExampleApiClient.cs
create mode 100644 test/OpenApiNSwagClientTests/GeneratedCode/CamelCaseClient.cs
create mode 100644 test/OpenApiNSwagClientTests/GeneratedCode/KebabCaseClient.cs
create mode 100644 test/OpenApiNSwagClientTests/GeneratedCode/NrtOffMsvOffClient.cs
create mode 100644 test/OpenApiNSwagClientTests/GeneratedCode/NrtOffMsvOnClient.cs
create mode 100644 test/OpenApiNSwagClientTests/GeneratedCode/NrtOnMsvOffClient.cs
create mode 100644 test/OpenApiNSwagClientTests/GeneratedCode/NrtOnMsvOnClient.cs
create mode 100644 test/OpenApiNSwagClientTests/GeneratedCode/OpenApiClient.cs
create mode 100644 test/OpenApiNSwagClientTests/GeneratedCode/PascalCaseClient.cs
create mode 100644 test/OpenApiNSwagEndToEndTests/GeneratedCode/HeadersClient.cs
create mode 100644 test/OpenApiNSwagEndToEndTests/GeneratedCode/QueryStringsClient.cs
diff --git a/Directory.Build.props b/Directory.Build.props
index 534f9bb7af..1c6884d2ae 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -25,6 +25,7 @@
enable
false
false
+ GeneratedCode
$(MSBuildThisFileDirectory)CodingGuidelines.ruleset
$(MSBuildThisFileDirectory)tests.runsettings
5.5.2
diff --git a/src/Examples/OpenApiNSwagClientExample/GeneratedCode/ExampleApiClient.cs b/src/Examples/OpenApiNSwagClientExample/GeneratedCode/ExampleApiClient.cs
new file mode 100644
index 0000000000..98bc12d2ac
--- /dev/null
+++ b/src/Examples/OpenApiNSwagClientExample/GeneratedCode/ExampleApiClient.cs
@@ -0,0 +1,8292 @@
+//----------------------
+//
+// Generated using the NSwag toolchain v13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
+//
+//----------------------
+
+using JsonApiDotNetCore.OpenApi.Client.NSwag;
+
+#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 612 // Disable "CS0612 '...' is obsolete"
+#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"
+#pragma warning disable 8603 // Disable "CS8603 Possible null reference return"
+#pragma warning disable 8604 // Disable "CS8604 Possible null reference argument for parameter"
+
+namespace OpenApiNSwagClientExample
+{
+ using System = global::System;
+
+ [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v11.0.0.0))")]
+ public partial class ExampleApiClient
+ {
+ private string _baseUrl = "https://localhost:44340";
+ private System.Net.Http.HttpClient _httpClient;
+ private System.Lazy _settings;
+
+ public ExampleApiClient(System.Net.Http.HttpClient httpClient)
+ {
+ _httpClient = httpClient;
+ _settings = new System.Lazy(CreateSerializerSettings, true);
+ }
+
+ 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);
+
+ ///
+ /// Retrieves a collection of people.
+ ///
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// Successfully returns the found people, or an empty array if none were found.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task> GetPersonCollectionAsync(System.Collections.Generic.IDictionary query, string if_None_Match)
+ {
+ return GetPersonCollectionAsync(query, if_None_Match, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Retrieves a collection of people.
+ ///
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// Successfully returns the found people, or an empty array if none were found.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task> GetPersonCollectionAsync(System.Collections.Generic.IDictionary query, string if_None_Match, System.Threading.CancellationToken cancellationToken)
+ {
+ var urlBuilder_ = new System.Text.StringBuilder();
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/people?");
+ if (query != null)
+ {
+ foreach (var item_ in query) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key) + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); }
+ }
+ urlBuilder_.Length--;
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+
+ if (if_None_Match != null)
+ request_.Headers.TryAddWithoutValidation("If-None-Match", ConvertToString(if_None_Match, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Method = new System.Net.Http.HttpMethod("GET");
+ request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/vnd.api+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 ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ return new ApiResponse(status_, headers_, objectResponse_.Object);
+ }
+ else
+ if (status_ == 304)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 400)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The query string is invalid.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Retrieves a collection of people without returning them.
+ ///
+ ///
+ /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
+ ///
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// The operation completed successfully.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task HeadPersonCollectionAsync(System.Collections.Generic.IDictionary query, string if_None_Match)
+ {
+ return HeadPersonCollectionAsync(query, if_None_Match, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Retrieves a collection of people without returning them.
+ ///
+ ///
+ /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
+ ///
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// The operation completed successfully.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task HeadPersonCollectionAsync(System.Collections.Generic.IDictionary query, string if_None_Match, System.Threading.CancellationToken cancellationToken)
+ {
+ var urlBuilder_ = new System.Text.StringBuilder();
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/people?");
+ if (query != null)
+ {
+ foreach (var item_ in query) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key) + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); }
+ }
+ urlBuilder_.Length--;
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+
+ if (if_None_Match != null)
+ request_.Headers.TryAddWithoutValidation("If-None-Match", ConvertToString(if_None_Match, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Method = new System.Net.Http.HttpMethod("HEAD");
+
+ 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)
+ {
+ return new ApiResponse(status_, headers_);
+ }
+ else
+ if (status_ == 304)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 400)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The query string is invalid.", status_, responseText_, headers_, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Creates a new person.
+ ///
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// The attributes and relationships of the person to create.
+ /// The person was successfully created, which resulted in additional changes. The newly created person is returned.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task> PostPersonAsync(System.Collections.Generic.IDictionary query, PersonPostRequestDocument body)
+ {
+ return PostPersonAsync(query, body, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Creates a new person.
+ ///
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// The attributes and relationships of the person to create.
+ /// The person was successfully created, which resulted in additional changes. The newly created person is returned.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task> PostPersonAsync(System.Collections.Generic.IDictionary query, PersonPostRequestDocument body, System.Threading.CancellationToken cancellationToken)
+ {
+ var urlBuilder_ = new System.Text.StringBuilder();
+ urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/people?");
+ if (query != null)
+ {
+ foreach (var item_ in query) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key) + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); }
+ }
+ urlBuilder_.Length--;
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
+ content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/vnd.api+json");
+ request_.Content = content_;
+ request_.Method = new System.Net.Http.HttpMethod("POST");
+ request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/vnd.api+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_ == 201)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ return new ApiResponse(status_, headers_, objectResponse_.Object);
+ }
+ else
+ if (status_ == 204)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The person was successfully created, which did not result in additional changes.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 400)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The query string is invalid or the request body is missing or malformed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 403)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("Client-generated IDs cannot be used at this endpoint.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 409)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("A resource type in the request body is incompatible.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 422)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("Validation of the request body failed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Retrieves an individual person by its identifier.
+ ///
+ /// The identifier of the person to retrieve.
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// Successfully returns the found person.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task> GetPersonAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match)
+ {
+ return GetPersonAsync(id, query, if_None_Match, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Retrieves an individual person by its identifier.
+ ///
+ /// The identifier of the person to retrieve.
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// Successfully returns the found person.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task> GetPersonAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match, 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/people/{id}?");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (query != null)
+ {
+ foreach (var item_ in query) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key) + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); }
+ }
+ urlBuilder_.Length--;
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+
+ if (if_None_Match != null)
+ request_.Headers.TryAddWithoutValidation("If-None-Match", ConvertToString(if_None_Match, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Method = new System.Net.Http.HttpMethod("GET");
+ request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/vnd.api+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 ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ return new ApiResponse(status_, headers_, objectResponse_.Object);
+ }
+ else
+ if (status_ == 304)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 400)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The query string is invalid.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 404)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The person does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Retrieves an individual person by its identifier without returning it.
+ ///
+ ///
+ /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
+ ///
+ /// The identifier of the person to retrieve.
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// The operation completed successfully.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task HeadPersonAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match)
+ {
+ return HeadPersonAsync(id, query, if_None_Match, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Retrieves an individual person by its identifier without returning it.
+ ///
+ ///
+ /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
+ ///
+ /// The identifier of the person to retrieve.
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// The operation completed successfully.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task HeadPersonAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match, 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/people/{id}?");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (query != null)
+ {
+ foreach (var item_ in query) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key) + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); }
+ }
+ urlBuilder_.Length--;
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+
+ if (if_None_Match != null)
+ request_.Headers.TryAddWithoutValidation("If-None-Match", ConvertToString(if_None_Match, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Method = new System.Net.Http.HttpMethod("HEAD");
+
+ 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)
+ {
+ return new ApiResponse(status_, headers_);
+ }
+ else
+ if (status_ == 304)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 400)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The query string is invalid.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 404)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The person does not exist.", status_, responseText_, headers_, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Updates an existing person.
+ ///
+ /// The identifier of the person to update.
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// The attributes and relationships of the person to update. Omitted fields are left unchanged.
+ /// The person was successfully updated, which resulted in additional changes. The updated person is returned.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task> PatchPersonAsync(string id, System.Collections.Generic.IDictionary query, PersonPatchRequestDocument body)
+ {
+ return PatchPersonAsync(id, query, body, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Updates an existing person.
+ ///
+ /// The identifier of the person to update.
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// The attributes and relationships of the person to update. Omitted fields are left unchanged.
+ /// The person was successfully updated, which resulted in additional changes. The updated person is returned.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task> PatchPersonAsync(string id, System.Collections.Generic.IDictionary query, PersonPatchRequestDocument body, 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/people/{id}?");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (query != null)
+ {
+ foreach (var item_ in query) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key) + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); }
+ }
+ urlBuilder_.Length--;
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
+ content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/vnd.api+json");
+ request_.Content = content_;
+ request_.Method = new System.Net.Http.HttpMethod("PATCH");
+ request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/vnd.api+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 ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ return new ApiResponse(status_, headers_, objectResponse_.Object);
+ }
+ else
+ if (status_ == 204)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The person was successfully updated, which did not result in additional changes.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 400)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The query string is invalid or the request body is missing or malformed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 404)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The person or a related resource does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 409)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("A resource type or identifier in the request body is incompatible.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 422)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("Validation of the request body failed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Deletes an existing person by its identifier.
+ ///
+ /// The identifier of the person to delete.
+ /// The person was successfully deleted.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task DeletePersonAsync(string id)
+ {
+ return DeletePersonAsync(id, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Deletes an existing person by its identifier.
+ ///
+ /// The identifier of the person to delete.
+ /// The person was successfully deleted.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task DeletePersonAsync(string 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/people/{id}");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ 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 new ApiResponse(status_, headers_);
+ }
+ else
+ if (status_ == 404)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The person does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Retrieves the related todoItems of an individual person's assignedTodoItems relationship.
+ ///
+ /// The identifier of the person whose related todoItems to retrieve.
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// Successfully returns the found todoItems, or an empty array if none were found.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task> GetPersonAssignedTodoItemsAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match)
+ {
+ return GetPersonAssignedTodoItemsAsync(id, query, if_None_Match, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Retrieves the related todoItems of an individual person's assignedTodoItems relationship.
+ ///
+ /// The identifier of the person whose related todoItems to retrieve.
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// Successfully returns the found todoItems, or an empty array if none were found.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task> GetPersonAssignedTodoItemsAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match, 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/people/{id}/assignedTodoItems?");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (query != null)
+ {
+ foreach (var item_ in query) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key) + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); }
+ }
+ urlBuilder_.Length--;
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+
+ if (if_None_Match != null)
+ request_.Headers.TryAddWithoutValidation("If-None-Match", ConvertToString(if_None_Match, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Method = new System.Net.Http.HttpMethod("GET");
+ request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/vnd.api+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 ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ return new ApiResponse(status_, headers_, objectResponse_.Object);
+ }
+ else
+ if (status_ == 304)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 400)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The query string is invalid.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 404)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The person does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Retrieves the related todoItems of an individual person's assignedTodoItems relationship without returning them.
+ ///
+ ///
+ /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
+ ///
+ /// The identifier of the person whose related todoItems to retrieve.
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// The operation completed successfully.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task HeadPersonAssignedTodoItemsAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match)
+ {
+ return HeadPersonAssignedTodoItemsAsync(id, query, if_None_Match, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Retrieves the related todoItems of an individual person's assignedTodoItems relationship without returning them.
+ ///
+ ///
+ /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
+ ///
+ /// The identifier of the person whose related todoItems to retrieve.
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// The operation completed successfully.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task HeadPersonAssignedTodoItemsAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match, 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/people/{id}/assignedTodoItems?");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (query != null)
+ {
+ foreach (var item_ in query) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key) + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); }
+ }
+ urlBuilder_.Length--;
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+
+ if (if_None_Match != null)
+ request_.Headers.TryAddWithoutValidation("If-None-Match", ConvertToString(if_None_Match, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Method = new System.Net.Http.HttpMethod("HEAD");
+
+ 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)
+ {
+ return new ApiResponse(status_, headers_);
+ }
+ else
+ if (status_ == 304)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 400)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The query string is invalid.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 404)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The person does not exist.", status_, responseText_, headers_, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Retrieves the related todoItem identities of an individual person's assignedTodoItems relationship.
+ ///
+ /// The identifier of the person whose related todoItem identities to retrieve.
+ /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// Successfully returns the found todoItem identities, or an empty array if none were found.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task> GetPersonAssignedTodoItemsRelationshipAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match)
+ {
+ return GetPersonAssignedTodoItemsRelationshipAsync(id, query, if_None_Match, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Retrieves the related todoItem identities of an individual person's assignedTodoItems relationship.
+ ///
+ /// The identifier of the person whose related todoItem identities to retrieve.
+ /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// Successfully returns the found todoItem identities, or an empty array if none were found.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task> GetPersonAssignedTodoItemsRelationshipAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match, 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/people/{id}/relationships/assignedTodoItems?");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (query != null)
+ {
+ foreach (var item_ in query) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key) + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); }
+ }
+ urlBuilder_.Length--;
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+
+ if (if_None_Match != null)
+ request_.Headers.TryAddWithoutValidation("If-None-Match", ConvertToString(if_None_Match, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Method = new System.Net.Http.HttpMethod("GET");
+ request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/vnd.api+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 ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ return new ApiResponse(status_, headers_, objectResponse_.Object);
+ }
+ else
+ if (status_ == 304)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 400)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The query string is invalid.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 404)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The person does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Retrieves the related todoItem identities of an individual person's assignedTodoItems relationship without returning them.
+ ///
+ ///
+ /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
+ ///
+ /// The identifier of the person whose related todoItem identities to retrieve.
+ /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// The operation completed successfully.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task HeadPersonAssignedTodoItemsRelationshipAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match)
+ {
+ return HeadPersonAssignedTodoItemsRelationshipAsync(id, query, if_None_Match, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Retrieves the related todoItem identities of an individual person's assignedTodoItems relationship without returning them.
+ ///
+ ///
+ /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
+ ///
+ /// The identifier of the person whose related todoItem identities to retrieve.
+ /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// The operation completed successfully.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task HeadPersonAssignedTodoItemsRelationshipAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match, 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/people/{id}/relationships/assignedTodoItems?");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (query != null)
+ {
+ foreach (var item_ in query) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key) + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); }
+ }
+ urlBuilder_.Length--;
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+
+ if (if_None_Match != null)
+ request_.Headers.TryAddWithoutValidation("If-None-Match", ConvertToString(if_None_Match, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Method = new System.Net.Http.HttpMethod("HEAD");
+
+ 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)
+ {
+ return new ApiResponse(status_, headers_);
+ }
+ else
+ if (status_ == 304)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 400)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The query string is invalid.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 404)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The person does not exist.", status_, responseText_, headers_, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Adds existing todoItems to the assignedTodoItems relationship of an individual person.
+ ///
+ /// The identifier of the person to add todoItems to.
+ /// The identities of the todoItems to add to the assignedTodoItems relationship.
+ /// The todoItems were successfully added, which did not result in additional changes.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task PostPersonAssignedTodoItemsRelationshipAsync(string id, ToManyTodoItemInRequest body)
+ {
+ return PostPersonAssignedTodoItemsRelationshipAsync(id, body, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Adds existing todoItems to the assignedTodoItems relationship of an individual person.
+ ///
+ /// The identifier of the person to add todoItems to.
+ /// The identities of the todoItems to add to the assignedTodoItems relationship.
+ /// The todoItems were successfully added, which did not result in additional changes.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task PostPersonAssignedTodoItemsRelationshipAsync(string id, ToManyTodoItemInRequest body, 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/people/{id}/relationships/assignedTodoItems");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
+ content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/vnd.api+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 ApiResponse(status_, headers_);
+ }
+ else
+ if (status_ == 400)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The request body is missing or malformed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 404)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The person does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 409)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("A resource type in the request body is incompatible.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Assigns existing todoItems to the assignedTodoItems relationship of an individual person.
+ ///
+ /// The identifier of the person whose assignedTodoItems relationship to assign.
+ /// The identities of the todoItems to assign to the assignedTodoItems relationship, or an empty array to clear the relationship.
+ /// The assignedTodoItems relationship was successfully updated, which did not result in additional changes.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task PatchPersonAssignedTodoItemsRelationshipAsync(string id, ToManyTodoItemInRequest body)
+ {
+ return PatchPersonAssignedTodoItemsRelationshipAsync(id, body, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Assigns existing todoItems to the assignedTodoItems relationship of an individual person.
+ ///
+ /// The identifier of the person whose assignedTodoItems relationship to assign.
+ /// The identities of the todoItems to assign to the assignedTodoItems relationship, or an empty array to clear the relationship.
+ /// The assignedTodoItems relationship was successfully updated, which did not result in additional changes.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task PatchPersonAssignedTodoItemsRelationshipAsync(string id, ToManyTodoItemInRequest body, 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/people/{id}/relationships/assignedTodoItems");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
+ content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/vnd.api+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);
+ 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 ApiResponse(status_, headers_);
+ }
+ else
+ if (status_ == 400)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The request body is missing or malformed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 404)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The person does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 409)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("A resource type in the request body is incompatible.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Removes existing todoItems from the assignedTodoItems relationship of an individual person.
+ ///
+ /// The identifier of the person to remove todoItems from.
+ /// The identities of the todoItems to remove from the assignedTodoItems relationship.
+ /// The todoItems were successfully removed, which did not result in additional changes.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task DeletePersonAssignedTodoItemsRelationshipAsync(string id, ToManyTodoItemInRequest body)
+ {
+ return DeletePersonAssignedTodoItemsRelationshipAsync(id, body, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Removes existing todoItems from the assignedTodoItems relationship of an individual person.
+ ///
+ /// The identifier of the person to remove todoItems from.
+ /// The identities of the todoItems to remove from the assignedTodoItems relationship.
+ /// The todoItems were successfully removed, which did not result in additional changes.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task DeletePersonAssignedTodoItemsRelationshipAsync(string id, ToManyTodoItemInRequest body, 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/people/{id}/relationships/assignedTodoItems");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
+ content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/vnd.api+json");
+ request_.Content = content_;
+ 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 ApiResponse(status_, headers_);
+ }
+ else
+ if (status_ == 400)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The request body is missing or malformed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 404)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The person does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 409)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("A resource type in the request body is incompatible.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Retrieves the related todoItems of an individual person's ownedTodoItems relationship.
+ ///
+ /// The identifier of the person whose related todoItems to retrieve.
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// Successfully returns the found todoItems, or an empty array if none were found.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task> GetPersonOwnedTodoItemsAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match)
+ {
+ return GetPersonOwnedTodoItemsAsync(id, query, if_None_Match, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Retrieves the related todoItems of an individual person's ownedTodoItems relationship.
+ ///
+ /// The identifier of the person whose related todoItems to retrieve.
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// Successfully returns the found todoItems, or an empty array if none were found.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task> GetPersonOwnedTodoItemsAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match, 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/people/{id}/ownedTodoItems?");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (query != null)
+ {
+ foreach (var item_ in query) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key) + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); }
+ }
+ urlBuilder_.Length--;
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+
+ if (if_None_Match != null)
+ request_.Headers.TryAddWithoutValidation("If-None-Match", ConvertToString(if_None_Match, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Method = new System.Net.Http.HttpMethod("GET");
+ request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/vnd.api+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 ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ return new ApiResponse(status_, headers_, objectResponse_.Object);
+ }
+ else
+ if (status_ == 304)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 400)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The query string is invalid.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 404)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The person does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Retrieves the related todoItems of an individual person's ownedTodoItems relationship without returning them.
+ ///
+ ///
+ /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
+ ///
+ /// The identifier of the person whose related todoItems to retrieve.
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// The operation completed successfully.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task HeadPersonOwnedTodoItemsAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match)
+ {
+ return HeadPersonOwnedTodoItemsAsync(id, query, if_None_Match, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Retrieves the related todoItems of an individual person's ownedTodoItems relationship without returning them.
+ ///
+ ///
+ /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
+ ///
+ /// The identifier of the person whose related todoItems to retrieve.
+ /// For syntax, see the documentation for the [`include`](https://www.jsonapi.net/usage/reading/including-relationships.html)/[`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// The operation completed successfully.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task HeadPersonOwnedTodoItemsAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match, 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/people/{id}/ownedTodoItems?");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (query != null)
+ {
+ foreach (var item_ in query) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key) + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); }
+ }
+ urlBuilder_.Length--;
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+
+ if (if_None_Match != null)
+ request_.Headers.TryAddWithoutValidation("If-None-Match", ConvertToString(if_None_Match, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Method = new System.Net.Http.HttpMethod("HEAD");
+
+ 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)
+ {
+ return new ApiResponse(status_, headers_);
+ }
+ else
+ if (status_ == 304)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 400)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The query string is invalid.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 404)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The person does not exist.", status_, responseText_, headers_, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Retrieves the related todoItem identities of an individual person's ownedTodoItems relationship.
+ ///
+ /// The identifier of the person whose related todoItem identities to retrieve.
+ /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// Successfully returns the found todoItem identities, or an empty array if none were found.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task> GetPersonOwnedTodoItemsRelationshipAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match)
+ {
+ return GetPersonOwnedTodoItemsRelationshipAsync(id, query, if_None_Match, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Retrieves the related todoItem identities of an individual person's ownedTodoItems relationship.
+ ///
+ /// The identifier of the person whose related todoItem identities to retrieve.
+ /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// Successfully returns the found todoItem identities, or an empty array if none were found.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task> GetPersonOwnedTodoItemsRelationshipAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match, 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/people/{id}/relationships/ownedTodoItems?");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (query != null)
+ {
+ foreach (var item_ in query) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key) + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); }
+ }
+ urlBuilder_.Length--;
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+
+ if (if_None_Match != null)
+ request_.Headers.TryAddWithoutValidation("If-None-Match", ConvertToString(if_None_Match, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Method = new System.Net.Http.HttpMethod("GET");
+ request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/vnd.api+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 ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ return new ApiResponse(status_, headers_, objectResponse_.Object);
+ }
+ else
+ if (status_ == 304)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 400)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The query string is invalid.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 404)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The person does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Retrieves the related todoItem identities of an individual person's ownedTodoItems relationship without returning them.
+ ///
+ ///
+ /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
+ ///
+ /// The identifier of the person whose related todoItem identities to retrieve.
+ /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// The operation completed successfully.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task HeadPersonOwnedTodoItemsRelationshipAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match)
+ {
+ return HeadPersonOwnedTodoItemsRelationshipAsync(id, query, if_None_Match, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Retrieves the related todoItem identities of an individual person's ownedTodoItems relationship without returning them.
+ ///
+ ///
+ /// Compare the returned ETag HTTP header with an earlier one to determine if the response has changed since it was fetched.
+ ///
+ /// The identifier of the person whose related todoItem identities to retrieve.
+ /// For syntax, see the documentation for the [`filter`](https://www.jsonapi.net/usage/reading/filtering.html)/[`sort`](https://www.jsonapi.net/usage/reading/sorting.html)/[`page`](https://www.jsonapi.net/usage/reading/pagination.html)/[`fields`](https://www.jsonapi.net/usage/reading/sparse-fieldset-selection.html) query string parameters.
+ /// A list of ETags, resulting in HTTP status 304 without a body, if one of them matches the current fingerprint.
+ /// The operation completed successfully.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task HeadPersonOwnedTodoItemsRelationshipAsync(string id, System.Collections.Generic.IDictionary query, string if_None_Match, 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/people/{id}/relationships/ownedTodoItems?");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+ if (query != null)
+ {
+ foreach (var item_ in query) { urlBuilder_.Append(System.Uri.EscapeDataString(item_.Key) + "=").Append(System.Uri.EscapeDataString(ConvertToString(item_.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); }
+ }
+ urlBuilder_.Length--;
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+
+ if (if_None_Match != null)
+ request_.Headers.TryAddWithoutValidation("If-None-Match", ConvertToString(if_None_Match, System.Globalization.CultureInfo.InvariantCulture));
+ request_.Method = new System.Net.Http.HttpMethod("HEAD");
+
+ 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)
+ {
+ return new ApiResponse(status_, headers_);
+ }
+ else
+ if (status_ == 304)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The fingerprint of the HTTP response matches one of the ETags from the incoming If-None-Match header.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 400)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The query string is invalid.", status_, responseText_, headers_, null);
+ }
+ else
+ if (status_ == 404)
+ {
+ string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
+ throw new ApiException("The person does not exist.", status_, responseText_, headers_, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Adds existing todoItems to the ownedTodoItems relationship of an individual person.
+ ///
+ /// The identifier of the person to add todoItems to.
+ /// The identities of the todoItems to add to the ownedTodoItems relationship.
+ /// The todoItems were successfully added, which did not result in additional changes.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task PostPersonOwnedTodoItemsRelationshipAsync(string id, ToManyTodoItemInRequest body)
+ {
+ return PostPersonOwnedTodoItemsRelationshipAsync(id, body, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Adds existing todoItems to the ownedTodoItems relationship of an individual person.
+ ///
+ /// The identifier of the person to add todoItems to.
+ /// The identities of the todoItems to add to the ownedTodoItems relationship.
+ /// The todoItems were successfully added, which did not result in additional changes.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task PostPersonOwnedTodoItemsRelationshipAsync(string id, ToManyTodoItemInRequest body, 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/people/{id}/relationships/ownedTodoItems");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
+ content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/vnd.api+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 ApiResponse(status_, headers_);
+ }
+ else
+ if (status_ == 400)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The request body is missing or malformed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 404)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The person does not exist.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 409)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("A resource type in the request body is incompatible.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ 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();
+ }
+ }
+
+ ///
+ /// Assigns existing todoItems to the ownedTodoItems relationship of an individual person.
+ ///
+ /// The identifier of the person whose ownedTodoItems relationship to assign.
+ /// The identities of the todoItems to assign to the ownedTodoItems relationship, or an empty array to clear the relationship.
+ /// The ownedTodoItems relationship was successfully updated, which did not result in additional changes.
+ /// A server side error occurred.
+ public virtual System.Threading.Tasks.Task PatchPersonOwnedTodoItemsRelationshipAsync(string id, ToManyTodoItemInRequest body)
+ {
+ return PatchPersonOwnedTodoItemsRelationshipAsync(id, body, System.Threading.CancellationToken.None);
+ }
+
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ /// Assigns existing todoItems to the ownedTodoItems relationship of an individual person.
+ ///
+ /// The identifier of the person whose ownedTodoItems relationship to assign.
+ /// The identities of the todoItems to assign to the ownedTodoItems relationship, or an empty array to clear the relationship.
+ /// The ownedTodoItems relationship was successfully updated, which did not result in additional changes.
+ /// A server side error occurred.
+ public virtual async System.Threading.Tasks.Task PatchPersonOwnedTodoItemsRelationshipAsync(string id, ToManyTodoItemInRequest body, 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/people/{id}/relationships/ownedTodoItems");
+ urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
+
+ var client_ = _httpClient;
+ var disposeClient_ = false;
+ try
+ {
+ using (var request_ = new System.Net.Http.HttpRequestMessage())
+ {
+ var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
+ var content_ = new System.Net.Http.StringContent(json_);
+ content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/vnd.api+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);
+ 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 ApiResponse(status_, headers_);
+ }
+ else
+ if (status_ == 400)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false);
+ if (objectResponse_.Object == null)
+ {
+ throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
+ }
+ throw new ApiException("The request body is missing or malformed.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
+ }
+ else
+ if (status_ == 404)
+ {
+ var objectResponse_ = await ReadObjectResponseAsync