From 011982ab9cbeecc0bfa4c3c0596d7e5f73dc770c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 8 Feb 2023 20:54:56 +0800 Subject: [PATCH] [csharp-netcore] add tests for uuid string with pattern (#14411) * add tests for uuid with pattern in csharp clients * update samples * update samples * update --- ...odels-for-testing-with-http-signature.yaml | 12 ++++ .../docs/FakeApi.md | 8 ++- ...dPropertiesAndAdditionalPropertiesClass.md | 1 + .../src/Org.OpenAPITools/Api/FakeApi.cs | 30 ++++++---- ...dPropertiesAndAdditionalPropertiesClass.cs | 44 ++++++++++++++- .../docs/apis/FakeApi.md | 8 ++- ...dPropertiesAndAdditionalPropertiesClass.md | 1 + .../Org.OpenAPITools.Test/Api/FakeApiTests.cs | 3 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 56 ++++++++++++++----- ...dPropertiesAndAdditionalPropertiesClass.cs | 28 +++++++++- .../docs/apis/FakeApi.md | 8 ++- ...dPropertiesAndAdditionalPropertiesClass.md | 1 + .../Org.OpenAPITools.Test/Api/FakeApiTests.cs | 3 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 48 ++++++++++++---- ...dPropertiesAndAdditionalPropertiesClass.cs | 28 +++++++++- .../docs/apis/FakeApi.md | 8 ++- ...dPropertiesAndAdditionalPropertiesClass.md | 1 + .../Org.OpenAPITools.Test/Api/FakeApiTests.cs | 3 +- .../src/Org.OpenAPITools/Api/FakeApi.cs | 48 ++++++++++++---- ...dPropertiesAndAdditionalPropertiesClass.cs | 28 +++++++++- .../OpenAPIClient-httpclient/docs/FakeApi.md | 8 ++- ...dPropertiesAndAdditionalPropertiesClass.md | 1 + .../src/Org.OpenAPITools/Api/FakeApi.cs | 30 ++++++---- ...dPropertiesAndAdditionalPropertiesClass.cs | 22 +++++++- .../OpenAPIClient-net47/docs/FakeApi.md | 8 ++- ...dPropertiesAndAdditionalPropertiesClass.md | 1 + .../src/Org.OpenAPITools/Api/FakeApi.cs | 30 ++++++---- ...dPropertiesAndAdditionalPropertiesClass.cs | 22 +++++++- .../OpenAPIClient-net48/docs/FakeApi.md | 8 ++- ...dPropertiesAndAdditionalPropertiesClass.md | 1 + .../src/Org.OpenAPITools/Api/FakeApi.cs | 30 ++++++---- ...dPropertiesAndAdditionalPropertiesClass.cs | 22 +++++++- .../OpenAPIClient-net5.0/docs/FakeApi.md | 8 ++- ...dPropertiesAndAdditionalPropertiesClass.md | 1 + .../src/Org.OpenAPITools/Api/FakeApi.cs | 30 ++++++---- ...dPropertiesAndAdditionalPropertiesClass.cs | 22 +++++++- .../OpenAPIClient/docs/FakeApi.md | 8 ++- ...dPropertiesAndAdditionalPropertiesClass.md | 1 + .../src/Org.OpenAPITools/Api/FakeApi.cs | 30 ++++++---- ...dPropertiesAndAdditionalPropertiesClass.cs | 22 +++++++- .../OpenAPIClientCore/docs/FakeApi.md | 8 ++- ...dPropertiesAndAdditionalPropertiesClass.md | 1 + .../src/Org.OpenAPITools/Api/FakeApi.cs | 30 ++++++---- ...dPropertiesAndAdditionalPropertiesClass.cs | 22 +++++++- 44 files changed, 578 insertions(+), 155 deletions(-) diff --git a/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml b/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml index 8a003841821..2e6be05a4b0 100644 --- a/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml @@ -848,6 +848,14 @@ paths: - fake description: Test serialization of outer string types operationId: fakeOuterStringSerialize + parameters: + - name: required_string_uuid + in: query + description: Required UUID String + required: true + schema: + type: string + format: uuid responses: '200': description: Output string @@ -1621,6 +1629,10 @@ components: MixedPropertiesAndAdditionalPropertiesClass: type: object properties: + uuid_with_pattern: + type: string + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" uuid: type: string format: uuid diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/FakeApi.md index 212d1d35c49..4b5bf803c4e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/FakeApi.md @@ -373,7 +373,7 @@ No authorization required # **FakeOuterStringSerialize** -> string FakeOuterStringSerialize (string body = null) +> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null) @@ -396,11 +396,12 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); + var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String var body = "body_example"; // string | Input string as post body (optional) try { - string result = apiInstance.FakeOuterStringSerialize(body); + string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body); Debug.WriteLine(result); } catch (ApiException e) @@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code ```csharp try { - ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body); + ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); Debug.Write("Response Body: " + response.Data); @@ -437,6 +438,7 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| +| **requiredStringUuid** | **Guid** | Required UUID String | | | **body** | **string** | Input string as post body | [optional] | ### Return type diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 5f57db957d7..050210a3e37 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**UuidWithPattern** | **Guid** | | [optional] **Uuid** | **Guid** | | [optional] **DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs index 5991b7f0b78..ca68e330338 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Api/FakeApi.cs @@ -121,10 +121,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// string - string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0); + string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0); /// /// @@ -133,10 +134,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// ApiResponse of string - ApiResponse FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0); + ApiResponse FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0); /// /// Array of Enums /// @@ -529,11 +531,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -542,11 +545,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Array of Enums /// @@ -1509,12 +1513,13 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// string - public string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0) + public string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); return localVarResponse.Data; } @@ -1522,10 +1527,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// ApiResponse of string - public Org.OpenAPITools.Client.ApiResponse FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0) + public Org.OpenAPITools.Client.ApiResponse FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1550,6 +1556,7 @@ namespace Org.OpenAPITools.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid)); localVarRequestOptions.Data = body; localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize"; @@ -1574,13 +1581,14 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(body, operationIndex, cancellationToken).ConfigureAwait(false); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } @@ -1588,11 +1596,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1618,6 +1627,7 @@ namespace Org.OpenAPITools.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid)); localVarRequestOptions.Data = body; localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize"; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index f4c0f85ea8d..de88a24f150 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -35,11 +35,17 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// + /// uuidWithPattern. /// uuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuidWithPattern = default(Guid), Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) { + this._UuidWithPattern = uuidWithPattern; + if (this.UuidWithPattern != null) + { + this._flagUuidWithPattern = true; + } this._Uuid = uuid; if (this.Uuid != null) { @@ -58,6 +64,30 @@ namespace Org.OpenAPITools.Model this.AdditionalProperties = new Dictionary(); } + /// + /// Gets or Sets UuidWithPattern + /// + [DataMember(Name = "uuid_with_pattern", EmitDefaultValue = false)] + public Guid UuidWithPattern + { + get{ return _UuidWithPattern;} + set + { + _UuidWithPattern = value; + _flagUuidWithPattern = true; + } + } + private Guid _UuidWithPattern; + private bool _flagUuidWithPattern; + + /// + /// Returns false as UuidWithPattern should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeUuidWithPattern() + { + return _flagUuidWithPattern; + } /// /// Gets or Sets Uuid /// @@ -144,6 +174,7 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Map: ").Append(Map).Append("\n"); @@ -190,6 +221,10 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.UuidWithPattern != null) + { + hashCode = (hashCode * 59) + this.UuidWithPattern.GetHashCode(); + } if (this.Uuid != null) { hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); @@ -217,6 +252,13 @@ namespace Org.OpenAPITools.Model /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // UuidWithPattern (Guid) pattern + Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); + } + yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/FakeApi.md index 77826f0673b..acdcf538944 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/apis/FakeApi.md @@ -373,7 +373,7 @@ No authorization required # **FakeOuterStringSerialize** -> string FakeOuterStringSerialize (string? body = null) +> string FakeOuterStringSerialize (Guid requiredStringUuid, string? body = null) @@ -396,11 +396,12 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); + var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String var body = "body_example"; // string? | Input string as post body (optional) try { - string result = apiInstance.FakeOuterStringSerialize(body); + string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body); Debug.WriteLine(result); } catch (ApiException e) @@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code ```csharp try { - ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body); + ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); Debug.Write("Response Body: " + response.Data); @@ -437,6 +438,7 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| +| **requiredStringUuid** | **Guid** | Required UUID String | | | **body** | **string?** | Input string as post body | [optional] | ### Return type diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md index 0bac85a8e83..1bc0740add9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] **Uuid** | **Guid** | | [optional] +**UuidWithPattern** | **Guid** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs index 84ff71fb14d..f3827621211 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -100,8 +100,9 @@ namespace Org.OpenAPITools.Test.Api [Fact (Skip = "not implemented")] public async Task FakeOuterStringSerializeAsyncTest() { + Guid requiredStringUuid = default; string? body = default; - var response = await _instance.FakeOuterStringSerializeAsync(body); + var response = await _instance.FakeOuterStringSerializeAsync(requiredStringUuid, body); Assert.IsType(response); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs index 8732ee2357c..e9cca0ad46c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Api/FakeApi.cs @@ -173,10 +173,11 @@ namespace Org.OpenAPITools.IApi /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// Task<ApiResponse<string?>> - Task> FakeOuterStringSerializeWithHttpInfoAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null); + Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string? body = null, System.Threading.CancellationToken? cancellationToken = null); /// /// @@ -185,10 +186,11 @@ namespace Org.OpenAPITools.IApi /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse<string> - Task FakeOuterStringSerializeAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null); + Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string? body = null, System.Threading.CancellationToken? cancellationToken = null); /// /// @@ -196,10 +198,11 @@ namespace Org.OpenAPITools.IApi /// /// Test serialization of outer string types /// + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse<string?> - Task FakeOuterStringSerializeOrDefaultAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null); + Task FakeOuterStringSerializeOrDefaultAsync(Guid requiredStringUuid, string? body = null, System.Threading.CancellationToken? cancellationToken = null); /// /// Array of Enums @@ -1294,12 +1297,13 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// <> - public async Task FakeOuterStringSerializeAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null) + public async Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string? body = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeOuterStringSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + ApiResponse result = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); if (result.Content == null) throw new ApiException(result.ReasonPhrase, result.StatusCode, result.RawContent); @@ -1311,15 +1315,16 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// <> - public async Task FakeOuterStringSerializeOrDefaultAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null) + public async Task FakeOuterStringSerializeOrDefaultAsync(Guid requiredStringUuid, string? body = null, System.Threading.CancellationToken? cancellationToken = null) { ApiResponse? result = null; try { - result = await FakeOuterStringSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + result = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); } catch (Exception) { @@ -1333,19 +1338,30 @@ namespace Org.OpenAPITools.Api /// /// Validates the request parameters /// + /// /// /// - protected virtual string? OnFakeOuterStringSerialize(string? body) + protected virtual (Guid, string?) OnFakeOuterStringSerialize(Guid requiredStringUuid, string? body) { - return body; + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (requiredStringUuid == null) + throw new ArgumentNullException(nameof(requiredStringUuid)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + return (requiredStringUuid, body); } /// /// Processes the server response /// /// + /// /// - protected virtual void AfterFakeOuterStringSerialize(ApiResponse apiResponse, string? body) + protected virtual void AfterFakeOuterStringSerialize(ApiResponse apiResponse, Guid requiredStringUuid, string? body) { } @@ -1355,8 +1371,9 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// - protected virtual void OnErrorFakeOuterStringSerialize(Exception exception, string pathFormat, string path, string? body) + protected virtual void OnErrorFakeOuterStringSerialize(Exception exception, string pathFormat, string path, Guid requiredStringUuid, string? body) { Logger.LogError(exception, "An error occurred while sending the request to the server."); } @@ -1365,16 +1382,19 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// <> where T : - public async Task> FakeOuterStringSerializeWithHttpInfoAsync(string? body = null, System.Threading.CancellationToken? cancellationToken = null) + public async Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string? body = null, System.Threading.CancellationToken? cancellationToken = null) { UriBuilder uriBuilder = new UriBuilder(); try { - body = OnFakeOuterStringSerialize(body); + var validatedParameters = OnFakeOuterStringSerialize(requiredStringUuid, body); + requiredStringUuid = validatedParameters.Item1; + body = validatedParameters.Item2; using (HttpRequestMessage request = new HttpRequestMessage()) { @@ -1383,6 +1403,12 @@ namespace Org.OpenAPITools.Api uriBuilder.Scheme = ClientUtils.SCHEME; uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string"; + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["required_string_uuid"] = Uri.EscapeDataString(requiredStringUuid.ToString()!); + + uriBuilder.Query = parseQueryString.ToString(); + request.Content = (body as object) is System.IO.Stream stream ? request.Content = new StreamContent(stream) : request.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); @@ -1424,7 +1450,7 @@ namespace Org.OpenAPITools.Api if (apiResponse.IsSuccessStatusCode) { apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeOuterStringSerialize(apiResponse, body); + AfterFakeOuterStringSerialize(apiResponse, requiredStringUuid, body); } return apiResponse; @@ -1433,7 +1459,7 @@ namespace Org.OpenAPITools.Api } catch(Exception e) { - OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilder.Path, body); + OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilder.Path, requiredStringUuid, body); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 5283098e113..1e9d78c798c 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0-nrt/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -36,12 +36,16 @@ namespace Org.OpenAPITools.Model /// dateTime /// map /// uuid + /// uuidWithPattern [JsonConstructor] - public MixedPropertiesAndAdditionalPropertiesClass(DateTime dateTime, Dictionary map, Guid uuid) + public MixedPropertiesAndAdditionalPropertiesClass(DateTime dateTime, Dictionary map, Guid uuid, Guid uuidWithPattern) { #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (uuidWithPattern == null) + throw new ArgumentNullException("uuidWithPattern is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); + if (uuid == null) throw new ArgumentNullException("uuid is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); @@ -57,6 +61,7 @@ namespace Org.OpenAPITools.Model DateTime = dateTime; Map = map; Uuid = uuid; + UuidWithPattern = uuidWithPattern; } /// @@ -77,6 +82,12 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("uuid")] public Guid Uuid { get; set; } + /// + /// Gets or Sets UuidWithPattern + /// + [JsonPropertyName("uuid_with_pattern")] + public Guid UuidWithPattern { get; set; } + /// /// Gets or Sets additional properties /// @@ -94,6 +105,7 @@ namespace Org.OpenAPITools.Model sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Map: ").Append(Map).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -105,6 +117,13 @@ namespace Org.OpenAPITools.Model /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // UuidWithPattern (Guid) pattern + Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); + } + yield break; } } @@ -134,6 +153,7 @@ namespace Org.OpenAPITools.Model DateTime dateTime = default; Dictionary map = default; Guid uuid = default; + Guid uuidWithPattern = default; while (utf8JsonReader.Read()) { @@ -159,13 +179,16 @@ namespace Org.OpenAPITools.Model case "uuid": uuid = utf8JsonReader.GetGuid(); break; + case "uuid_with_pattern": + uuidWithPattern = utf8JsonReader.GetGuid(); + break; default: break; } } } - return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid); + return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid, uuidWithPattern); } /// @@ -184,6 +207,7 @@ namespace Org.OpenAPITools.Model writer.WritePropertyName("map"); JsonSerializer.Serialize(writer, mixedPropertiesAndAdditionalPropertiesClass.Map, jsonSerializerOptions); writer.WriteString("uuid", mixedPropertiesAndAdditionalPropertiesClass.Uuid); + writer.WriteString("uuid_with_pattern", mixedPropertiesAndAdditionalPropertiesClass.UuidWithPattern); writer.WriteEndObject(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/FakeApi.md index b815f20b5a0..1b47e75a7dd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/apis/FakeApi.md @@ -373,7 +373,7 @@ No authorization required # **FakeOuterStringSerialize** -> string FakeOuterStringSerialize (string body = null) +> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null) @@ -396,11 +396,12 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); + var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String var body = "body_example"; // string | Input string as post body (optional) try { - string result = apiInstance.FakeOuterStringSerialize(body); + string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body); Debug.WriteLine(result); } catch (ApiException e) @@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code ```csharp try { - ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body); + ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); Debug.Write("Response Body: " + response.Data); @@ -437,6 +438,7 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| +| **requiredStringUuid** | **Guid** | Required UUID String | | | **body** | **string** | Input string as post body | [optional] | ### Return type diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md index 0bac85a8e83..1bc0740add9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] **Uuid** | **Guid** | | [optional] +**UuidWithPattern** | **Guid** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs index 4c965120e69..0ba3c2103cf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -100,8 +100,9 @@ namespace Org.OpenAPITools.Test.Api [Fact (Skip = "not implemented")] public async Task FakeOuterStringSerializeAsyncTest() { + Guid requiredStringUuid = default; string body = default; - var response = await _instance.FakeOuterStringSerializeAsync(body); + var response = await _instance.FakeOuterStringSerializeAsync(requiredStringUuid, body); Assert.IsType(response); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs index 0c0b289c532..cb0bb021040 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Api/FakeApi.cs @@ -128,10 +128,11 @@ namespace Org.OpenAPITools.IApi /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// Task<ApiResponse<string>> - Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null); + Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null); /// /// @@ -140,10 +141,11 @@ namespace Org.OpenAPITools.IApi /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse<string> - Task FakeOuterStringSerializeAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null); + Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null); /// /// Array of Enums @@ -1056,12 +1058,13 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// <> - public async Task FakeOuterStringSerializeAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null) + public async Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeOuterStringSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + ApiResponse result = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' if (result.Content == null) @@ -1074,19 +1077,30 @@ namespace Org.OpenAPITools.Api /// /// Validates the request parameters /// + /// /// /// - protected virtual string OnFakeOuterStringSerialize(string body) + protected virtual (Guid, string) OnFakeOuterStringSerialize(Guid requiredStringUuid, string body) { - return body; + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (requiredStringUuid == null) + throw new ArgumentNullException(nameof(requiredStringUuid)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + return (requiredStringUuid, body); } /// /// Processes the server response /// /// + /// /// - protected virtual void AfterFakeOuterStringSerialize(ApiResponse apiResponse, string body) + protected virtual void AfterFakeOuterStringSerialize(ApiResponse apiResponse, Guid requiredStringUuid, string body) { } @@ -1096,8 +1110,9 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// - protected virtual void OnErrorFakeOuterStringSerialize(Exception exception, string pathFormat, string path, string body) + protected virtual void OnErrorFakeOuterStringSerialize(Exception exception, string pathFormat, string path, Guid requiredStringUuid, string body) { Logger.LogError(exception, "An error occurred while sending the request to the server."); } @@ -1106,16 +1121,19 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// <> where T : - public async Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null) + public async Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null) { UriBuilder uriBuilder = new UriBuilder(); try { - body = OnFakeOuterStringSerialize(body); + var validatedParameters = OnFakeOuterStringSerialize(requiredStringUuid, body); + requiredStringUuid = validatedParameters.Item1; + body = validatedParameters.Item2; using (HttpRequestMessage request = new HttpRequestMessage()) { @@ -1124,6 +1142,12 @@ namespace Org.OpenAPITools.Api uriBuilder.Scheme = ClientUtils.SCHEME; uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string"; + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["required_string_uuid"] = Uri.EscapeDataString(requiredStringUuid.ToString()); + + uriBuilder.Query = parseQueryString.ToString(); + request.Content = (body as object) is System.IO.Stream stream ? request.Content = new StreamContent(stream) : request.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); @@ -1165,7 +1189,7 @@ namespace Org.OpenAPITools.Api if (apiResponse.IsSuccessStatusCode) { apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeOuterStringSerialize(apiResponse, body); + AfterFakeOuterStringSerialize(apiResponse, requiredStringUuid, body); } return apiResponse; @@ -1174,7 +1198,7 @@ namespace Org.OpenAPITools.Api } catch(Exception e) { - OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilder.Path, body); + OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilder.Path, requiredStringUuid, body); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 16a13ec3d17..a2c31499e85 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-net6.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -34,12 +34,16 @@ namespace Org.OpenAPITools.Model /// dateTime /// map /// uuid + /// uuidWithPattern [JsonConstructor] - public MixedPropertiesAndAdditionalPropertiesClass(DateTime dateTime, Dictionary map, Guid uuid) + public MixedPropertiesAndAdditionalPropertiesClass(DateTime dateTime, Dictionary map, Guid uuid, Guid uuidWithPattern) { #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (uuidWithPattern == null) + throw new ArgumentNullException("uuidWithPattern is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); + if (uuid == null) throw new ArgumentNullException("uuid is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); @@ -55,6 +59,7 @@ namespace Org.OpenAPITools.Model DateTime = dateTime; Map = map; Uuid = uuid; + UuidWithPattern = uuidWithPattern; } /// @@ -75,6 +80,12 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("uuid")] public Guid Uuid { get; set; } + /// + /// Gets or Sets UuidWithPattern + /// + [JsonPropertyName("uuid_with_pattern")] + public Guid UuidWithPattern { get; set; } + /// /// Gets or Sets additional properties /// @@ -92,6 +103,7 @@ namespace Org.OpenAPITools.Model sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Map: ").Append(Map).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -103,6 +115,13 @@ namespace Org.OpenAPITools.Model /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // UuidWithPattern (Guid) pattern + Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); + } + yield break; } } @@ -132,6 +151,7 @@ namespace Org.OpenAPITools.Model DateTime dateTime = default; Dictionary map = default; Guid uuid = default; + Guid uuidWithPattern = default; while (utf8JsonReader.Read()) { @@ -157,13 +177,16 @@ namespace Org.OpenAPITools.Model case "uuid": uuid = utf8JsonReader.GetGuid(); break; + case "uuid_with_pattern": + uuidWithPattern = utf8JsonReader.GetGuid(); + break; default: break; } } } - return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid); + return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid, uuidWithPattern); } /// @@ -182,6 +205,7 @@ namespace Org.OpenAPITools.Model writer.WritePropertyName("map"); JsonSerializer.Serialize(writer, mixedPropertiesAndAdditionalPropertiesClass.Map, jsonSerializerOptions); writer.WriteString("uuid", mixedPropertiesAndAdditionalPropertiesClass.Uuid); + writer.WriteString("uuid_with_pattern", mixedPropertiesAndAdditionalPropertiesClass.UuidWithPattern); writer.WriteEndObject(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/FakeApi.md index b815f20b5a0..1b47e75a7dd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/apis/FakeApi.md @@ -373,7 +373,7 @@ No authorization required # **FakeOuterStringSerialize** -> string FakeOuterStringSerialize (string body = null) +> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null) @@ -396,11 +396,12 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); + var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String var body = "body_example"; // string | Input string as post body (optional) try { - string result = apiInstance.FakeOuterStringSerialize(body); + string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body); Debug.WriteLine(result); } catch (ApiException e) @@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code ```csharp try { - ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body); + ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); Debug.Write("Response Body: " + response.Data); @@ -437,6 +438,7 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| +| **requiredStringUuid** | **Guid** | Required UUID String | | | **body** | **string** | Input string as post body | [optional] | ### Return type diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md index 0bac85a8e83..1bc0740add9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/docs/models/MixedPropertiesAndAdditionalPropertiesClass.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] **Uuid** | **Guid** | | [optional] +**UuidWithPattern** | **Guid** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs index 4c965120e69..0ba3c2103cf 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools.Test/Api/FakeApiTests.cs @@ -100,8 +100,9 @@ namespace Org.OpenAPITools.Test.Api [Fact (Skip = "not implemented")] public async Task FakeOuterStringSerializeAsyncTest() { + Guid requiredStringUuid = default; string body = default; - var response = await _instance.FakeOuterStringSerializeAsync(body); + var response = await _instance.FakeOuterStringSerializeAsync(requiredStringUuid, body); Assert.IsType(response); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs index c017ba3eccb..8c66c497f52 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Api/FakeApi.cs @@ -128,10 +128,11 @@ namespace Org.OpenAPITools.IApi /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// Task<ApiResponse<string>> - Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null); + Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null); /// /// @@ -140,10 +141,11 @@ namespace Org.OpenAPITools.IApi /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse<string> - Task FakeOuterStringSerializeAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null); + Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null); /// /// Array of Enums @@ -1056,12 +1058,13 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// <> - public async Task FakeOuterStringSerializeAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null) + public async Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null) { - ApiResponse result = await FakeOuterStringSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + ApiResponse result = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' if (result.Content == null) @@ -1074,19 +1077,30 @@ namespace Org.OpenAPITools.Api /// /// Validates the request parameters /// + /// /// /// - protected virtual string OnFakeOuterStringSerialize(string body) + protected virtual (Guid, string) OnFakeOuterStringSerialize(Guid requiredStringUuid, string body) { - return body; + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + if (requiredStringUuid == null) + throw new ArgumentNullException(nameof(requiredStringUuid)); + + #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' + #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + + return (requiredStringUuid, body); } /// /// Processes the server response /// /// + /// /// - protected virtual void AfterFakeOuterStringSerialize(ApiResponse apiResponse, string body) + protected virtual void AfterFakeOuterStringSerialize(ApiResponse apiResponse, Guid requiredStringUuid, string body) { } @@ -1096,8 +1110,9 @@ namespace Org.OpenAPITools.Api /// /// /// + /// /// - protected virtual void OnErrorFakeOuterStringSerialize(Exception exception, string pathFormat, string path, string body) + protected virtual void OnErrorFakeOuterStringSerialize(Exception exception, string pathFormat, string path, Guid requiredStringUuid, string body) { Logger.LogError(exception, "An error occurred while sending the request to the server."); } @@ -1106,16 +1121,19 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// <> where T : - public async Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = null, System.Threading.CancellationToken? cancellationToken = null) + public async Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = null, System.Threading.CancellationToken? cancellationToken = null) { UriBuilder uriBuilder = new UriBuilder(); try { - body = OnFakeOuterStringSerialize(body); + var validatedParameters = OnFakeOuterStringSerialize(requiredStringUuid, body); + requiredStringUuid = validatedParameters.Item1; + body = validatedParameters.Item2; using (HttpRequestMessage request = new HttpRequestMessage()) { @@ -1124,6 +1142,12 @@ namespace Org.OpenAPITools.Api uriBuilder.Scheme = ClientUtils.SCHEME; uriBuilder.Path = ClientUtils.CONTEXT_PATH + "/fake/outer/string"; + System.Collections.Specialized.NameValueCollection parseQueryString = System.Web.HttpUtility.ParseQueryString(string.Empty); + + parseQueryString["required_string_uuid"] = Uri.EscapeDataString(requiredStringUuid.ToString()); + + uriBuilder.Query = parseQueryString.ToString(); + request.Content = (body as object) is System.IO.Stream stream ? request.Content = new StreamContent(stream) : request.Content = new StringContent(JsonSerializer.Serialize(body, _jsonSerializerOptions)); @@ -1165,7 +1189,7 @@ namespace Org.OpenAPITools.Api if (apiResponse.IsSuccessStatusCode) { apiResponse.Content = JsonSerializer.Deserialize(apiResponse.RawContent, _jsonSerializerOptions); - AfterFakeOuterStringSerialize(apiResponse, body); + AfterFakeOuterStringSerialize(apiResponse, requiredStringUuid, body); } return apiResponse; @@ -1174,7 +1198,7 @@ namespace Org.OpenAPITools.Api } catch(Exception e) { - OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilder.Path, body); + OnErrorFakeOuterStringSerialize(e, "/fake/outer/string", uriBuilder.Path, requiredStringUuid, body); throw; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 16a13ec3d17..a2c31499e85 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-generichost-netstandard2.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -34,12 +34,16 @@ namespace Org.OpenAPITools.Model /// dateTime /// map /// uuid + /// uuidWithPattern [JsonConstructor] - public MixedPropertiesAndAdditionalPropertiesClass(DateTime dateTime, Dictionary map, Guid uuid) + public MixedPropertiesAndAdditionalPropertiesClass(DateTime dateTime, Dictionary map, Guid uuid, Guid uuidWithPattern) { #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' #pragma warning disable CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null' + if (uuidWithPattern == null) + throw new ArgumentNullException("uuidWithPattern is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); + if (uuid == null) throw new ArgumentNullException("uuid is a required property for MixedPropertiesAndAdditionalPropertiesClass and cannot be null."); @@ -55,6 +59,7 @@ namespace Org.OpenAPITools.Model DateTime = dateTime; Map = map; Uuid = uuid; + UuidWithPattern = uuidWithPattern; } /// @@ -75,6 +80,12 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("uuid")] public Guid Uuid { get; set; } + /// + /// Gets or Sets UuidWithPattern + /// + [JsonPropertyName("uuid_with_pattern")] + public Guid UuidWithPattern { get; set; } + /// /// Gets or Sets additional properties /// @@ -92,6 +103,7 @@ namespace Org.OpenAPITools.Model sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Map: ").Append(Map).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); + sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -103,6 +115,13 @@ namespace Org.OpenAPITools.Model /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // UuidWithPattern (Guid) pattern + Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); + } + yield break; } } @@ -132,6 +151,7 @@ namespace Org.OpenAPITools.Model DateTime dateTime = default; Dictionary map = default; Guid uuid = default; + Guid uuidWithPattern = default; while (utf8JsonReader.Read()) { @@ -157,13 +177,16 @@ namespace Org.OpenAPITools.Model case "uuid": uuid = utf8JsonReader.GetGuid(); break; + case "uuid_with_pattern": + uuidWithPattern = utf8JsonReader.GetGuid(); + break; default: break; } } } - return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid); + return new MixedPropertiesAndAdditionalPropertiesClass(dateTime, map, uuid, uuidWithPattern); } /// @@ -182,6 +205,7 @@ namespace Org.OpenAPITools.Model writer.WritePropertyName("map"); JsonSerializer.Serialize(writer, mixedPropertiesAndAdditionalPropertiesClass.Map, jsonSerializerOptions); writer.WriteString("uuid", mixedPropertiesAndAdditionalPropertiesClass.Uuid); + writer.WriteString("uuid_with_pattern", mixedPropertiesAndAdditionalPropertiesClass.UuidWithPattern); writer.WriteEndObject(); } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/FakeApi.md index 3f38af8889e..b46f71aeb7e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/FakeApi.md @@ -389,7 +389,7 @@ No authorization required # **FakeOuterStringSerialize** -> string FakeOuterStringSerialize (string body = null) +> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null) @@ -416,11 +416,12 @@ namespace Example HttpClient httpClient = new HttpClient(); HttpClientHandler httpClientHandler = new HttpClientHandler(); var apiInstance = new FakeApi(httpClient, config, httpClientHandler); + var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String var body = "body_example"; // string | Input string as post body (optional) try { - string result = apiInstance.FakeOuterStringSerialize(body); + string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body); Debug.WriteLine(result); } catch (ApiException e) @@ -440,7 +441,7 @@ This returns an ApiResponse object which contains the response data, status code ```csharp try { - ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body); + ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); Debug.Write("Response Body: " + response.Data); @@ -457,6 +458,7 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| +| **requiredStringUuid** | **Guid** | Required UUID String | | | **body** | **string** | Input string as post body | [optional] | ### Return type diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 5f57db957d7..050210a3e37 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**UuidWithPattern** | **Guid** | | [optional] **Uuid** | **Guid** | | [optional] **DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/FakeApi.cs index 542c9dadd54..575bee123ae 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -113,9 +113,10 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// string - string FakeOuterStringSerialize(string body = default(string)); + string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string)); /// /// @@ -124,9 +125,10 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// ApiResponse of string - ApiResponse FakeOuterStringSerializeWithHttpInfo(string body = default(string)); + ApiResponse FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string)); /// /// Array of Enums /// @@ -491,10 +493,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task FakeOuterStringSerializeAsync(string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -503,10 +506,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Array of Enums /// @@ -1442,11 +1446,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// string - public string FakeOuterStringSerialize(string body = default(string)) + public string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); return localVarResponse.Data; } @@ -1454,9 +1459,10 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// ApiResponse of string - public Org.OpenAPITools.Client.ApiResponse FakeOuterStringSerializeWithHttpInfo(string body = default(string)) + public Org.OpenAPITools.Client.ApiResponse FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1475,6 +1481,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid)); localVarRequestOptions.Data = body; @@ -1494,12 +1501,13 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync(string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(body, cancellationToken).ConfigureAwait(false); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } @@ -1507,10 +1515,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1531,6 +1540,7 @@ namespace Org.OpenAPITools.Api var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid)); localVarRequestOptions.Data = body; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 22690e54091..ab33594b0e2 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -36,17 +36,25 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// + /// uuidWithPattern. /// uuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuidWithPattern = default(Guid), Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) { + this.UuidWithPattern = uuidWithPattern; this.Uuid = uuid; this.DateTime = dateTime; this.Map = map; this.AdditionalProperties = new Dictionary(); } + /// + /// Gets or Sets UuidWithPattern + /// + [DataMember(Name = "uuid_with_pattern", EmitDefaultValue = false)] + public Guid UuidWithPattern { get; set; } + /// /// Gets or Sets Uuid /// @@ -79,6 +87,7 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Map: ").Append(Map).Append("\n"); @@ -125,6 +134,10 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.UuidWithPattern != null) + { + hashCode = (hashCode * 59) + this.UuidWithPattern.GetHashCode(); + } if (this.Uuid != null) { hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); @@ -152,6 +165,13 @@ namespace Org.OpenAPITools.Model /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // UuidWithPattern (Guid) pattern + Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); + } + yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/FakeApi.md index 212d1d35c49..4b5bf803c4e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/FakeApi.md @@ -373,7 +373,7 @@ No authorization required # **FakeOuterStringSerialize** -> string FakeOuterStringSerialize (string body = null) +> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null) @@ -396,11 +396,12 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); + var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String var body = "body_example"; // string | Input string as post body (optional) try { - string result = apiInstance.FakeOuterStringSerialize(body); + string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body); Debug.WriteLine(result); } catch (ApiException e) @@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code ```csharp try { - ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body); + ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); Debug.Write("Response Body: " + response.Data); @@ -437,6 +438,7 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| +| **requiredStringUuid** | **Guid** | Required UUID String | | | **body** | **string** | Input string as post body | [optional] | ### Return type diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 5f57db957d7..050210a3e37 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**UuidWithPattern** | **Guid** | | [optional] **Uuid** | **Guid** | | [optional] **DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeApi.cs index 5991b7f0b78..ca68e330338 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Api/FakeApi.cs @@ -121,10 +121,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// string - string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0); + string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0); /// /// @@ -133,10 +134,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// ApiResponse of string - ApiResponse FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0); + ApiResponse FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0); /// /// Array of Enums /// @@ -529,11 +531,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -542,11 +545,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Array of Enums /// @@ -1509,12 +1513,13 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// string - public string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0) + public string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); return localVarResponse.Data; } @@ -1522,10 +1527,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// ApiResponse of string - public Org.OpenAPITools.Client.ApiResponse FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0) + public Org.OpenAPITools.Client.ApiResponse FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1550,6 +1556,7 @@ namespace Org.OpenAPITools.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid)); localVarRequestOptions.Data = body; localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize"; @@ -1574,13 +1581,14 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(body, operationIndex, cancellationToken).ConfigureAwait(false); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } @@ -1588,11 +1596,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1618,6 +1627,7 @@ namespace Org.OpenAPITools.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid)); localVarRequestOptions.Data = body; localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize"; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 3225727af37..2a0e96d6bc0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -35,17 +35,25 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// + /// uuidWithPattern. /// uuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuidWithPattern = default(Guid), Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) { + this.UuidWithPattern = uuidWithPattern; this.Uuid = uuid; this.DateTime = dateTime; this.Map = map; this.AdditionalProperties = new Dictionary(); } + /// + /// Gets or Sets UuidWithPattern + /// + [DataMember(Name = "uuid_with_pattern", EmitDefaultValue = false)] + public Guid UuidWithPattern { get; set; } + /// /// Gets or Sets Uuid /// @@ -78,6 +86,7 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Map: ").Append(Map).Append("\n"); @@ -124,6 +133,10 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.UuidWithPattern != null) + { + hashCode = (hashCode * 59) + this.UuidWithPattern.GetHashCode(); + } if (this.Uuid != null) { hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); @@ -151,6 +164,13 @@ namespace Org.OpenAPITools.Model /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // UuidWithPattern (Guid) pattern + Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); + } + yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/FakeApi.md index 212d1d35c49..4b5bf803c4e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/FakeApi.md @@ -373,7 +373,7 @@ No authorization required # **FakeOuterStringSerialize** -> string FakeOuterStringSerialize (string body = null) +> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null) @@ -396,11 +396,12 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); + var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String var body = "body_example"; // string | Input string as post body (optional) try { - string result = apiInstance.FakeOuterStringSerialize(body); + string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body); Debug.WriteLine(result); } catch (ApiException e) @@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code ```csharp try { - ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body); + ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); Debug.Write("Response Body: " + response.Data); @@ -437,6 +438,7 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| +| **requiredStringUuid** | **Guid** | Required UUID String | | | **body** | **string** | Input string as post body | [optional] | ### Return type diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 5f57db957d7..050210a3e37 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**UuidWithPattern** | **Guid** | | [optional] **Uuid** | **Guid** | | [optional] **DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Api/FakeApi.cs index 5991b7f0b78..ca68e330338 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Api/FakeApi.cs @@ -121,10 +121,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// string - string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0); + string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0); /// /// @@ -133,10 +134,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// ApiResponse of string - ApiResponse FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0); + ApiResponse FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0); /// /// Array of Enums /// @@ -529,11 +531,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -542,11 +545,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Array of Enums /// @@ -1509,12 +1513,13 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// string - public string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0) + public string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); return localVarResponse.Data; } @@ -1522,10 +1527,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// ApiResponse of string - public Org.OpenAPITools.Client.ApiResponse FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0) + public Org.OpenAPITools.Client.ApiResponse FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1550,6 +1556,7 @@ namespace Org.OpenAPITools.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid)); localVarRequestOptions.Data = body; localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize"; @@ -1574,13 +1581,14 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(body, operationIndex, cancellationToken).ConfigureAwait(false); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } @@ -1588,11 +1596,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1618,6 +1627,7 @@ namespace Org.OpenAPITools.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid)); localVarRequestOptions.Data = body; localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize"; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 3225727af37..2a0e96d6bc0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net48/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -35,17 +35,25 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// + /// uuidWithPattern. /// uuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuidWithPattern = default(Guid), Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) { + this.UuidWithPattern = uuidWithPattern; this.Uuid = uuid; this.DateTime = dateTime; this.Map = map; this.AdditionalProperties = new Dictionary(); } + /// + /// Gets or Sets UuidWithPattern + /// + [DataMember(Name = "uuid_with_pattern", EmitDefaultValue = false)] + public Guid UuidWithPattern { get; set; } + /// /// Gets or Sets Uuid /// @@ -78,6 +86,7 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Map: ").Append(Map).Append("\n"); @@ -124,6 +133,10 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.UuidWithPattern != null) + { + hashCode = (hashCode * 59) + this.UuidWithPattern.GetHashCode(); + } if (this.Uuid != null) { hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); @@ -151,6 +164,13 @@ namespace Org.OpenAPITools.Model /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // UuidWithPattern (Guid) pattern + Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); + } + yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/FakeApi.md index 2651845104a..17aae1affb8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/FakeApi.md @@ -373,7 +373,7 @@ No authorization required # **FakeOuterStringSerialize** -> string FakeOuterStringSerialize (string? body = null) +> string FakeOuterStringSerialize (Guid requiredStringUuid, string? body = null) @@ -396,11 +396,12 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); + var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String var body = "body_example"; // string? | Input string as post body (optional) try { - string result = apiInstance.FakeOuterStringSerialize(body); + string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body); Debug.WriteLine(result); } catch (ApiException e) @@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code ```csharp try { - ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body); + ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); Debug.Write("Response Body: " + response.Data); @@ -437,6 +438,7 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| +| **requiredStringUuid** | **Guid** | Required UUID String | | | **body** | **string?** | Input string as post body | [optional] | ### Return type diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 5f57db957d7..050210a3e37 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**UuidWithPattern** | **Guid** | | [optional] **Uuid** | **Guid** | | [optional] **DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeApi.cs index e0829629cc2..16240126ca9 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Api/FakeApi.cs @@ -121,10 +121,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// string - string FakeOuterStringSerialize(string? body = default(string?), int operationIndex = 0); + string FakeOuterStringSerialize(Guid requiredStringUuid, string? body = default(string?), int operationIndex = 0); /// /// @@ -133,10 +134,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// ApiResponse of string - ApiResponse FakeOuterStringSerializeWithHttpInfo(string? body = default(string?), int operationIndex = 0); + ApiResponse FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string? body = default(string?), int operationIndex = 0); /// /// Array of Enums /// @@ -529,11 +531,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task FakeOuterStringSerializeAsync(string? body = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string? body = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -542,11 +545,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(string? body = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string? body = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Array of Enums /// @@ -1509,12 +1513,13 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// string - public string FakeOuterStringSerialize(string? body = default(string?), int operationIndex = 0) + public string FakeOuterStringSerialize(Guid requiredStringUuid, string? body = default(string?), int operationIndex = 0) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); return localVarResponse.Data; } @@ -1522,10 +1527,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// ApiResponse of string - public Org.OpenAPITools.Client.ApiResponse FakeOuterStringSerializeWithHttpInfo(string? body = default(string?), int operationIndex = 0) + public Org.OpenAPITools.Client.ApiResponse FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string? body = default(string?), int operationIndex = 0) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1550,6 +1556,7 @@ namespace Org.OpenAPITools.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid)); localVarRequestOptions.Data = body; localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize"; @@ -1574,13 +1581,14 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync(string? body = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string? body = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(body, operationIndex, cancellationToken).ConfigureAwait(false); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } @@ -1588,11 +1596,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(string? body = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string? body = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1618,6 +1627,7 @@ namespace Org.OpenAPITools.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid)); localVarRequestOptions.Data = body; localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize"; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 3225727af37..2a0e96d6bc0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -35,17 +35,25 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// + /// uuidWithPattern. /// uuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuidWithPattern = default(Guid), Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) { + this.UuidWithPattern = uuidWithPattern; this.Uuid = uuid; this.DateTime = dateTime; this.Map = map; this.AdditionalProperties = new Dictionary(); } + /// + /// Gets or Sets UuidWithPattern + /// + [DataMember(Name = "uuid_with_pattern", EmitDefaultValue = false)] + public Guid UuidWithPattern { get; set; } + /// /// Gets or Sets Uuid /// @@ -78,6 +86,7 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Map: ").Append(Map).Append("\n"); @@ -124,6 +133,10 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.UuidWithPattern != null) + { + hashCode = (hashCode * 59) + this.UuidWithPattern.GetHashCode(); + } if (this.Uuid != null) { hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); @@ -151,6 +164,13 @@ namespace Org.OpenAPITools.Model /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // UuidWithPattern (Guid) pattern + Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); + } + yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md index 212d1d35c49..4b5bf803c4e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/FakeApi.md @@ -373,7 +373,7 @@ No authorization required # **FakeOuterStringSerialize** -> string FakeOuterStringSerialize (string body = null) +> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null) @@ -396,11 +396,12 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); + var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String var body = "body_example"; // string | Input string as post body (optional) try { - string result = apiInstance.FakeOuterStringSerialize(body); + string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body); Debug.WriteLine(result); } catch (ApiException e) @@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code ```csharp try { - ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body); + ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); Debug.Write("Response Body: " + response.Data); @@ -437,6 +438,7 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| +| **requiredStringUuid** | **Guid** | Required UUID String | | | **body** | **string** | Input string as post body | [optional] | ### Return type diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 5f57db957d7..050210a3e37 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**UuidWithPattern** | **Guid** | | [optional] **Uuid** | **Guid** | | [optional] **DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs index 5991b7f0b78..ca68e330338 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Api/FakeApi.cs @@ -121,10 +121,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// string - string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0); + string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0); /// /// @@ -133,10 +134,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// ApiResponse of string - ApiResponse FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0); + ApiResponse FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0); /// /// Array of Enums /// @@ -529,11 +531,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -542,11 +545,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Array of Enums /// @@ -1509,12 +1513,13 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// string - public string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0) + public string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); return localVarResponse.Data; } @@ -1522,10 +1527,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// ApiResponse of string - public Org.OpenAPITools.Client.ApiResponse FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0) + public Org.OpenAPITools.Client.ApiResponse FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1550,6 +1556,7 @@ namespace Org.OpenAPITools.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid)); localVarRequestOptions.Data = body; localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize"; @@ -1574,13 +1581,14 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(body, operationIndex, cancellationToken).ConfigureAwait(false); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } @@ -1588,11 +1596,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1618,6 +1627,7 @@ namespace Org.OpenAPITools.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid)); localVarRequestOptions.Data = body; localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize"; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 3225727af37..2a0e96d6bc0 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -35,17 +35,25 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// + /// uuidWithPattern. /// uuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuidWithPattern = default(Guid), Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) { + this.UuidWithPattern = uuidWithPattern; this.Uuid = uuid; this.DateTime = dateTime; this.Map = map; this.AdditionalProperties = new Dictionary(); } + /// + /// Gets or Sets UuidWithPattern + /// + [DataMember(Name = "uuid_with_pattern", EmitDefaultValue = false)] + public Guid UuidWithPattern { get; set; } + /// /// Gets or Sets Uuid /// @@ -78,6 +86,7 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Map: ").Append(Map).Append("\n"); @@ -124,6 +133,10 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.UuidWithPattern != null) + { + hashCode = (hashCode * 59) + this.UuidWithPattern.GetHashCode(); + } if (this.Uuid != null) { hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); @@ -151,6 +164,13 @@ namespace Org.OpenAPITools.Model /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // UuidWithPattern (Guid) pattern + Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); + } + yield break; } } diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md index 212d1d35c49..4b5bf803c4e 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/FakeApi.md @@ -373,7 +373,7 @@ No authorization required # **FakeOuterStringSerialize** -> string FakeOuterStringSerialize (string body = null) +> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null) @@ -396,11 +396,12 @@ namespace Example Configuration config = new Configuration(); config.BasePath = "http://petstore.swagger.io:80/v2"; var apiInstance = new FakeApi(config); + var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String var body = "body_example"; // string | Input string as post body (optional) try { - string result = apiInstance.FakeOuterStringSerialize(body); + string result = apiInstance.FakeOuterStringSerialize(requiredStringUuid, body); Debug.WriteLine(result); } catch (ApiException e) @@ -420,7 +421,7 @@ This returns an ApiResponse object which contains the response data, status code ```csharp try { - ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(body); + ApiResponse response = apiInstance.FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); Debug.Write("Status Code: " + response.StatusCode); Debug.Write("Response Headers: " + response.Headers); Debug.Write("Response Body: " + response.Data); @@ -437,6 +438,7 @@ catch (ApiException e) | Name | Type | Description | Notes | |------|------|-------------|-------| +| **requiredStringUuid** | **Guid** | Required UUID String | | | **body** | **string** | Input string as post body | [optional] | ### Return type diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 5f57db957d7..050210a3e37 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**UuidWithPattern** | **Guid** | | [optional] **Uuid** | **Guid** | | [optional] **DateTime** | **DateTime** | | [optional] **Map** | [**Dictionary<string, Animal>**](Animal.md) | | [optional] diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs index 5991b7f0b78..ca68e330338 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -121,10 +121,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// string - string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0); + string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0); /// /// @@ -133,10 +134,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// ApiResponse of string - ApiResponse FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0); + ApiResponse FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0); /// /// Array of Enums /// @@ -529,11 +531,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of string - System.Threading.Tasks.Task FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// @@ -542,11 +545,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Array of Enums /// @@ -1509,12 +1513,13 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// string - public string FakeOuterStringSerialize(string body = default(string), int operationIndex = 0) + public string FakeOuterStringSerialize(Guid requiredStringUuid, string body = default(string), int operationIndex = 0) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + Org.OpenAPITools.Client.ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(requiredStringUuid, body); return localVarResponse.Data; } @@ -1522,10 +1527,11 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// ApiResponse of string - public Org.OpenAPITools.Client.ApiResponse FakeOuterStringSerializeWithHttpInfo(string body = default(string), int operationIndex = 0) + public Org.OpenAPITools.Client.ApiResponse FakeOuterStringSerializeWithHttpInfo(Guid requiredStringUuid, string body = default(string), int operationIndex = 0) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1550,6 +1556,7 @@ namespace Org.OpenAPITools.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid)); localVarRequestOptions.Data = body; localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize"; @@ -1574,13 +1581,14 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of string - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(body, operationIndex, cancellationToken).ConfigureAwait(false); + Org.OpenAPITools.Client.ApiResponse localVarResponse = await FakeOuterStringSerializeWithHttpInfoAsync(requiredStringUuid, body, operationIndex, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } @@ -1588,11 +1596,12 @@ namespace Org.OpenAPITools.Api /// Test serialization of outer string types /// /// Thrown when fails to make API call + /// Required UUID String /// Input string as post body (optional) /// Index associated with the operation. /// Cancellation Token to cancel the request. /// Task of ApiResponse (string) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeWithHttpInfoAsync(Guid requiredStringUuid, string body = default(string), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions(); @@ -1618,6 +1627,7 @@ namespace Org.OpenAPITools.Api localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } + localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_uuid", requiredStringUuid)); localVarRequestOptions.Data = body; localVarRequestOptions.Operation = "FakeApi.FakeOuterStringSerialize"; diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs index 44fc73ca3a9..9fd3973afb8 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/src/Org.OpenAPITools/Model/MixedPropertiesAndAdditionalPropertiesClass.cs @@ -35,16 +35,24 @@ namespace Org.OpenAPITools.Model /// /// Initializes a new instance of the class. /// + /// uuidWithPattern. /// uuid. /// dateTime. /// map. - public MixedPropertiesAndAdditionalPropertiesClass(Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) + public MixedPropertiesAndAdditionalPropertiesClass(Guid uuidWithPattern = default(Guid), Guid uuid = default(Guid), DateTime dateTime = default(DateTime), Dictionary map = default(Dictionary)) { + this.UuidWithPattern = uuidWithPattern; this.Uuid = uuid; this.DateTime = dateTime; this.Map = map; } + /// + /// Gets or Sets UuidWithPattern + /// + [DataMember(Name = "uuid_with_pattern", EmitDefaultValue = false)] + public Guid UuidWithPattern { get; set; } + /// /// Gets or Sets Uuid /// @@ -71,6 +79,7 @@ namespace Org.OpenAPITools.Model { StringBuilder sb = new StringBuilder(); sb.Append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.Append(" UuidWithPattern: ").Append(UuidWithPattern).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Map: ").Append(Map).Append("\n"); @@ -116,6 +125,10 @@ namespace Org.OpenAPITools.Model unchecked // Overflow is fine, just wrap { int hashCode = 41; + if (this.UuidWithPattern != null) + { + hashCode = (hashCode * 59) + this.UuidWithPattern.GetHashCode(); + } if (this.Uuid != null) { hashCode = (hashCode * 59) + this.Uuid.GetHashCode(); @@ -139,6 +152,13 @@ namespace Org.OpenAPITools.Model /// Validation Result public IEnumerable Validate(ValidationContext validationContext) { + // UuidWithPattern (Guid) pattern + Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant); + if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" }); + } + yield break; } }