From 34c6c583cc35d19f0f1cef816af709a7f634ad25 Mon Sep 17 00:00:00 2001 From: devhl-labs Date: Sun, 23 Mar 2025 10:44:12 -0400 Subject: [PATCH] [csharp][generichost] Fixed string formatted as decimal (#20894) * fixed string formatted as decimal * build tests --- .../generichost/JsonConverter.mustache | 10 +++ ...odels-for-testing-with-http-signature.yaml | 7 +++ .../net4.7/FormModels/api/openapi.yaml | 7 +++ .../FormModels/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 ++++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 51 ++++++++++++++- .../net4.7/Petstore/api/openapi.yaml | 7 +++ .../net4.7/Petstore/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 ++++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 51 ++++++++++++++- .../net4.8/FormModels/api/openapi.yaml | 7 +++ .../FormModels/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 ++++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 51 ++++++++++++++- .../net4.8/Petstore/api/openapi.yaml | 7 +++ .../net4.8/Petstore/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 ++++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 51 ++++++++++++++- .../net8/FormModels/api/openapi.yaml | 7 +++ .../net8/FormModels/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 ++++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 51 ++++++++++++++- .../net8/NullReferenceTypes/api/openapi.yaml | 7 +++ .../docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 ++++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 51 ++++++++++++++- .../net8/Petstore/api/openapi.yaml | 7 +++ .../net8/Petstore/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 ++++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 51 ++++++++++++++- .../net8/SourceGeneration/api/openapi.yaml | 7 +++ .../docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 ++++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 51 ++++++++++++++- .../net9/FormModels/api/openapi.yaml | 7 +++ .../net9/FormModels/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 ++++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 51 ++++++++++++++- .../net9/NullReferenceTypes/api/openapi.yaml | 7 +++ .../docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 ++++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 51 ++++++++++++++- .../net9/Petstore/api/openapi.yaml | 7 +++ .../net9/Petstore/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 ++++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 51 ++++++++++++++- .../net9/SourceGeneration/api/openapi.yaml | 7 +++ .../docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 ++++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 51 ++++++++++++++- .../standard2.0/Petstore/api/openapi.yaml | 7 +++ .../Petstore/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 ++++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 51 ++++++++++++++- .../httpclient/net9/Petstore/api/openapi.yaml | 7 +++ .../net9/Petstore/docs/FormatTest.md | 2 + .../src/Org.OpenAPITools/Model/FormatTest.cs | 22 ++++++- .../standard2.0/Petstore/api/openapi.yaml | 7 +++ .../standard2.0/Petstore/docs/FormatTest.md | 2 + .../src/Org.OpenAPITools/Model/FormatTest.cs | 22 ++++++- .../restsharp/net8/Petstore/api/openapi.yaml | 7 +++ .../net8/Petstore/docs/FormatTest.md | 2 + .../src/Org.OpenAPITools/Model/FormatTest.cs | 22 ++++++- .../ConditionalSerialization/api/openapi.yaml | 7 +++ .../docs/FormatTest.md | 2 + .../src/Org.OpenAPITools/Model/FormatTest.cs | 62 ++++++++++++++++++- .../net9/Petstore/api/openapi.yaml | 7 +++ .../net9/Petstore/docs/FormatTest.md | 2 + .../src/Org.OpenAPITools/Model/FormatTest.cs | 30 ++++++++- .../standard2.0/Petstore/api/openapi.yaml | 7 +++ .../standard2.0/Petstore/docs/FormatTest.md | 2 + .../src/Org.OpenAPITools/Model/FormatTest.cs | 30 ++++++++- 72 files changed, 1241 insertions(+), 32 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache index 2328f9ce1f2..fedb2f5a170 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache @@ -179,7 +179,12 @@ {{^isMap}} {{^isEnum}} {{^isUuid}} + {{#isDecimal}} + {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDecimal()); + {{/isDecimal}} + {{^isDecimal}} {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetString(){{^isNullable}}{{nrt!}}{{/isNullable}}); + {{/isDecimal}} {{/isUuid}} {{/isEnum}} {{/isMap}} @@ -439,7 +444,12 @@ {{^isEnum}} {{^isUuid}} {{#lambda.copyText}} + {{#isDecimal}} + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}.ToString()); + {{/isDecimal}} + {{^isDecimal}} writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}); + {{/isDecimal}} {{/lambda.copyText}} {{#lambda.indent3}} {{>WriteProperty}} 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 0133dffade3..8837f52ee83 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 @@ -1673,6 +1673,7 @@ components: - byte - date - password + - string_formatted_as_decimal_required properties: integer: type: integer @@ -1771,6 +1772,12 @@ components: description: None type: string pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$' + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string EnumClass: type: string default: '-efg' diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.7/FormModels/api/openapi.yaml index b48dbb1f448..7bfc0de5a41 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/api/openapi.yaml @@ -1665,11 +1665,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/FormatTest.md index 5983bc09690..950546c1812 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/docs/models/FormatTest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Date** | **DateTime** | | **Number** | **decimal** | | **Password** | **string** | | +**StringFormattedAsDecimalRequired** | **decimal** | | **Binary** | **System.IO.Stream** | | [optional] **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] @@ -25,6 +26,7 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **String** | **string** | | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] **UnsignedInteger** | **uint** | | [optional] **UnsignedLong** | **ulong** | | [optional] **Uuid** | **Guid** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index 7dad1b08bc0..fe89f7090c4 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -89,6 +89,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Password' } + /// + /// Test the property 'StringFormattedAsDecimalRequired' + /// + [Fact] + public void StringFormattedAsDecimalRequiredTest() + { + // TODO unit test for the property 'StringFormattedAsDecimalRequired' + } + /// /// Test the property 'Binary' /// @@ -242,6 +251,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'String' } + /// + /// Test the property 'StringFormattedAsDecimal' + /// + [Fact] + public void StringFormattedAsDecimalTest() + { + // TODO unit test for the property 'StringFormattedAsDecimal' + } + /// /// Test the property 'UnsignedInteger' /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs index a4410d55b34..1887346c88b 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs @@ -36,6 +36,7 @@ namespace Org.OpenAPITools.Model /// date /// number /// password + /// stringFormattedAsDecimalRequired /// binary /// dateTime /// decimal @@ -53,16 +54,18 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// string + /// stringFormattedAsDecimal /// unsignedInteger /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateTime date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateTime date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; Number = number; Password = password; + StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; BinaryOption = binary; DateTimeOption = dateTime; DecimalOption = @decimal; @@ -80,6 +83,7 @@ namespace Org.OpenAPITools.Model PatternWithDigitsOption = patternWithDigits; PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; StringOption = @string; + StringFormattedAsDecimalOption = stringFormattedAsDecimal; UnsignedIntegerOption = unsignedInteger; UnsignedLongOption = unsignedLong; UuidOption = uuid; @@ -113,6 +117,12 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("password")] public string Password { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [JsonPropertyName("string_formatted_as_decimal_required")] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Used to track the state of Binary /// @@ -338,6 +348,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("string")] public string String { get { return this.StringOption; } set { this.StringOption = new Option(value); } } + /// + /// Used to track the state of StringFormattedAsDecimal + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StringFormattedAsDecimalOption { get; private set; } + + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [JsonPropertyName("string_formatted_as_decimal")] + public decimal? StringFormattedAsDecimal { get { return this.StringFormattedAsDecimalOption; } set { this.StringFormattedAsDecimalOption = new Option(value); } } + /// /// Used to track the state of UnsignedInteger /// @@ -396,6 +419,7 @@ namespace Org.OpenAPITools.Model sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); @@ -413,6 +437,7 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); @@ -628,6 +653,7 @@ namespace Org.OpenAPITools.Model Option date = default; Option number = default; Option password = default; + Option stringFormattedAsDecimalRequired = default; Option binary = default; Option dateTime = default; Option varDecimal = default; @@ -645,6 +671,7 @@ namespace Org.OpenAPITools.Model Option patternWithDigits = default; Option patternWithDigitsAndDelimiter = default; Option varString = default; + Option stringFormattedAsDecimal = default; Option unsignedInteger = default; Option unsignedLong = default; Option uuid = default; @@ -676,6 +703,9 @@ namespace Org.OpenAPITools.Model case "password": password = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal_required": + stringFormattedAsDecimalRequired = new Option(utf8JsonReader.GetDecimal()); + break; case "binary": binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; @@ -727,6 +757,9 @@ namespace Org.OpenAPITools.Model case "string": varString = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal": + stringFormattedAsDecimal = new Option(utf8JsonReader.GetDecimal()); + break; case "unsigned_integer": unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; @@ -754,6 +787,9 @@ namespace Org.OpenAPITools.Model if (!password.IsSet) throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + if (!stringFormattedAsDecimalRequired.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(stringFormattedAsDecimalRequired)); + if (varByte.IsSet && varByte.Value == null) throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); @@ -766,6 +802,9 @@ namespace Org.OpenAPITools.Model if (password.IsSet && password.Value == null) throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimalRequired.IsSet && stringFormattedAsDecimalRequired.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimalRequired), "Property is not nullable for class FormatTest."); + if (binary.IsSet && binary.Value == null) throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); @@ -817,6 +856,9 @@ namespace Org.OpenAPITools.Model if (varString.IsSet && varString.Value == null) throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimal.IsSet && stringFormattedAsDecimal.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimal), "Property is not nullable for class FormatTest."); + if (unsignedInteger.IsSet && unsignedInteger.Value == null) throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); @@ -826,7 +868,7 @@ namespace Org.OpenAPITools.Model if (uuid.IsSet && uuid.Value == null) throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); - return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -882,6 +924,8 @@ namespace Org.OpenAPITools.Model writer.WriteString("password", formatTest.Password); + writer.WriteString("string_formatted_as_decimal_required", formatTest.StringFormattedAsDecimalRequired.ToString()); + if (formatTest.BinaryOption.IsSet) { writer.WritePropertyName("binary"); @@ -937,6 +981,9 @@ namespace Org.OpenAPITools.Model if (formatTest.StringOption.IsSet) writer.WriteString("string", formatTest.String); + if (formatTest.StringFormattedAsDecimalOption.IsSet) + writer.WriteString("string_formatted_as_decimal", formatTest.StringFormattedAsDecimal.ToString()); + if (formatTest.UnsignedIntegerOption.IsSet) writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.7/Petstore/api/openapi.yaml index dfcb36db638..4f007819a1a 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/api/openapi.yaml @@ -1706,11 +1706,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/FormatTest.md index 5983bc09690..950546c1812 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/docs/models/FormatTest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Date** | **DateTime** | | **Number** | **decimal** | | **Password** | **string** | | +**StringFormattedAsDecimalRequired** | **decimal** | | **Binary** | **System.IO.Stream** | | [optional] **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] @@ -25,6 +26,7 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **String** | **string** | | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] **UnsignedInteger** | **uint** | | [optional] **UnsignedLong** | **ulong** | | [optional] **Uuid** | **Guid** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index 7dad1b08bc0..fe89f7090c4 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -89,6 +89,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Password' } + /// + /// Test the property 'StringFormattedAsDecimalRequired' + /// + [Fact] + public void StringFormattedAsDecimalRequiredTest() + { + // TODO unit test for the property 'StringFormattedAsDecimalRequired' + } + /// /// Test the property 'Binary' /// @@ -242,6 +251,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'String' } + /// + /// Test the property 'StringFormattedAsDecimal' + /// + [Fact] + public void StringFormattedAsDecimalTest() + { + // TODO unit test for the property 'StringFormattedAsDecimal' + } + /// /// Test the property 'UnsignedInteger' /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index a4410d55b34..1887346c88b 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -36,6 +36,7 @@ namespace Org.OpenAPITools.Model /// date /// number /// password + /// stringFormattedAsDecimalRequired /// binary /// dateTime /// decimal @@ -53,16 +54,18 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// string + /// stringFormattedAsDecimal /// unsignedInteger /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateTime date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateTime date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; Number = number; Password = password; + StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; BinaryOption = binary; DateTimeOption = dateTime; DecimalOption = @decimal; @@ -80,6 +83,7 @@ namespace Org.OpenAPITools.Model PatternWithDigitsOption = patternWithDigits; PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; StringOption = @string; + StringFormattedAsDecimalOption = stringFormattedAsDecimal; UnsignedIntegerOption = unsignedInteger; UnsignedLongOption = unsignedLong; UuidOption = uuid; @@ -113,6 +117,12 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("password")] public string Password { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [JsonPropertyName("string_formatted_as_decimal_required")] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Used to track the state of Binary /// @@ -338,6 +348,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("string")] public string String { get { return this.StringOption; } set { this.StringOption = new Option(value); } } + /// + /// Used to track the state of StringFormattedAsDecimal + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StringFormattedAsDecimalOption { get; private set; } + + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [JsonPropertyName("string_formatted_as_decimal")] + public decimal? StringFormattedAsDecimal { get { return this.StringFormattedAsDecimalOption; } set { this.StringFormattedAsDecimalOption = new Option(value); } } + /// /// Used to track the state of UnsignedInteger /// @@ -396,6 +419,7 @@ namespace Org.OpenAPITools.Model sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); @@ -413,6 +437,7 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); @@ -628,6 +653,7 @@ namespace Org.OpenAPITools.Model Option date = default; Option number = default; Option password = default; + Option stringFormattedAsDecimalRequired = default; Option binary = default; Option dateTime = default; Option varDecimal = default; @@ -645,6 +671,7 @@ namespace Org.OpenAPITools.Model Option patternWithDigits = default; Option patternWithDigitsAndDelimiter = default; Option varString = default; + Option stringFormattedAsDecimal = default; Option unsignedInteger = default; Option unsignedLong = default; Option uuid = default; @@ -676,6 +703,9 @@ namespace Org.OpenAPITools.Model case "password": password = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal_required": + stringFormattedAsDecimalRequired = new Option(utf8JsonReader.GetDecimal()); + break; case "binary": binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; @@ -727,6 +757,9 @@ namespace Org.OpenAPITools.Model case "string": varString = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal": + stringFormattedAsDecimal = new Option(utf8JsonReader.GetDecimal()); + break; case "unsigned_integer": unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; @@ -754,6 +787,9 @@ namespace Org.OpenAPITools.Model if (!password.IsSet) throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + if (!stringFormattedAsDecimalRequired.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(stringFormattedAsDecimalRequired)); + if (varByte.IsSet && varByte.Value == null) throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); @@ -766,6 +802,9 @@ namespace Org.OpenAPITools.Model if (password.IsSet && password.Value == null) throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimalRequired.IsSet && stringFormattedAsDecimalRequired.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimalRequired), "Property is not nullable for class FormatTest."); + if (binary.IsSet && binary.Value == null) throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); @@ -817,6 +856,9 @@ namespace Org.OpenAPITools.Model if (varString.IsSet && varString.Value == null) throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimal.IsSet && stringFormattedAsDecimal.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimal), "Property is not nullable for class FormatTest."); + if (unsignedInteger.IsSet && unsignedInteger.Value == null) throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); @@ -826,7 +868,7 @@ namespace Org.OpenAPITools.Model if (uuid.IsSet && uuid.Value == null) throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); - return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -882,6 +924,8 @@ namespace Org.OpenAPITools.Model writer.WriteString("password", formatTest.Password); + writer.WriteString("string_formatted_as_decimal_required", formatTest.StringFormattedAsDecimalRequired.ToString()); + if (formatTest.BinaryOption.IsSet) { writer.WritePropertyName("binary"); @@ -937,6 +981,9 @@ namespace Org.OpenAPITools.Model if (formatTest.StringOption.IsSet) writer.WriteString("string", formatTest.String); + if (formatTest.StringFormattedAsDecimalOption.IsSet) + writer.WriteString("string_formatted_as_decimal", formatTest.StringFormattedAsDecimal.ToString()); + if (formatTest.UnsignedIntegerOption.IsSet) writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.8/FormModels/api/openapi.yaml index b48dbb1f448..7bfc0de5a41 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/api/openapi.yaml @@ -1665,11 +1665,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/FormatTest.md index 5983bc09690..950546c1812 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/docs/models/FormatTest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Date** | **DateTime** | | **Number** | **decimal** | | **Password** | **string** | | +**StringFormattedAsDecimalRequired** | **decimal** | | **Binary** | **System.IO.Stream** | | [optional] **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] @@ -25,6 +26,7 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **String** | **string** | | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] **UnsignedInteger** | **uint** | | [optional] **UnsignedLong** | **ulong** | | [optional] **Uuid** | **Guid** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index 7dad1b08bc0..fe89f7090c4 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -89,6 +89,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Password' } + /// + /// Test the property 'StringFormattedAsDecimalRequired' + /// + [Fact] + public void StringFormattedAsDecimalRequiredTest() + { + // TODO unit test for the property 'StringFormattedAsDecimalRequired' + } + /// /// Test the property 'Binary' /// @@ -242,6 +251,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'String' } + /// + /// Test the property 'StringFormattedAsDecimal' + /// + [Fact] + public void StringFormattedAsDecimalTest() + { + // TODO unit test for the property 'StringFormattedAsDecimal' + } + /// /// Test the property 'UnsignedInteger' /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs index a4410d55b34..1887346c88b 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs @@ -36,6 +36,7 @@ namespace Org.OpenAPITools.Model /// date /// number /// password + /// stringFormattedAsDecimalRequired /// binary /// dateTime /// decimal @@ -53,16 +54,18 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// string + /// stringFormattedAsDecimal /// unsignedInteger /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateTime date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateTime date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; Number = number; Password = password; + StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; BinaryOption = binary; DateTimeOption = dateTime; DecimalOption = @decimal; @@ -80,6 +83,7 @@ namespace Org.OpenAPITools.Model PatternWithDigitsOption = patternWithDigits; PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; StringOption = @string; + StringFormattedAsDecimalOption = stringFormattedAsDecimal; UnsignedIntegerOption = unsignedInteger; UnsignedLongOption = unsignedLong; UuidOption = uuid; @@ -113,6 +117,12 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("password")] public string Password { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [JsonPropertyName("string_formatted_as_decimal_required")] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Used to track the state of Binary /// @@ -338,6 +348,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("string")] public string String { get { return this.StringOption; } set { this.StringOption = new Option(value); } } + /// + /// Used to track the state of StringFormattedAsDecimal + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StringFormattedAsDecimalOption { get; private set; } + + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [JsonPropertyName("string_formatted_as_decimal")] + public decimal? StringFormattedAsDecimal { get { return this.StringFormattedAsDecimalOption; } set { this.StringFormattedAsDecimalOption = new Option(value); } } + /// /// Used to track the state of UnsignedInteger /// @@ -396,6 +419,7 @@ namespace Org.OpenAPITools.Model sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); @@ -413,6 +437,7 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); @@ -628,6 +653,7 @@ namespace Org.OpenAPITools.Model Option date = default; Option number = default; Option password = default; + Option stringFormattedAsDecimalRequired = default; Option binary = default; Option dateTime = default; Option varDecimal = default; @@ -645,6 +671,7 @@ namespace Org.OpenAPITools.Model Option patternWithDigits = default; Option patternWithDigitsAndDelimiter = default; Option varString = default; + Option stringFormattedAsDecimal = default; Option unsignedInteger = default; Option unsignedLong = default; Option uuid = default; @@ -676,6 +703,9 @@ namespace Org.OpenAPITools.Model case "password": password = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal_required": + stringFormattedAsDecimalRequired = new Option(utf8JsonReader.GetDecimal()); + break; case "binary": binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; @@ -727,6 +757,9 @@ namespace Org.OpenAPITools.Model case "string": varString = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal": + stringFormattedAsDecimal = new Option(utf8JsonReader.GetDecimal()); + break; case "unsigned_integer": unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; @@ -754,6 +787,9 @@ namespace Org.OpenAPITools.Model if (!password.IsSet) throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + if (!stringFormattedAsDecimalRequired.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(stringFormattedAsDecimalRequired)); + if (varByte.IsSet && varByte.Value == null) throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); @@ -766,6 +802,9 @@ namespace Org.OpenAPITools.Model if (password.IsSet && password.Value == null) throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimalRequired.IsSet && stringFormattedAsDecimalRequired.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimalRequired), "Property is not nullable for class FormatTest."); + if (binary.IsSet && binary.Value == null) throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); @@ -817,6 +856,9 @@ namespace Org.OpenAPITools.Model if (varString.IsSet && varString.Value == null) throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimal.IsSet && stringFormattedAsDecimal.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimal), "Property is not nullable for class FormatTest."); + if (unsignedInteger.IsSet && unsignedInteger.Value == null) throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); @@ -826,7 +868,7 @@ namespace Org.OpenAPITools.Model if (uuid.IsSet && uuid.Value == null) throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); - return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -882,6 +924,8 @@ namespace Org.OpenAPITools.Model writer.WriteString("password", formatTest.Password); + writer.WriteString("string_formatted_as_decimal_required", formatTest.StringFormattedAsDecimalRequired.ToString()); + if (formatTest.BinaryOption.IsSet) { writer.WritePropertyName("binary"); @@ -937,6 +981,9 @@ namespace Org.OpenAPITools.Model if (formatTest.StringOption.IsSet) writer.WriteString("string", formatTest.String); + if (formatTest.StringFormattedAsDecimalOption.IsSet) + writer.WriteString("string_formatted_as_decimal", formatTest.StringFormattedAsDecimal.ToString()); + if (formatTest.UnsignedIntegerOption.IsSet) writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.8/Petstore/api/openapi.yaml index dfcb36db638..4f007819a1a 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/api/openapi.yaml @@ -1706,11 +1706,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/FormatTest.md index 5983bc09690..950546c1812 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/docs/models/FormatTest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Date** | **DateTime** | | **Number** | **decimal** | | **Password** | **string** | | +**StringFormattedAsDecimalRequired** | **decimal** | | **Binary** | **System.IO.Stream** | | [optional] **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] @@ -25,6 +26,7 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **String** | **string** | | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] **UnsignedInteger** | **uint** | | [optional] **UnsignedLong** | **ulong** | | [optional] **Uuid** | **Guid** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index 7dad1b08bc0..fe89f7090c4 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -89,6 +89,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Password' } + /// + /// Test the property 'StringFormattedAsDecimalRequired' + /// + [Fact] + public void StringFormattedAsDecimalRequiredTest() + { + // TODO unit test for the property 'StringFormattedAsDecimalRequired' + } + /// /// Test the property 'Binary' /// @@ -242,6 +251,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'String' } + /// + /// Test the property 'StringFormattedAsDecimal' + /// + [Fact] + public void StringFormattedAsDecimalTest() + { + // TODO unit test for the property 'StringFormattedAsDecimal' + } + /// /// Test the property 'UnsignedInteger' /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index a4410d55b34..1887346c88b 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -36,6 +36,7 @@ namespace Org.OpenAPITools.Model /// date /// number /// password + /// stringFormattedAsDecimalRequired /// binary /// dateTime /// decimal @@ -53,16 +54,18 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// string + /// stringFormattedAsDecimal /// unsignedInteger /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateTime date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateTime date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; Number = number; Password = password; + StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; BinaryOption = binary; DateTimeOption = dateTime; DecimalOption = @decimal; @@ -80,6 +83,7 @@ namespace Org.OpenAPITools.Model PatternWithDigitsOption = patternWithDigits; PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; StringOption = @string; + StringFormattedAsDecimalOption = stringFormattedAsDecimal; UnsignedIntegerOption = unsignedInteger; UnsignedLongOption = unsignedLong; UuidOption = uuid; @@ -113,6 +117,12 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("password")] public string Password { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [JsonPropertyName("string_formatted_as_decimal_required")] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Used to track the state of Binary /// @@ -338,6 +348,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("string")] public string String { get { return this.StringOption; } set { this.StringOption = new Option(value); } } + /// + /// Used to track the state of StringFormattedAsDecimal + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StringFormattedAsDecimalOption { get; private set; } + + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [JsonPropertyName("string_formatted_as_decimal")] + public decimal? StringFormattedAsDecimal { get { return this.StringFormattedAsDecimalOption; } set { this.StringFormattedAsDecimalOption = new Option(value); } } + /// /// Used to track the state of UnsignedInteger /// @@ -396,6 +419,7 @@ namespace Org.OpenAPITools.Model sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); @@ -413,6 +437,7 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); @@ -628,6 +653,7 @@ namespace Org.OpenAPITools.Model Option date = default; Option number = default; Option password = default; + Option stringFormattedAsDecimalRequired = default; Option binary = default; Option dateTime = default; Option varDecimal = default; @@ -645,6 +671,7 @@ namespace Org.OpenAPITools.Model Option patternWithDigits = default; Option patternWithDigitsAndDelimiter = default; Option varString = default; + Option stringFormattedAsDecimal = default; Option unsignedInteger = default; Option unsignedLong = default; Option uuid = default; @@ -676,6 +703,9 @@ namespace Org.OpenAPITools.Model case "password": password = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal_required": + stringFormattedAsDecimalRequired = new Option(utf8JsonReader.GetDecimal()); + break; case "binary": binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; @@ -727,6 +757,9 @@ namespace Org.OpenAPITools.Model case "string": varString = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal": + stringFormattedAsDecimal = new Option(utf8JsonReader.GetDecimal()); + break; case "unsigned_integer": unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; @@ -754,6 +787,9 @@ namespace Org.OpenAPITools.Model if (!password.IsSet) throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + if (!stringFormattedAsDecimalRequired.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(stringFormattedAsDecimalRequired)); + if (varByte.IsSet && varByte.Value == null) throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); @@ -766,6 +802,9 @@ namespace Org.OpenAPITools.Model if (password.IsSet && password.Value == null) throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimalRequired.IsSet && stringFormattedAsDecimalRequired.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimalRequired), "Property is not nullable for class FormatTest."); + if (binary.IsSet && binary.Value == null) throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); @@ -817,6 +856,9 @@ namespace Org.OpenAPITools.Model if (varString.IsSet && varString.Value == null) throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimal.IsSet && stringFormattedAsDecimal.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimal), "Property is not nullable for class FormatTest."); + if (unsignedInteger.IsSet && unsignedInteger.Value == null) throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); @@ -826,7 +868,7 @@ namespace Org.OpenAPITools.Model if (uuid.IsSet && uuid.Value == null) throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); - return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -882,6 +924,8 @@ namespace Org.OpenAPITools.Model writer.WriteString("password", formatTest.Password); + writer.WriteString("string_formatted_as_decimal_required", formatTest.StringFormattedAsDecimalRequired.ToString()); + if (formatTest.BinaryOption.IsSet) { writer.WritePropertyName("binary"); @@ -937,6 +981,9 @@ namespace Org.OpenAPITools.Model if (formatTest.StringOption.IsSet) writer.WriteString("string", formatTest.String); + if (formatTest.StringFormattedAsDecimalOption.IsSet) + writer.WriteString("string_formatted_as_decimal", formatTest.StringFormattedAsDecimal.ToString()); + if (formatTest.UnsignedIntegerOption.IsSet) writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml index b48dbb1f448..7bfc0de5a41 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml @@ -1665,11 +1665,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/FormatTest.md index 1009f35198f..8380bbcb556 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/docs/models/FormatTest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Date** | **DateOnly** | | **Number** | **decimal** | | **Password** | **string** | | +**StringFormattedAsDecimalRequired** | **decimal** | | **Binary** | **System.IO.Stream** | | [optional] **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] @@ -25,6 +26,7 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **String** | **string** | | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] **UnsignedInteger** | **uint** | | [optional] **UnsignedLong** | **ulong** | | [optional] **Uuid** | **Guid** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index 7dad1b08bc0..fe89f7090c4 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -89,6 +89,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Password' } + /// + /// Test the property 'StringFormattedAsDecimalRequired' + /// + [Fact] + public void StringFormattedAsDecimalRequiredTest() + { + // TODO unit test for the property 'StringFormattedAsDecimalRequired' + } + /// /// Test the property 'Binary' /// @@ -242,6 +251,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'String' } + /// + /// Test the property 'StringFormattedAsDecimal' + /// + [Fact] + public void StringFormattedAsDecimalTest() + { + // TODO unit test for the property 'StringFormattedAsDecimal' + } + /// /// Test the property 'UnsignedInteger' /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs index 7c9c96b05c0..217cf10f2dd 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs @@ -36,6 +36,7 @@ namespace Org.OpenAPITools.Model /// date /// number /// password + /// stringFormattedAsDecimalRequired /// binary /// dateTime /// decimal @@ -53,16 +54,18 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// string + /// stringFormattedAsDecimal /// unsignedInteger /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; Number = number; Password = password; + StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; BinaryOption = binary; DateTimeOption = dateTime; DecimalOption = @decimal; @@ -80,6 +83,7 @@ namespace Org.OpenAPITools.Model PatternWithDigitsOption = patternWithDigits; PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; StringOption = @string; + StringFormattedAsDecimalOption = stringFormattedAsDecimal; UnsignedIntegerOption = unsignedInteger; UnsignedLongOption = unsignedLong; UuidOption = uuid; @@ -113,6 +117,12 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("password")] public string Password { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [JsonPropertyName("string_formatted_as_decimal_required")] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Used to track the state of Binary /// @@ -338,6 +348,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("string")] public string String { get { return this.StringOption; } set { this.StringOption = new(value); } } + /// + /// Used to track the state of StringFormattedAsDecimal + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StringFormattedAsDecimalOption { get; private set; } + + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [JsonPropertyName("string_formatted_as_decimal")] + public decimal? StringFormattedAsDecimal { get { return this.StringFormattedAsDecimalOption; } set { this.StringFormattedAsDecimalOption = new(value); } } + /// /// Used to track the state of UnsignedInteger /// @@ -396,6 +419,7 @@ namespace Org.OpenAPITools.Model sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); @@ -413,6 +437,7 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); @@ -628,6 +653,7 @@ namespace Org.OpenAPITools.Model Option date = default; Option number = default; Option password = default; + Option stringFormattedAsDecimalRequired = default; Option binary = default; Option dateTime = default; Option varDecimal = default; @@ -645,6 +671,7 @@ namespace Org.OpenAPITools.Model Option patternWithDigits = default; Option patternWithDigitsAndDelimiter = default; Option varString = default; + Option stringFormattedAsDecimal = default; Option unsignedInteger = default; Option unsignedLong = default; Option uuid = default; @@ -676,6 +703,9 @@ namespace Org.OpenAPITools.Model case "password": password = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal_required": + stringFormattedAsDecimalRequired = new Option(utf8JsonReader.GetDecimal()); + break; case "binary": binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; @@ -727,6 +757,9 @@ namespace Org.OpenAPITools.Model case "string": varString = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal": + stringFormattedAsDecimal = new Option(utf8JsonReader.GetDecimal()); + break; case "unsigned_integer": unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; @@ -754,6 +787,9 @@ namespace Org.OpenAPITools.Model if (!password.IsSet) throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + if (!stringFormattedAsDecimalRequired.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(stringFormattedAsDecimalRequired)); + if (varByte.IsSet && varByte.Value == null) throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); @@ -766,6 +802,9 @@ namespace Org.OpenAPITools.Model if (password.IsSet && password.Value == null) throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimalRequired.IsSet && stringFormattedAsDecimalRequired.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimalRequired), "Property is not nullable for class FormatTest."); + if (binary.IsSet && binary.Value == null) throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); @@ -817,6 +856,9 @@ namespace Org.OpenAPITools.Model if (varString.IsSet && varString.Value == null) throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimal.IsSet && stringFormattedAsDecimal.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimal), "Property is not nullable for class FormatTest."); + if (unsignedInteger.IsSet && unsignedInteger.Value == null) throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); @@ -826,7 +868,7 @@ namespace Org.OpenAPITools.Model if (uuid.IsSet && uuid.Value == null) throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); - return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -882,6 +924,8 @@ namespace Org.OpenAPITools.Model writer.WriteString("password", formatTest.Password); + writer.WriteString("string_formatted_as_decimal_required", formatTest.StringFormattedAsDecimalRequired.ToString()); + if (formatTest.BinaryOption.IsSet) { writer.WritePropertyName("binary"); @@ -937,6 +981,9 @@ namespace Org.OpenAPITools.Model if (formatTest.StringOption.IsSet) writer.WriteString("string", formatTest.String); + if (formatTest.StringFormattedAsDecimalOption.IsSet) + writer.WriteString("string_formatted_as_decimal", formatTest.StringFormattedAsDecimal.ToString()); + if (formatTest.UnsignedIntegerOption.IsSet) writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml index dfcb36db638..4f007819a1a 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml @@ -1706,11 +1706,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/FormatTest.md index 1009f35198f..8380bbcb556 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/docs/models/FormatTest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Date** | **DateOnly** | | **Number** | **decimal** | | **Password** | **string** | | +**StringFormattedAsDecimalRequired** | **decimal** | | **Binary** | **System.IO.Stream** | | [optional] **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] @@ -25,6 +26,7 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **String** | **string** | | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] **UnsignedInteger** | **uint** | | [optional] **UnsignedLong** | **ulong** | | [optional] **Uuid** | **Guid** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index 7dad1b08bc0..fe89f7090c4 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -89,6 +89,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Password' } + /// + /// Test the property 'StringFormattedAsDecimalRequired' + /// + [Fact] + public void StringFormattedAsDecimalRequiredTest() + { + // TODO unit test for the property 'StringFormattedAsDecimalRequired' + } + /// /// Test the property 'Binary' /// @@ -242,6 +251,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'String' } + /// + /// Test the property 'StringFormattedAsDecimal' + /// + [Fact] + public void StringFormattedAsDecimalTest() + { + // TODO unit test for the property 'StringFormattedAsDecimal' + } + /// /// Test the property 'UnsignedInteger' /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs index 5564d0d3843..a5dae71ad9d 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs @@ -38,6 +38,7 @@ namespace Org.OpenAPITools.Model /// date /// number /// password + /// stringFormattedAsDecimalRequired /// binary /// dateTime /// decimal @@ -55,16 +56,18 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// string + /// stringFormattedAsDecimal /// unsignedInteger /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; Number = number; Password = password; + StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; BinaryOption = binary; DateTimeOption = dateTime; DecimalOption = @decimal; @@ -82,6 +85,7 @@ namespace Org.OpenAPITools.Model PatternWithDigitsOption = patternWithDigits; PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; StringOption = @string; + StringFormattedAsDecimalOption = stringFormattedAsDecimal; UnsignedIntegerOption = unsignedInteger; UnsignedLongOption = unsignedLong; UuidOption = uuid; @@ -115,6 +119,12 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("password")] public string Password { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [JsonPropertyName("string_formatted_as_decimal_required")] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Used to track the state of Binary /// @@ -340,6 +350,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("string")] public string? String { get { return this.StringOption; } set { this.StringOption = new(value); } } + /// + /// Used to track the state of StringFormattedAsDecimal + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StringFormattedAsDecimalOption { get; private set; } + + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [JsonPropertyName("string_formatted_as_decimal")] + public decimal? StringFormattedAsDecimal { get { return this.StringFormattedAsDecimalOption; } set { this.StringFormattedAsDecimalOption = new(value); } } + /// /// Used to track the state of UnsignedInteger /// @@ -398,6 +421,7 @@ namespace Org.OpenAPITools.Model sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); @@ -415,6 +439,7 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); @@ -630,6 +655,7 @@ namespace Org.OpenAPITools.Model Option date = default; Option number = default; Option password = default; + Option stringFormattedAsDecimalRequired = default; Option binary = default; Option dateTime = default; Option varDecimal = default; @@ -647,6 +673,7 @@ namespace Org.OpenAPITools.Model Option patternWithDigits = default; Option patternWithDigitsAndDelimiter = default; Option varString = default; + Option stringFormattedAsDecimal = default; Option unsignedInteger = default; Option unsignedLong = default; Option uuid = default; @@ -678,6 +705,9 @@ namespace Org.OpenAPITools.Model case "password": password = new Option(utf8JsonReader.GetString()!); break; + case "string_formatted_as_decimal_required": + stringFormattedAsDecimalRequired = new Option(utf8JsonReader.GetDecimal()); + break; case "binary": binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; @@ -729,6 +759,9 @@ namespace Org.OpenAPITools.Model case "string": varString = new Option(utf8JsonReader.GetString()!); break; + case "string_formatted_as_decimal": + stringFormattedAsDecimal = new Option(utf8JsonReader.GetDecimal()); + break; case "unsigned_integer": unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; @@ -756,6 +789,9 @@ namespace Org.OpenAPITools.Model if (!password.IsSet) throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + if (!stringFormattedAsDecimalRequired.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(stringFormattedAsDecimalRequired)); + if (varByte.IsSet && varByte.Value == null) throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); @@ -768,6 +804,9 @@ namespace Org.OpenAPITools.Model if (password.IsSet && password.Value == null) throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimalRequired.IsSet && stringFormattedAsDecimalRequired.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimalRequired), "Property is not nullable for class FormatTest."); + if (binary.IsSet && binary.Value == null) throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); @@ -819,6 +858,9 @@ namespace Org.OpenAPITools.Model if (varString.IsSet && varString.Value == null) throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimal.IsSet && stringFormattedAsDecimal.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimal), "Property is not nullable for class FormatTest."); + if (unsignedInteger.IsSet && unsignedInteger.Value == null) throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); @@ -828,7 +870,7 @@ namespace Org.OpenAPITools.Model if (uuid.IsSet && uuid.Value == null) throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); - return new FormatTest(varByte.Value!, date.Value!.Value!, number.Value!.Value!, password.Value!, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value!, date.Value!.Value!, number.Value!.Value!, password.Value!, stringFormattedAsDecimalRequired.Value!.Value!, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -884,6 +926,8 @@ namespace Org.OpenAPITools.Model writer.WriteString("password", formatTest.Password); + writer.WriteString("string_formatted_as_decimal_required", formatTest.StringFormattedAsDecimalRequired.ToString()); + if (formatTest.BinaryOption.IsSet) { writer.WritePropertyName("binary"); @@ -939,6 +983,9 @@ namespace Org.OpenAPITools.Model if (formatTest.StringOption.IsSet) writer.WriteString("string", formatTest.String); + if (formatTest.StringFormattedAsDecimalOption.IsSet) + writer.WriteString("string_formatted_as_decimal", formatTest.StringFormattedAsDecimal.ToString()); + if (formatTest.UnsignedIntegerOption.IsSet) writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value!.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml index dfcb36db638..4f007819a1a 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml @@ -1706,11 +1706,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/FormatTest.md index 1009f35198f..8380bbcb556 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/docs/models/FormatTest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Date** | **DateOnly** | | **Number** | **decimal** | | **Password** | **string** | | +**StringFormattedAsDecimalRequired** | **decimal** | | **Binary** | **System.IO.Stream** | | [optional] **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] @@ -25,6 +26,7 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **String** | **string** | | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] **UnsignedInteger** | **uint** | | [optional] **UnsignedLong** | **ulong** | | [optional] **Uuid** | **Guid** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index 7dad1b08bc0..fe89f7090c4 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -89,6 +89,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Password' } + /// + /// Test the property 'StringFormattedAsDecimalRequired' + /// + [Fact] + public void StringFormattedAsDecimalRequiredTest() + { + // TODO unit test for the property 'StringFormattedAsDecimalRequired' + } + /// /// Test the property 'Binary' /// @@ -242,6 +251,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'String' } + /// + /// Test the property 'StringFormattedAsDecimal' + /// + [Fact] + public void StringFormattedAsDecimalTest() + { + // TODO unit test for the property 'StringFormattedAsDecimal' + } + /// /// Test the property 'UnsignedInteger' /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 7c9c96b05c0..217cf10f2dd 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -36,6 +36,7 @@ namespace Org.OpenAPITools.Model /// date /// number /// password + /// stringFormattedAsDecimalRequired /// binary /// dateTime /// decimal @@ -53,16 +54,18 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// string + /// stringFormattedAsDecimal /// unsignedInteger /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; Number = number; Password = password; + StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; BinaryOption = binary; DateTimeOption = dateTime; DecimalOption = @decimal; @@ -80,6 +83,7 @@ namespace Org.OpenAPITools.Model PatternWithDigitsOption = patternWithDigits; PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; StringOption = @string; + StringFormattedAsDecimalOption = stringFormattedAsDecimal; UnsignedIntegerOption = unsignedInteger; UnsignedLongOption = unsignedLong; UuidOption = uuid; @@ -113,6 +117,12 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("password")] public string Password { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [JsonPropertyName("string_formatted_as_decimal_required")] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Used to track the state of Binary /// @@ -338,6 +348,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("string")] public string String { get { return this.StringOption; } set { this.StringOption = new(value); } } + /// + /// Used to track the state of StringFormattedAsDecimal + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StringFormattedAsDecimalOption { get; private set; } + + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [JsonPropertyName("string_formatted_as_decimal")] + public decimal? StringFormattedAsDecimal { get { return this.StringFormattedAsDecimalOption; } set { this.StringFormattedAsDecimalOption = new(value); } } + /// /// Used to track the state of UnsignedInteger /// @@ -396,6 +419,7 @@ namespace Org.OpenAPITools.Model sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); @@ -413,6 +437,7 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); @@ -628,6 +653,7 @@ namespace Org.OpenAPITools.Model Option date = default; Option number = default; Option password = default; + Option stringFormattedAsDecimalRequired = default; Option binary = default; Option dateTime = default; Option varDecimal = default; @@ -645,6 +671,7 @@ namespace Org.OpenAPITools.Model Option patternWithDigits = default; Option patternWithDigitsAndDelimiter = default; Option varString = default; + Option stringFormattedAsDecimal = default; Option unsignedInteger = default; Option unsignedLong = default; Option uuid = default; @@ -676,6 +703,9 @@ namespace Org.OpenAPITools.Model case "password": password = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal_required": + stringFormattedAsDecimalRequired = new Option(utf8JsonReader.GetDecimal()); + break; case "binary": binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; @@ -727,6 +757,9 @@ namespace Org.OpenAPITools.Model case "string": varString = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal": + stringFormattedAsDecimal = new Option(utf8JsonReader.GetDecimal()); + break; case "unsigned_integer": unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; @@ -754,6 +787,9 @@ namespace Org.OpenAPITools.Model if (!password.IsSet) throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + if (!stringFormattedAsDecimalRequired.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(stringFormattedAsDecimalRequired)); + if (varByte.IsSet && varByte.Value == null) throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); @@ -766,6 +802,9 @@ namespace Org.OpenAPITools.Model if (password.IsSet && password.Value == null) throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimalRequired.IsSet && stringFormattedAsDecimalRequired.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimalRequired), "Property is not nullable for class FormatTest."); + if (binary.IsSet && binary.Value == null) throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); @@ -817,6 +856,9 @@ namespace Org.OpenAPITools.Model if (varString.IsSet && varString.Value == null) throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimal.IsSet && stringFormattedAsDecimal.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimal), "Property is not nullable for class FormatTest."); + if (unsignedInteger.IsSet && unsignedInteger.Value == null) throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); @@ -826,7 +868,7 @@ namespace Org.OpenAPITools.Model if (uuid.IsSet && uuid.Value == null) throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); - return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -882,6 +924,8 @@ namespace Org.OpenAPITools.Model writer.WriteString("password", formatTest.Password); + writer.WriteString("string_formatted_as_decimal_required", formatTest.StringFormattedAsDecimalRequired.ToString()); + if (formatTest.BinaryOption.IsSet) { writer.WritePropertyName("binary"); @@ -937,6 +981,9 @@ namespace Org.OpenAPITools.Model if (formatTest.StringOption.IsSet) writer.WriteString("string", formatTest.String); + if (formatTest.StringFormattedAsDecimalOption.IsSet) + writer.WriteString("string_formatted_as_decimal", formatTest.StringFormattedAsDecimal.ToString()); + if (formatTest.UnsignedIntegerOption.IsSet) writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml index dfcb36db638..4f007819a1a 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml @@ -1706,11 +1706,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/FormatTest.md index 1009f35198f..8380bbcb556 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/docs/models/FormatTest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Date** | **DateOnly** | | **Number** | **decimal** | | **Password** | **string** | | +**StringFormattedAsDecimalRequired** | **decimal** | | **Binary** | **System.IO.Stream** | | [optional] **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] @@ -25,6 +26,7 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **String** | **string** | | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] **UnsignedInteger** | **uint** | | [optional] **UnsignedLong** | **ulong** | | [optional] **Uuid** | **Guid** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index 7dad1b08bc0..fe89f7090c4 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -89,6 +89,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Password' } + /// + /// Test the property 'StringFormattedAsDecimalRequired' + /// + [Fact] + public void StringFormattedAsDecimalRequiredTest() + { + // TODO unit test for the property 'StringFormattedAsDecimalRequired' + } + /// /// Test the property 'Binary' /// @@ -242,6 +251,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'String' } + /// + /// Test the property 'StringFormattedAsDecimal' + /// + [Fact] + public void StringFormattedAsDecimalTest() + { + // TODO unit test for the property 'StringFormattedAsDecimal' + } + /// /// Test the property 'UnsignedInteger' /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs index 57b32c67f7b..894fa9a3fa8 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs @@ -39,6 +39,7 @@ namespace Org.OpenAPITools.Model /// date /// number /// password + /// stringFormattedAsDecimalRequired /// binary /// dateTime /// decimal @@ -56,16 +57,18 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// string + /// stringFormattedAsDecimal /// unsignedInteger /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; Number = number; Password = password; + StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; BinaryOption = binary; DateTimeOption = dateTime; DecimalOption = @decimal; @@ -83,6 +86,7 @@ namespace Org.OpenAPITools.Model PatternWithDigitsOption = patternWithDigits; PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; StringOption = @string; + StringFormattedAsDecimalOption = stringFormattedAsDecimal; UnsignedIntegerOption = unsignedInteger; UnsignedLongOption = unsignedLong; UuidOption = uuid; @@ -116,6 +120,12 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("password")] public string Password { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [JsonPropertyName("string_formatted_as_decimal_required")] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Used to track the state of Binary /// @@ -341,6 +351,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("string")] public string? String { get { return this.StringOption; } set { this.StringOption = new(value); } } + /// + /// Used to track the state of StringFormattedAsDecimal + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StringFormattedAsDecimalOption { get; private set; } + + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [JsonPropertyName("string_formatted_as_decimal")] + public decimal? StringFormattedAsDecimal { get { return this.StringFormattedAsDecimalOption; } set { this.StringFormattedAsDecimalOption = new(value); } } + /// /// Used to track the state of UnsignedInteger /// @@ -399,6 +422,7 @@ namespace Org.OpenAPITools.Model sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); @@ -416,6 +440,7 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); @@ -631,6 +656,7 @@ namespace Org.OpenAPITools.Model Option date = default; Option number = default; Option password = default; + Option stringFormattedAsDecimalRequired = default; Option binary = default; Option dateTime = default; Option varDecimal = default; @@ -648,6 +674,7 @@ namespace Org.OpenAPITools.Model Option patternWithDigits = default; Option patternWithDigitsAndDelimiter = default; Option varString = default; + Option stringFormattedAsDecimal = default; Option unsignedInteger = default; Option unsignedLong = default; Option uuid = default; @@ -679,6 +706,9 @@ namespace Org.OpenAPITools.Model case "password": password = new Option(utf8JsonReader.GetString()!); break; + case "string_formatted_as_decimal_required": + stringFormattedAsDecimalRequired = new Option(utf8JsonReader.GetDecimal()); + break; case "binary": binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; @@ -730,6 +760,9 @@ namespace Org.OpenAPITools.Model case "string": varString = new Option(utf8JsonReader.GetString()!); break; + case "string_formatted_as_decimal": + stringFormattedAsDecimal = new Option(utf8JsonReader.GetDecimal()); + break; case "unsigned_integer": unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; @@ -757,6 +790,9 @@ namespace Org.OpenAPITools.Model if (!password.IsSet) throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + if (!stringFormattedAsDecimalRequired.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(stringFormattedAsDecimalRequired)); + if (varByte.IsSet && varByte.Value == null) throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); @@ -769,6 +805,9 @@ namespace Org.OpenAPITools.Model if (password.IsSet && password.Value == null) throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimalRequired.IsSet && stringFormattedAsDecimalRequired.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimalRequired), "Property is not nullable for class FormatTest."); + if (binary.IsSet && binary.Value == null) throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); @@ -820,6 +859,9 @@ namespace Org.OpenAPITools.Model if (varString.IsSet && varString.Value == null) throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimal.IsSet && stringFormattedAsDecimal.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimal), "Property is not nullable for class FormatTest."); + if (unsignedInteger.IsSet && unsignedInteger.Value == null) throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); @@ -829,7 +871,7 @@ namespace Org.OpenAPITools.Model if (uuid.IsSet && uuid.Value == null) throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); - return new FormatTest(varByte.Value!, date.Value!.Value!, number.Value!.Value!, password.Value!, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value!, date.Value!.Value!, number.Value!.Value!, password.Value!, stringFormattedAsDecimalRequired.Value!.Value!, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -885,6 +927,8 @@ namespace Org.OpenAPITools.Model writer.WriteString("password", formatTest.Password); + writer.WriteString("string_formatted_as_decimal_required", formatTest.StringFormattedAsDecimalRequired.ToString()); + if (formatTest.BinaryOption.IsSet) { writer.WritePropertyName("binary"); @@ -940,6 +984,9 @@ namespace Org.OpenAPITools.Model if (formatTest.StringOption.IsSet) writer.WriteString("string", formatTest.String); + if (formatTest.StringFormattedAsDecimalOption.IsSet) + writer.WriteString("string_formatted_as_decimal", formatTest.StringFormattedAsDecimal.ToString()); + if (formatTest.UnsignedIntegerOption.IsSet) writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value!.Value); diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net9/FormModels/api/openapi.yaml index b48dbb1f448..7bfc0de5a41 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/api/openapi.yaml @@ -1665,11 +1665,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net9/FormModels/docs/models/FormatTest.md index 1009f35198f..8380bbcb556 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/docs/models/FormatTest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Date** | **DateOnly** | | **Number** | **decimal** | | **Password** | **string** | | +**StringFormattedAsDecimalRequired** | **decimal** | | **Binary** | **System.IO.Stream** | | [optional] **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] @@ -25,6 +26,7 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **String** | **string** | | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] **UnsignedInteger** | **uint** | | [optional] **UnsignedLong** | **ulong** | | [optional] **Uuid** | **Guid** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index 7dad1b08bc0..fe89f7090c4 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -89,6 +89,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Password' } + /// + /// Test the property 'StringFormattedAsDecimalRequired' + /// + [Fact] + public void StringFormattedAsDecimalRequiredTest() + { + // TODO unit test for the property 'StringFormattedAsDecimalRequired' + } + /// /// Test the property 'Binary' /// @@ -242,6 +251,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'String' } + /// + /// Test the property 'StringFormattedAsDecimal' + /// + [Fact] + public void StringFormattedAsDecimalTest() + { + // TODO unit test for the property 'StringFormattedAsDecimal' + } + /// /// Test the property 'UnsignedInteger' /// diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs index 7c9c96b05c0..217cf10f2dd 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs @@ -36,6 +36,7 @@ namespace Org.OpenAPITools.Model /// date /// number /// password + /// stringFormattedAsDecimalRequired /// binary /// dateTime /// decimal @@ -53,16 +54,18 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// string + /// stringFormattedAsDecimal /// unsignedInteger /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; Number = number; Password = password; + StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; BinaryOption = binary; DateTimeOption = dateTime; DecimalOption = @decimal; @@ -80,6 +83,7 @@ namespace Org.OpenAPITools.Model PatternWithDigitsOption = patternWithDigits; PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; StringOption = @string; + StringFormattedAsDecimalOption = stringFormattedAsDecimal; UnsignedIntegerOption = unsignedInteger; UnsignedLongOption = unsignedLong; UuidOption = uuid; @@ -113,6 +117,12 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("password")] public string Password { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [JsonPropertyName("string_formatted_as_decimal_required")] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Used to track the state of Binary /// @@ -338,6 +348,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("string")] public string String { get { return this.StringOption; } set { this.StringOption = new(value); } } + /// + /// Used to track the state of StringFormattedAsDecimal + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StringFormattedAsDecimalOption { get; private set; } + + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [JsonPropertyName("string_formatted_as_decimal")] + public decimal? StringFormattedAsDecimal { get { return this.StringFormattedAsDecimalOption; } set { this.StringFormattedAsDecimalOption = new(value); } } + /// /// Used to track the state of UnsignedInteger /// @@ -396,6 +419,7 @@ namespace Org.OpenAPITools.Model sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); @@ -413,6 +437,7 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); @@ -628,6 +653,7 @@ namespace Org.OpenAPITools.Model Option date = default; Option number = default; Option password = default; + Option stringFormattedAsDecimalRequired = default; Option binary = default; Option dateTime = default; Option varDecimal = default; @@ -645,6 +671,7 @@ namespace Org.OpenAPITools.Model Option patternWithDigits = default; Option patternWithDigitsAndDelimiter = default; Option varString = default; + Option stringFormattedAsDecimal = default; Option unsignedInteger = default; Option unsignedLong = default; Option uuid = default; @@ -676,6 +703,9 @@ namespace Org.OpenAPITools.Model case "password": password = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal_required": + stringFormattedAsDecimalRequired = new Option(utf8JsonReader.GetDecimal()); + break; case "binary": binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; @@ -727,6 +757,9 @@ namespace Org.OpenAPITools.Model case "string": varString = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal": + stringFormattedAsDecimal = new Option(utf8JsonReader.GetDecimal()); + break; case "unsigned_integer": unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; @@ -754,6 +787,9 @@ namespace Org.OpenAPITools.Model if (!password.IsSet) throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + if (!stringFormattedAsDecimalRequired.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(stringFormattedAsDecimalRequired)); + if (varByte.IsSet && varByte.Value == null) throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); @@ -766,6 +802,9 @@ namespace Org.OpenAPITools.Model if (password.IsSet && password.Value == null) throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimalRequired.IsSet && stringFormattedAsDecimalRequired.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimalRequired), "Property is not nullable for class FormatTest."); + if (binary.IsSet && binary.Value == null) throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); @@ -817,6 +856,9 @@ namespace Org.OpenAPITools.Model if (varString.IsSet && varString.Value == null) throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimal.IsSet && stringFormattedAsDecimal.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimal), "Property is not nullable for class FormatTest."); + if (unsignedInteger.IsSet && unsignedInteger.Value == null) throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); @@ -826,7 +868,7 @@ namespace Org.OpenAPITools.Model if (uuid.IsSet && uuid.Value == null) throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); - return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -882,6 +924,8 @@ namespace Org.OpenAPITools.Model writer.WriteString("password", formatTest.Password); + writer.WriteString("string_formatted_as_decimal_required", formatTest.StringFormattedAsDecimalRequired.ToString()); + if (formatTest.BinaryOption.IsSet) { writer.WritePropertyName("binary"); @@ -937,6 +981,9 @@ namespace Org.OpenAPITools.Model if (formatTest.StringOption.IsSet) writer.WriteString("string", formatTest.String); + if (formatTest.StringFormattedAsDecimalOption.IsSet) + writer.WriteString("string_formatted_as_decimal", formatTest.StringFormattedAsDecimal.ToString()); + if (formatTest.UnsignedIntegerOption.IsSet) writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/api/openapi.yaml index dfcb36db638..4f007819a1a 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/api/openapi.yaml @@ -1706,11 +1706,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/docs/models/FormatTest.md index 1009f35198f..8380bbcb556 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/docs/models/FormatTest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Date** | **DateOnly** | | **Number** | **decimal** | | **Password** | **string** | | +**StringFormattedAsDecimalRequired** | **decimal** | | **Binary** | **System.IO.Stream** | | [optional] **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] @@ -25,6 +26,7 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **String** | **string** | | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] **UnsignedInteger** | **uint** | | [optional] **UnsignedLong** | **ulong** | | [optional] **Uuid** | **Guid** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index 7dad1b08bc0..fe89f7090c4 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -89,6 +89,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Password' } + /// + /// Test the property 'StringFormattedAsDecimalRequired' + /// + [Fact] + public void StringFormattedAsDecimalRequiredTest() + { + // TODO unit test for the property 'StringFormattedAsDecimalRequired' + } + /// /// Test the property 'Binary' /// @@ -242,6 +251,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'String' } + /// + /// Test the property 'StringFormattedAsDecimal' + /// + [Fact] + public void StringFormattedAsDecimalTest() + { + // TODO unit test for the property 'StringFormattedAsDecimal' + } + /// /// Test the property 'UnsignedInteger' /// diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs index 5564d0d3843..a5dae71ad9d 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs @@ -38,6 +38,7 @@ namespace Org.OpenAPITools.Model /// date /// number /// password + /// stringFormattedAsDecimalRequired /// binary /// dateTime /// decimal @@ -55,16 +56,18 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// string + /// stringFormattedAsDecimal /// unsignedInteger /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; Number = number; Password = password; + StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; BinaryOption = binary; DateTimeOption = dateTime; DecimalOption = @decimal; @@ -82,6 +85,7 @@ namespace Org.OpenAPITools.Model PatternWithDigitsOption = patternWithDigits; PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; StringOption = @string; + StringFormattedAsDecimalOption = stringFormattedAsDecimal; UnsignedIntegerOption = unsignedInteger; UnsignedLongOption = unsignedLong; UuidOption = uuid; @@ -115,6 +119,12 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("password")] public string Password { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [JsonPropertyName("string_formatted_as_decimal_required")] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Used to track the state of Binary /// @@ -340,6 +350,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("string")] public string? String { get { return this.StringOption; } set { this.StringOption = new(value); } } + /// + /// Used to track the state of StringFormattedAsDecimal + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StringFormattedAsDecimalOption { get; private set; } + + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [JsonPropertyName("string_formatted_as_decimal")] + public decimal? StringFormattedAsDecimal { get { return this.StringFormattedAsDecimalOption; } set { this.StringFormattedAsDecimalOption = new(value); } } + /// /// Used to track the state of UnsignedInteger /// @@ -398,6 +421,7 @@ namespace Org.OpenAPITools.Model sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); @@ -415,6 +439,7 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); @@ -630,6 +655,7 @@ namespace Org.OpenAPITools.Model Option date = default; Option number = default; Option password = default; + Option stringFormattedAsDecimalRequired = default; Option binary = default; Option dateTime = default; Option varDecimal = default; @@ -647,6 +673,7 @@ namespace Org.OpenAPITools.Model Option patternWithDigits = default; Option patternWithDigitsAndDelimiter = default; Option varString = default; + Option stringFormattedAsDecimal = default; Option unsignedInteger = default; Option unsignedLong = default; Option uuid = default; @@ -678,6 +705,9 @@ namespace Org.OpenAPITools.Model case "password": password = new Option(utf8JsonReader.GetString()!); break; + case "string_formatted_as_decimal_required": + stringFormattedAsDecimalRequired = new Option(utf8JsonReader.GetDecimal()); + break; case "binary": binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; @@ -729,6 +759,9 @@ namespace Org.OpenAPITools.Model case "string": varString = new Option(utf8JsonReader.GetString()!); break; + case "string_formatted_as_decimal": + stringFormattedAsDecimal = new Option(utf8JsonReader.GetDecimal()); + break; case "unsigned_integer": unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; @@ -756,6 +789,9 @@ namespace Org.OpenAPITools.Model if (!password.IsSet) throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + if (!stringFormattedAsDecimalRequired.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(stringFormattedAsDecimalRequired)); + if (varByte.IsSet && varByte.Value == null) throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); @@ -768,6 +804,9 @@ namespace Org.OpenAPITools.Model if (password.IsSet && password.Value == null) throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimalRequired.IsSet && stringFormattedAsDecimalRequired.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimalRequired), "Property is not nullable for class FormatTest."); + if (binary.IsSet && binary.Value == null) throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); @@ -819,6 +858,9 @@ namespace Org.OpenAPITools.Model if (varString.IsSet && varString.Value == null) throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimal.IsSet && stringFormattedAsDecimal.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimal), "Property is not nullable for class FormatTest."); + if (unsignedInteger.IsSet && unsignedInteger.Value == null) throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); @@ -828,7 +870,7 @@ namespace Org.OpenAPITools.Model if (uuid.IsSet && uuid.Value == null) throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); - return new FormatTest(varByte.Value!, date.Value!.Value!, number.Value!.Value!, password.Value!, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value!, date.Value!.Value!, number.Value!.Value!, password.Value!, stringFormattedAsDecimalRequired.Value!.Value!, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -884,6 +926,8 @@ namespace Org.OpenAPITools.Model writer.WriteString("password", formatTest.Password); + writer.WriteString("string_formatted_as_decimal_required", formatTest.StringFormattedAsDecimalRequired.ToString()); + if (formatTest.BinaryOption.IsSet) { writer.WritePropertyName("binary"); @@ -939,6 +983,9 @@ namespace Org.OpenAPITools.Model if (formatTest.StringOption.IsSet) writer.WriteString("string", formatTest.String); + if (formatTest.StringFormattedAsDecimalOption.IsSet) + writer.WriteString("string_formatted_as_decimal", formatTest.StringFormattedAsDecimal.ToString()); + if (formatTest.UnsignedIntegerOption.IsSet) writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value!.Value); diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net9/Petstore/api/openapi.yaml index dfcb36db638..4f007819a1a 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/api/openapi.yaml @@ -1706,11 +1706,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net9/Petstore/docs/models/FormatTest.md index 1009f35198f..8380bbcb556 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/docs/models/FormatTest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Date** | **DateOnly** | | **Number** | **decimal** | | **Password** | **string** | | +**StringFormattedAsDecimalRequired** | **decimal** | | **Binary** | **System.IO.Stream** | | [optional] **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] @@ -25,6 +26,7 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **String** | **string** | | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] **UnsignedInteger** | **uint** | | [optional] **UnsignedLong** | **ulong** | | [optional] **Uuid** | **Guid** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index 7dad1b08bc0..fe89f7090c4 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -89,6 +89,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Password' } + /// + /// Test the property 'StringFormattedAsDecimalRequired' + /// + [Fact] + public void StringFormattedAsDecimalRequiredTest() + { + // TODO unit test for the property 'StringFormattedAsDecimalRequired' + } + /// /// Test the property 'Binary' /// @@ -242,6 +251,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'String' } + /// + /// Test the property 'StringFormattedAsDecimal' + /// + [Fact] + public void StringFormattedAsDecimalTest() + { + // TODO unit test for the property 'StringFormattedAsDecimal' + } + /// /// Test the property 'UnsignedInteger' /// diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 7c9c96b05c0..217cf10f2dd 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -36,6 +36,7 @@ namespace Org.OpenAPITools.Model /// date /// number /// password + /// stringFormattedAsDecimalRequired /// binary /// dateTime /// decimal @@ -53,16 +54,18 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// string + /// stringFormattedAsDecimal /// unsignedInteger /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; Number = number; Password = password; + StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; BinaryOption = binary; DateTimeOption = dateTime; DecimalOption = @decimal; @@ -80,6 +83,7 @@ namespace Org.OpenAPITools.Model PatternWithDigitsOption = patternWithDigits; PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; StringOption = @string; + StringFormattedAsDecimalOption = stringFormattedAsDecimal; UnsignedIntegerOption = unsignedInteger; UnsignedLongOption = unsignedLong; UuidOption = uuid; @@ -113,6 +117,12 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("password")] public string Password { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [JsonPropertyName("string_formatted_as_decimal_required")] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Used to track the state of Binary /// @@ -338,6 +348,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("string")] public string String { get { return this.StringOption; } set { this.StringOption = new(value); } } + /// + /// Used to track the state of StringFormattedAsDecimal + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StringFormattedAsDecimalOption { get; private set; } + + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [JsonPropertyName("string_formatted_as_decimal")] + public decimal? StringFormattedAsDecimal { get { return this.StringFormattedAsDecimalOption; } set { this.StringFormattedAsDecimalOption = new(value); } } + /// /// Used to track the state of UnsignedInteger /// @@ -396,6 +419,7 @@ namespace Org.OpenAPITools.Model sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); @@ -413,6 +437,7 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); @@ -628,6 +653,7 @@ namespace Org.OpenAPITools.Model Option date = default; Option number = default; Option password = default; + Option stringFormattedAsDecimalRequired = default; Option binary = default; Option dateTime = default; Option varDecimal = default; @@ -645,6 +671,7 @@ namespace Org.OpenAPITools.Model Option patternWithDigits = default; Option patternWithDigitsAndDelimiter = default; Option varString = default; + Option stringFormattedAsDecimal = default; Option unsignedInteger = default; Option unsignedLong = default; Option uuid = default; @@ -676,6 +703,9 @@ namespace Org.OpenAPITools.Model case "password": password = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal_required": + stringFormattedAsDecimalRequired = new Option(utf8JsonReader.GetDecimal()); + break; case "binary": binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; @@ -727,6 +757,9 @@ namespace Org.OpenAPITools.Model case "string": varString = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal": + stringFormattedAsDecimal = new Option(utf8JsonReader.GetDecimal()); + break; case "unsigned_integer": unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; @@ -754,6 +787,9 @@ namespace Org.OpenAPITools.Model if (!password.IsSet) throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + if (!stringFormattedAsDecimalRequired.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(stringFormattedAsDecimalRequired)); + if (varByte.IsSet && varByte.Value == null) throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); @@ -766,6 +802,9 @@ namespace Org.OpenAPITools.Model if (password.IsSet && password.Value == null) throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimalRequired.IsSet && stringFormattedAsDecimalRequired.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimalRequired), "Property is not nullable for class FormatTest."); + if (binary.IsSet && binary.Value == null) throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); @@ -817,6 +856,9 @@ namespace Org.OpenAPITools.Model if (varString.IsSet && varString.Value == null) throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimal.IsSet && stringFormattedAsDecimal.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimal), "Property is not nullable for class FormatTest."); + if (unsignedInteger.IsSet && unsignedInteger.Value == null) throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); @@ -826,7 +868,7 @@ namespace Org.OpenAPITools.Model if (uuid.IsSet && uuid.Value == null) throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); - return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -882,6 +924,8 @@ namespace Org.OpenAPITools.Model writer.WriteString("password", formatTest.Password); + writer.WriteString("string_formatted_as_decimal_required", formatTest.StringFormattedAsDecimalRequired.ToString()); + if (formatTest.BinaryOption.IsSet) { writer.WritePropertyName("binary"); @@ -937,6 +981,9 @@ namespace Org.OpenAPITools.Model if (formatTest.StringOption.IsSet) writer.WriteString("string", formatTest.String); + if (formatTest.StringFormattedAsDecimalOption.IsSet) + writer.WriteString("string_formatted_as_decimal", formatTest.StringFormattedAsDecimal.ToString()); + if (formatTest.UnsignedIntegerOption.IsSet) writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/api/openapi.yaml index dfcb36db638..4f007819a1a 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/api/openapi.yaml @@ -1706,11 +1706,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/docs/models/FormatTest.md index 1009f35198f..8380bbcb556 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/docs/models/FormatTest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Date** | **DateOnly** | | **Number** | **decimal** | | **Password** | **string** | | +**StringFormattedAsDecimalRequired** | **decimal** | | **Binary** | **System.IO.Stream** | | [optional] **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] @@ -25,6 +26,7 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **String** | **string** | | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] **UnsignedInteger** | **uint** | | [optional] **UnsignedLong** | **ulong** | | [optional] **Uuid** | **Guid** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index 7dad1b08bc0..fe89f7090c4 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -89,6 +89,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Password' } + /// + /// Test the property 'StringFormattedAsDecimalRequired' + /// + [Fact] + public void StringFormattedAsDecimalRequiredTest() + { + // TODO unit test for the property 'StringFormattedAsDecimalRequired' + } + /// /// Test the property 'Binary' /// @@ -242,6 +251,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'String' } + /// + /// Test the property 'StringFormattedAsDecimal' + /// + [Fact] + public void StringFormattedAsDecimalTest() + { + // TODO unit test for the property 'StringFormattedAsDecimal' + } + /// /// Test the property 'UnsignedInteger' /// diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs index 57b32c67f7b..894fa9a3fa8 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs @@ -39,6 +39,7 @@ namespace Org.OpenAPITools.Model /// date /// number /// password + /// stringFormattedAsDecimalRequired /// binary /// dateTime /// decimal @@ -56,16 +57,18 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// string + /// stringFormattedAsDecimal /// unsignedInteger /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; Number = number; Password = password; + StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; BinaryOption = binary; DateTimeOption = dateTime; DecimalOption = @decimal; @@ -83,6 +86,7 @@ namespace Org.OpenAPITools.Model PatternWithDigitsOption = patternWithDigits; PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; StringOption = @string; + StringFormattedAsDecimalOption = stringFormattedAsDecimal; UnsignedIntegerOption = unsignedInteger; UnsignedLongOption = unsignedLong; UuidOption = uuid; @@ -116,6 +120,12 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("password")] public string Password { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [JsonPropertyName("string_formatted_as_decimal_required")] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Used to track the state of Binary /// @@ -341,6 +351,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("string")] public string? String { get { return this.StringOption; } set { this.StringOption = new(value); } } + /// + /// Used to track the state of StringFormattedAsDecimal + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StringFormattedAsDecimalOption { get; private set; } + + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [JsonPropertyName("string_formatted_as_decimal")] + public decimal? StringFormattedAsDecimal { get { return this.StringFormattedAsDecimalOption; } set { this.StringFormattedAsDecimalOption = new(value); } } + /// /// Used to track the state of UnsignedInteger /// @@ -399,6 +422,7 @@ namespace Org.OpenAPITools.Model sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); @@ -416,6 +440,7 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); @@ -631,6 +656,7 @@ namespace Org.OpenAPITools.Model Option date = default; Option number = default; Option password = default; + Option stringFormattedAsDecimalRequired = default; Option binary = default; Option dateTime = default; Option varDecimal = default; @@ -648,6 +674,7 @@ namespace Org.OpenAPITools.Model Option patternWithDigits = default; Option patternWithDigitsAndDelimiter = default; Option varString = default; + Option stringFormattedAsDecimal = default; Option unsignedInteger = default; Option unsignedLong = default; Option uuid = default; @@ -679,6 +706,9 @@ namespace Org.OpenAPITools.Model case "password": password = new Option(utf8JsonReader.GetString()!); break; + case "string_formatted_as_decimal_required": + stringFormattedAsDecimalRequired = new Option(utf8JsonReader.GetDecimal()); + break; case "binary": binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)!); break; @@ -730,6 +760,9 @@ namespace Org.OpenAPITools.Model case "string": varString = new Option(utf8JsonReader.GetString()!); break; + case "string_formatted_as_decimal": + stringFormattedAsDecimal = new Option(utf8JsonReader.GetDecimal()); + break; case "unsigned_integer": unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; @@ -757,6 +790,9 @@ namespace Org.OpenAPITools.Model if (!password.IsSet) throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + if (!stringFormattedAsDecimalRequired.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(stringFormattedAsDecimalRequired)); + if (varByte.IsSet && varByte.Value == null) throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); @@ -769,6 +805,9 @@ namespace Org.OpenAPITools.Model if (password.IsSet && password.Value == null) throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimalRequired.IsSet && stringFormattedAsDecimalRequired.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimalRequired), "Property is not nullable for class FormatTest."); + if (binary.IsSet && binary.Value == null) throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); @@ -820,6 +859,9 @@ namespace Org.OpenAPITools.Model if (varString.IsSet && varString.Value == null) throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimal.IsSet && stringFormattedAsDecimal.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimal), "Property is not nullable for class FormatTest."); + if (unsignedInteger.IsSet && unsignedInteger.Value == null) throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); @@ -829,7 +871,7 @@ namespace Org.OpenAPITools.Model if (uuid.IsSet && uuid.Value == null) throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); - return new FormatTest(varByte.Value!, date.Value!.Value!, number.Value!.Value!, password.Value!, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value!, date.Value!.Value!, number.Value!.Value!, password.Value!, stringFormattedAsDecimalRequired.Value!.Value!, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -885,6 +927,8 @@ namespace Org.OpenAPITools.Model writer.WriteString("password", formatTest.Password); + writer.WriteString("string_formatted_as_decimal_required", formatTest.StringFormattedAsDecimalRequired.ToString()); + if (formatTest.BinaryOption.IsSet) { writer.WritePropertyName("binary"); @@ -940,6 +984,9 @@ namespace Org.OpenAPITools.Model if (formatTest.StringOption.IsSet) writer.WriteString("string", formatTest.String); + if (formatTest.StringFormattedAsDecimalOption.IsSet) + writer.WriteString("string_formatted_as_decimal", formatTest.StringFormattedAsDecimal.ToString()); + if (formatTest.UnsignedIntegerOption.IsSet) writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value!.Value); diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/api/openapi.yaml index dfcb36db638..4f007819a1a 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/api/openapi.yaml @@ -1706,11 +1706,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/FormatTest.md index 5983bc09690..950546c1812 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/docs/models/FormatTest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **Date** | **DateTime** | | **Number** | **decimal** | | **Password** | **string** | | +**StringFormattedAsDecimalRequired** | **decimal** | | **Binary** | **System.IO.Stream** | | [optional] **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] @@ -25,6 +26,7 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **String** | **string** | | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] **UnsignedInteger** | **uint** | | [optional] **UnsignedLong** | **ulong** | | [optional] **Uuid** | **Guid** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index 7dad1b08bc0..fe89f7090c4 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -89,6 +89,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Password' } + /// + /// Test the property 'StringFormattedAsDecimalRequired' + /// + [Fact] + public void StringFormattedAsDecimalRequiredTest() + { + // TODO unit test for the property 'StringFormattedAsDecimalRequired' + } + /// /// Test the property 'Binary' /// @@ -242,6 +251,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'String' } + /// + /// Test the property 'StringFormattedAsDecimal' + /// + [Fact] + public void StringFormattedAsDecimalTest() + { + // TODO unit test for the property 'StringFormattedAsDecimal' + } + /// /// Test the property 'UnsignedInteger' /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index a4410d55b34..1887346c88b 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -36,6 +36,7 @@ namespace Org.OpenAPITools.Model /// date /// number /// password + /// stringFormattedAsDecimalRequired /// binary /// dateTime /// decimal @@ -53,16 +54,18 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. /// string + /// stringFormattedAsDecimal /// unsignedInteger /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateTime date, decimal number, string password, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateTime date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; Number = number; Password = password; + StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; BinaryOption = binary; DateTimeOption = dateTime; DecimalOption = @decimal; @@ -80,6 +83,7 @@ namespace Org.OpenAPITools.Model PatternWithDigitsOption = patternWithDigits; PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter; StringOption = @string; + StringFormattedAsDecimalOption = stringFormattedAsDecimal; UnsignedIntegerOption = unsignedInteger; UnsignedLongOption = unsignedLong; UuidOption = uuid; @@ -113,6 +117,12 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("password")] public string Password { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [JsonPropertyName("string_formatted_as_decimal_required")] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Used to track the state of Binary /// @@ -338,6 +348,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("string")] public string String { get { return this.StringOption; } set { this.StringOption = new Option(value); } } + /// + /// Used to track the state of StringFormattedAsDecimal + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option StringFormattedAsDecimalOption { get; private set; } + + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [JsonPropertyName("string_formatted_as_decimal")] + public decimal? StringFormattedAsDecimal { get { return this.StringFormattedAsDecimalOption; } set { this.StringFormattedAsDecimalOption = new Option(value); } } + /// /// Used to track the state of UnsignedInteger /// @@ -396,6 +419,7 @@ namespace Org.OpenAPITools.Model sb.Append(" Date: ").Append(Date).Append("\n"); sb.Append(" Number: ").Append(Number).Append("\n"); sb.Append(" Password: ").Append(Password).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append(" Binary: ").Append(Binary).Append("\n"); sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); @@ -413,6 +437,7 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" String: ").Append(String).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); sb.Append(" Uuid: ").Append(Uuid).Append("\n"); @@ -628,6 +653,7 @@ namespace Org.OpenAPITools.Model Option date = default; Option number = default; Option password = default; + Option stringFormattedAsDecimalRequired = default; Option binary = default; Option dateTime = default; Option varDecimal = default; @@ -645,6 +671,7 @@ namespace Org.OpenAPITools.Model Option patternWithDigits = default; Option patternWithDigitsAndDelimiter = default; Option varString = default; + Option stringFormattedAsDecimal = default; Option unsignedInteger = default; Option unsignedLong = default; Option uuid = default; @@ -676,6 +703,9 @@ namespace Org.OpenAPITools.Model case "password": password = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal_required": + stringFormattedAsDecimalRequired = new Option(utf8JsonReader.GetDecimal()); + break; case "binary": binary = new Option(JsonSerializer.Deserialize(ref utf8JsonReader, jsonSerializerOptions)); break; @@ -727,6 +757,9 @@ namespace Org.OpenAPITools.Model case "string": varString = new Option(utf8JsonReader.GetString()); break; + case "string_formatted_as_decimal": + stringFormattedAsDecimal = new Option(utf8JsonReader.GetDecimal()); + break; case "unsigned_integer": unsignedInteger = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (uint?)null : utf8JsonReader.GetUInt32()); break; @@ -754,6 +787,9 @@ namespace Org.OpenAPITools.Model if (!password.IsSet) throw new ArgumentException("Property is required for class FormatTest.", nameof(password)); + if (!stringFormattedAsDecimalRequired.IsSet) + throw new ArgumentException("Property is required for class FormatTest.", nameof(stringFormattedAsDecimalRequired)); + if (varByte.IsSet && varByte.Value == null) throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest."); @@ -766,6 +802,9 @@ namespace Org.OpenAPITools.Model if (password.IsSet && password.Value == null) throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimalRequired.IsSet && stringFormattedAsDecimalRequired.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimalRequired), "Property is not nullable for class FormatTest."); + if (binary.IsSet && binary.Value == null) throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest."); @@ -817,6 +856,9 @@ namespace Org.OpenAPITools.Model if (varString.IsSet && varString.Value == null) throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest."); + if (stringFormattedAsDecimal.IsSet && stringFormattedAsDecimal.Value == null) + throw new ArgumentNullException(nameof(stringFormattedAsDecimal), "Property is not nullable for class FormatTest."); + if (unsignedInteger.IsSet && unsignedInteger.Value == null) throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest."); @@ -826,7 +868,7 @@ namespace Org.OpenAPITools.Model if (uuid.IsSet && uuid.Value == null) throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest."); - return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -882,6 +924,8 @@ namespace Org.OpenAPITools.Model writer.WriteString("password", formatTest.Password); + writer.WriteString("string_formatted_as_decimal_required", formatTest.StringFormattedAsDecimalRequired.ToString()); + if (formatTest.BinaryOption.IsSet) { writer.WritePropertyName("binary"); @@ -937,6 +981,9 @@ namespace Org.OpenAPITools.Model if (formatTest.StringOption.IsSet) writer.WriteString("string", formatTest.String); + if (formatTest.StringFormattedAsDecimalOption.IsSet) + writer.WriteString("string_formatted_as_decimal", formatTest.StringFormattedAsDecimal.ToString()); + if (formatTest.UnsignedIntegerOption.IsSet) writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value.Value); diff --git a/samples/client/petstore/csharp/httpclient/net9/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/httpclient/net9/Petstore/api/openapi.yaml index dfcb36db638..4f007819a1a 100644 --- a/samples/client/petstore/csharp/httpclient/net9/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/httpclient/net9/Petstore/api/openapi.yaml @@ -1706,11 +1706,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/httpclient/net9/Petstore/docs/FormatTest.md b/samples/client/petstore/csharp/httpclient/net9/Petstore/docs/FormatTest.md index 7f34f02b4ae..25a96509f1d 100644 --- a/samples/client/petstore/csharp/httpclient/net9/Petstore/docs/FormatTest.md +++ b/samples/client/petstore/csharp/httpclient/net9/Petstore/docs/FormatTest.md @@ -28,6 +28,8 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **PatternWithBackslash** | **string** | None | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] +**StringFormattedAsDecimalRequired** | **decimal** | | [[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/httpclient/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/httpclient/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 508f9fe5dd8..e4edbed0494 100644 --- a/samples/client/petstore/csharp/httpclient/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/httpclient/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -68,7 +68,9 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. /// None. - public FormatTest(int integer = default(int), int int32 = default(int), int int32Range = default(int), int int64Positive = default(int), int int64Negative = default(int), int int64PositiveExclusive = default(int), int int64NegativeExclusive = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float varFloat = default(float), double varDouble = default(double), decimal varDecimal = default(decimal), string varString = default(string), byte[] varByte = default(byte[]), FileParameter binary = default(FileParameter), DateOnly date = default(DateOnly), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string)) + /// stringFormattedAsDecimal. + /// stringFormattedAsDecimalRequired (required). + public FormatTest(int integer = default(int), int int32 = default(int), int int32Range = default(int), int int64Positive = default(int), int int64Negative = default(int), int int64PositiveExclusive = default(int), int int64NegativeExclusive = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float varFloat = default(float), double varDouble = default(double), decimal varDecimal = default(decimal), string varString = default(string), byte[] varByte = default(byte[]), FileParameter binary = default(FileParameter), DateOnly date = default(DateOnly), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string), decimal stringFormattedAsDecimal = default(decimal), decimal stringFormattedAsDecimalRequired = default(decimal)) { this.Number = number; // to ensure "varByte" is required (not null) @@ -84,6 +86,7 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); } this.Password = password; + this.StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; this.Integer = integer; this.Int32 = int32; this.Int32Range = int32Range; @@ -104,6 +107,7 @@ namespace Org.OpenAPITools.Model this.PatternWithDigits = patternWithDigits; this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; this.PatternWithBackslash = patternWithBackslash; + this.StringFormattedAsDecimal = stringFormattedAsDecimal; this.AdditionalProperties = new Dictionary(); } @@ -263,6 +267,18 @@ namespace Org.OpenAPITools.Model [DataMember(Name = "pattern_with_backslash", EmitDefaultValue = false)] public string PatternWithBackslash { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [DataMember(Name = "string_formatted_as_decimal", EmitDefaultValue = false)] + public decimal StringFormattedAsDecimal { get; set; } + + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [DataMember(Name = "string_formatted_as_decimal_required", IsRequired = true, EmitDefaultValue = true)] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Gets or Sets additional properties /// @@ -301,6 +317,8 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -398,6 +416,8 @@ namespace Org.OpenAPITools.Model { hashCode = (hashCode * 59) + this.PatternWithBackslash.GetHashCode(); } + hashCode = (hashCode * 59) + this.StringFormattedAsDecimal.GetHashCode(); + hashCode = (hashCode * 59) + this.StringFormattedAsDecimalRequired.GetHashCode(); if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/api/openapi.yaml index dfcb36db638..4f007819a1a 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/api/openapi.yaml @@ -1706,11 +1706,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/docs/FormatTest.md b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/docs/FormatTest.md index c028ca73901..e6ba5f68b3f 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/docs/FormatTest.md +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/docs/FormatTest.md @@ -28,6 +28,8 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **PatternWithBackslash** | **string** | None | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] +**StringFormattedAsDecimalRequired** | **decimal** | | [[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/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 81da66d122d..3f5358b3bc8 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -68,7 +68,9 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. /// None. - public FormatTest(int integer = default(int), int int32 = default(int), int int32Range = default(int), int int64Positive = default(int), int int64Negative = default(int), int int64PositiveExclusive = default(int), int int64NegativeExclusive = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float varFloat = default(float), double varDouble = default(double), decimal varDecimal = default(decimal), string varString = default(string), byte[] varByte = default(byte[]), FileParameter binary = default(FileParameter), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string)) + /// stringFormattedAsDecimal. + /// stringFormattedAsDecimalRequired (required). + public FormatTest(int integer = default(int), int int32 = default(int), int int32Range = default(int), int int64Positive = default(int), int int64Negative = default(int), int int64PositiveExclusive = default(int), int int64NegativeExclusive = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float varFloat = default(float), double varDouble = default(double), decimal varDecimal = default(decimal), string varString = default(string), byte[] varByte = default(byte[]), FileParameter binary = default(FileParameter), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string), decimal stringFormattedAsDecimal = default(decimal), decimal stringFormattedAsDecimalRequired = default(decimal)) { this.Number = number; // to ensure "varByte" is required (not null) @@ -84,6 +86,7 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); } this.Password = password; + this.StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; this.Integer = integer; this.Int32 = int32; this.Int32Range = int32Range; @@ -104,6 +107,7 @@ namespace Org.OpenAPITools.Model this.PatternWithDigits = patternWithDigits; this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; this.PatternWithBackslash = patternWithBackslash; + this.StringFormattedAsDecimal = stringFormattedAsDecimal; this.AdditionalProperties = new Dictionary(); } @@ -264,6 +268,18 @@ namespace Org.OpenAPITools.Model [DataMember(Name = "pattern_with_backslash", EmitDefaultValue = false)] public string PatternWithBackslash { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [DataMember(Name = "string_formatted_as_decimal", EmitDefaultValue = false)] + public decimal StringFormattedAsDecimal { get; set; } + + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [DataMember(Name = "string_formatted_as_decimal_required", IsRequired = true, EmitDefaultValue = true)] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Gets or Sets additional properties /// @@ -302,6 +318,8 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -399,6 +417,8 @@ namespace Org.OpenAPITools.Model { hashCode = (hashCode * 59) + this.PatternWithBackslash.GetHashCode(); } + hashCode = (hashCode * 59) + this.StringFormattedAsDecimal.GetHashCode(); + hashCode = (hashCode * 59) + this.StringFormattedAsDecimalRequired.GetHashCode(); if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp/restsharp/net8/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/net8/Petstore/api/openapi.yaml index dfcb36db638..4f007819a1a 100644 --- a/samples/client/petstore/csharp/restsharp/net8/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/net8/Petstore/api/openapi.yaml @@ -1706,11 +1706,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/restsharp/net8/Petstore/docs/FormatTest.md b/samples/client/petstore/csharp/restsharp/net8/Petstore/docs/FormatTest.md index 2fe92b2cac8..5c185c58a73 100644 --- a/samples/client/petstore/csharp/restsharp/net8/Petstore/docs/FormatTest.md +++ b/samples/client/petstore/csharp/restsharp/net8/Petstore/docs/FormatTest.md @@ -28,6 +28,8 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **PatternWithBackslash** | **string** | None | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] +**StringFormattedAsDecimalRequired** | **decimal** | | [[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/restsharp/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/restsharp/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index fc3472412e5..1fb5c55b350 100644 --- a/samples/client/petstore/csharp/restsharp/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/restsharp/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -64,7 +64,9 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. /// None. - public FormatTest(int integer = default(int), int int32 = default(int), int int32Range = default(int), int int64Positive = default(int), int int64Negative = default(int), int int64PositiveExclusive = default(int), int int64NegativeExclusive = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float varFloat = default(float), double varDouble = default(double), decimal varDecimal = default(decimal), string varString = default(string), byte[] varByte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateOnly date = default(DateOnly), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string)) + /// stringFormattedAsDecimal. + /// stringFormattedAsDecimalRequired (required). + public FormatTest(int integer = default(int), int int32 = default(int), int int32Range = default(int), int int64Positive = default(int), int int64Negative = default(int), int int64PositiveExclusive = default(int), int int64NegativeExclusive = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float varFloat = default(float), double varDouble = default(double), decimal varDecimal = default(decimal), string varString = default(string), byte[] varByte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateOnly date = default(DateOnly), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string), decimal stringFormattedAsDecimal = default(decimal), decimal stringFormattedAsDecimalRequired = default(decimal)) { this.Number = number; // to ensure "varByte" is required (not null) @@ -80,6 +82,7 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); } this.Password = password; + this.StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; this.Integer = integer; this.Int32 = int32; this.Int32Range = int32Range; @@ -100,6 +103,7 @@ namespace Org.OpenAPITools.Model this.PatternWithDigits = patternWithDigits; this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; this.PatternWithBackslash = patternWithBackslash; + this.StringFormattedAsDecimal = stringFormattedAsDecimal; } /// @@ -258,6 +262,18 @@ namespace Org.OpenAPITools.Model [DataMember(Name = "pattern_with_backslash", EmitDefaultValue = false)] public string PatternWithBackslash { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [DataMember(Name = "string_formatted_as_decimal", EmitDefaultValue = false)] + public decimal StringFormattedAsDecimal { get; set; } + + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [DataMember(Name = "string_formatted_as_decimal_required", IsRequired = true, EmitDefaultValue = true)] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Returns the string presentation of the object /// @@ -290,6 +306,8 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -386,6 +404,8 @@ namespace Org.OpenAPITools.Model { hashCode = (hashCode * 59) + this.PatternWithBackslash.GetHashCode(); } + hashCode = (hashCode * 59) + this.StringFormattedAsDecimal.GetHashCode(); + hashCode = (hashCode * 59) + this.StringFormattedAsDecimalRequired.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/api/openapi.yaml index dfcb36db638..4f007819a1a 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/api/openapi.yaml @@ -1706,11 +1706,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/FormatTest.md b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/FormatTest.md index 1b12163e9a6..2c414708d68 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/FormatTest.md +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/docs/FormatTest.md @@ -28,6 +28,8 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **PatternWithBackslash** | **string** | None | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] +**StringFormattedAsDecimalRequired** | **decimal** | | [[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/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs index 4c576118fb1..b1a5be65d44 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/src/Org.OpenAPITools/Model/FormatTest.cs @@ -67,7 +67,9 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. /// None. - public FormatTest(int integer = default(int), int int32 = default(int), int int32Range = default(int), int int64Positive = default(int), int int64Negative = default(int), int int64PositiveExclusive = default(int), int int64NegativeExclusive = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float varFloat = default(float), double varDouble = default(double), decimal varDecimal = default(decimal), string varString = default(string), byte[] varByte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string)) + /// stringFormattedAsDecimal. + /// stringFormattedAsDecimalRequired (required). + public FormatTest(int integer = default(int), int int32 = default(int), int int32Range = default(int), int int64Positive = default(int), int int64Negative = default(int), int int64PositiveExclusive = default(int), int int64NegativeExclusive = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float varFloat = default(float), double varDouble = default(double), decimal varDecimal = default(decimal), string varString = default(string), byte[] varByte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string), decimal stringFormattedAsDecimal = default(decimal), decimal stringFormattedAsDecimalRequired = default(decimal)) { this._Number = number; // to ensure "varByte" is required (not null) @@ -83,6 +85,7 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); } this._Password = password; + this._StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; this._Integer = integer; if (this.Integer != null) { @@ -183,6 +186,11 @@ namespace Org.OpenAPITools.Model { this._flagPatternWithBackslash = true; } + this._StringFormattedAsDecimal = stringFormattedAsDecimal; + if (this.StringFormattedAsDecimal != null) + { + this._flagStringFormattedAsDecimal = true; + } this.AdditionalProperties = new Dictionary(); } @@ -776,6 +784,54 @@ namespace Org.OpenAPITools.Model return _flagPatternWithBackslash; } /// + /// Gets or Sets StringFormattedAsDecimal + /// + [DataMember(Name = "string_formatted_as_decimal", EmitDefaultValue = false)] + public decimal StringFormattedAsDecimal + { + get{ return _StringFormattedAsDecimal;} + set + { + _StringFormattedAsDecimal = value; + _flagStringFormattedAsDecimal = true; + } + } + private decimal _StringFormattedAsDecimal; + private bool _flagStringFormattedAsDecimal; + + /// + /// Returns false as StringFormattedAsDecimal should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeStringFormattedAsDecimal() + { + return _flagStringFormattedAsDecimal; + } + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [DataMember(Name = "string_formatted_as_decimal_required", IsRequired = true, EmitDefaultValue = true)] + public decimal StringFormattedAsDecimalRequired + { + get{ return _StringFormattedAsDecimalRequired;} + set + { + _StringFormattedAsDecimalRequired = value; + _flagStringFormattedAsDecimalRequired = true; + } + } + private decimal _StringFormattedAsDecimalRequired; + private bool _flagStringFormattedAsDecimalRequired; + + /// + /// Returns false as StringFormattedAsDecimalRequired should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeStringFormattedAsDecimalRequired() + { + return _flagStringFormattedAsDecimalRequired; + } + /// /// Gets or Sets additional properties /// [JsonExtensionData] @@ -813,6 +869,8 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -910,6 +968,8 @@ namespace Org.OpenAPITools.Model { hashCode = (hashCode * 59) + this.PatternWithBackslash.GetHashCode(); } + hashCode = (hashCode * 59) + this.StringFormattedAsDecimal.GetHashCode(); + hashCode = (hashCode * 59) + this.StringFormattedAsDecimalRequired.GetHashCode(); if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/api/openapi.yaml index dfcb36db638..4f007819a1a 100644 --- a/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/api/openapi.yaml @@ -1706,11 +1706,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/docs/FormatTest.md b/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/docs/FormatTest.md index 2fe92b2cac8..5c185c58a73 100644 --- a/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/docs/FormatTest.md +++ b/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/docs/FormatTest.md @@ -28,6 +28,8 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **PatternWithBackslash** | **string** | None | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] +**StringFormattedAsDecimalRequired** | **decimal** | | [[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/unityWebRequest/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 2eb69255b42..d8539527827 100644 --- a/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -62,7 +62,9 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. /// None. - public FormatTest(int integer = default(int), int int32 = default(int), int int32Range = default(int), int int64Positive = default(int), int int64Negative = default(int), int int64PositiveExclusive = default(int), int int64NegativeExclusive = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float varFloat = default(float), double varDouble = default(double), decimal varDecimal = default(decimal), string varString = default(string), byte[] varByte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateOnly date = default(DateOnly), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string)) + /// stringFormattedAsDecimal. + /// stringFormattedAsDecimalRequired (required). + public FormatTest(int integer = default(int), int int32 = default(int), int int32Range = default(int), int int64Positive = default(int), int int64Negative = default(int), int int64PositiveExclusive = default(int), int int64NegativeExclusive = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float varFloat = default(float), double varDouble = default(double), decimal varDecimal = default(decimal), string varString = default(string), byte[] varByte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateOnly date = default(DateOnly), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string), decimal stringFormattedAsDecimal = default(decimal), decimal stringFormattedAsDecimalRequired = default(decimal)) { this.Number = number; // to ensure "varByte" is required (not null) @@ -78,6 +80,7 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); } this.Password = password; + this.StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; this.Integer = integer; this.Int32 = int32; this.Int32Range = int32Range; @@ -98,6 +101,7 @@ namespace Org.OpenAPITools.Model this.PatternWithDigits = patternWithDigits; this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; this.PatternWithBackslash = patternWithBackslash; + this.StringFormattedAsDecimal = stringFormattedAsDecimal; } /// @@ -256,6 +260,18 @@ namespace Org.OpenAPITools.Model [DataMember(Name = "pattern_with_backslash", EmitDefaultValue = false)] public string PatternWithBackslash { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [DataMember(Name = "string_formatted_as_decimal", EmitDefaultValue = false)] + public decimal StringFormattedAsDecimal { get; set; } + + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [DataMember(Name = "string_formatted_as_decimal_required", IsRequired = true, EmitDefaultValue = true)] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Returns the string presentation of the object /// @@ -288,6 +304,8 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -428,6 +446,14 @@ namespace Org.OpenAPITools.Model this.PatternWithBackslash == input.PatternWithBackslash || (this.PatternWithBackslash != null && this.PatternWithBackslash.Equals(input.PatternWithBackslash)) + ) && + ( + this.StringFormattedAsDecimal == input.StringFormattedAsDecimal || + this.StringFormattedAsDecimal.Equals(input.StringFormattedAsDecimal) + ) && + ( + this.StringFormattedAsDecimalRequired == input.StringFormattedAsDecimalRequired || + this.StringFormattedAsDecimalRequired.Equals(input.StringFormattedAsDecimalRequired) ); } @@ -494,6 +520,8 @@ namespace Org.OpenAPITools.Model { hashCode = (hashCode * 59) + this.PatternWithBackslash.GetHashCode(); } + hashCode = (hashCode * 59) + this.StringFormattedAsDecimal.GetHashCode(); + hashCode = (hashCode * 59) + this.StringFormattedAsDecimalRequired.GetHashCode(); return hashCode; } } diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/api/openapi.yaml index dfcb36db638..4f007819a1a 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/api/openapi.yaml @@ -1706,11 +1706,18 @@ components: pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\ /([0-9]|[1-2][0-9]|3[0-2]))$" type: string + string_formatted_as_decimal: + format: decimal + type: string + string_formatted_as_decimal_required: + format: decimal + type: string required: - byte - date - number - password + - string_formatted_as_decimal_required type: object EnumClass: default: -efg diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/docs/FormatTest.md b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/docs/FormatTest.md index 1b12163e9a6..2c414708d68 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/docs/FormatTest.md +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/docs/FormatTest.md @@ -28,6 +28,8 @@ Name | Type | Description | Notes **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] **PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] **PatternWithBackslash** | **string** | None | [optional] +**StringFormattedAsDecimal** | **decimal** | | [optional] +**StringFormattedAsDecimalRequired** | **decimal** | | [[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/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 5a287cd7182..0bdef158492 100644 --- a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -62,7 +62,9 @@ namespace Org.OpenAPITools.Model /// A string that is a 10 digit number. Can have leading zeros.. /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.. /// None. - public FormatTest(int integer = default(int), int int32 = default(int), int int32Range = default(int), int int64Positive = default(int), int int64Negative = default(int), int int64PositiveExclusive = default(int), int int64NegativeExclusive = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float varFloat = default(float), double varDouble = default(double), decimal varDecimal = default(decimal), string varString = default(string), byte[] varByte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string)) + /// stringFormattedAsDecimal. + /// stringFormattedAsDecimalRequired (required). + public FormatTest(int integer = default(int), int int32 = default(int), int int32Range = default(int), int int64Positive = default(int), int int64Negative = default(int), int int64PositiveExclusive = default(int), int int64NegativeExclusive = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float varFloat = default(float), double varDouble = default(double), decimal varDecimal = default(decimal), string varString = default(string), byte[] varByte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string), decimal stringFormattedAsDecimal = default(decimal), decimal stringFormattedAsDecimalRequired = default(decimal)) { this.Number = number; // to ensure "varByte" is required (not null) @@ -78,6 +80,7 @@ namespace Org.OpenAPITools.Model throw new ArgumentNullException("password is a required property for FormatTest and cannot be null"); } this.Password = password; + this.StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired; this.Integer = integer; this.Int32 = int32; this.Int32Range = int32Range; @@ -98,6 +101,7 @@ namespace Org.OpenAPITools.Model this.PatternWithDigits = patternWithDigits; this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; this.PatternWithBackslash = patternWithBackslash; + this.StringFormattedAsDecimal = stringFormattedAsDecimal; } /// @@ -257,6 +261,18 @@ namespace Org.OpenAPITools.Model [DataMember(Name = "pattern_with_backslash", EmitDefaultValue = false)] public string PatternWithBackslash { get; set; } + /// + /// Gets or Sets StringFormattedAsDecimal + /// + [DataMember(Name = "string_formatted_as_decimal", EmitDefaultValue = false)] + public decimal StringFormattedAsDecimal { get; set; } + + /// + /// Gets or Sets StringFormattedAsDecimalRequired + /// + [DataMember(Name = "string_formatted_as_decimal_required", IsRequired = true, EmitDefaultValue = true)] + public decimal StringFormattedAsDecimalRequired { get; set; } + /// /// Returns the string presentation of the object /// @@ -289,6 +305,8 @@ namespace Org.OpenAPITools.Model sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n"); sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); + sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); + sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -429,6 +447,14 @@ namespace Org.OpenAPITools.Model this.PatternWithBackslash == input.PatternWithBackslash || (this.PatternWithBackslash != null && this.PatternWithBackslash.Equals(input.PatternWithBackslash)) + ) && + ( + this.StringFormattedAsDecimal == input.StringFormattedAsDecimal || + this.StringFormattedAsDecimal.Equals(input.StringFormattedAsDecimal) + ) && + ( + this.StringFormattedAsDecimalRequired == input.StringFormattedAsDecimalRequired || + this.StringFormattedAsDecimalRequired.Equals(input.StringFormattedAsDecimalRequired) ); } @@ -495,6 +521,8 @@ namespace Org.OpenAPITools.Model { hashCode = (hashCode * 59) + this.PatternWithBackslash.GetHashCode(); } + hashCode = (hashCode * 59) + this.StringFormattedAsDecimal.GetHashCode(); + hashCode = (hashCode * 59) + this.StringFormattedAsDecimalRequired.GetHashCode(); return hashCode; } }