diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java index 53665ab2750..ceaa772307f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCSharpCodegen.java @@ -480,6 +480,46 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen { property.isInnerEnum = false; property.isString = false; } + + Double maximum = asDouble(property.maximum); + if (property.dataType.equals("int") && maximum != null) { + if ((!property.exclusiveMaximum && asInteger(property.maximum) == null) || (property.exclusiveMaximum && asInteger((maximum + 1) + "") == null)) { + property.dataType = "long"; + property.datatypeWithEnum = "long"; + } + } + + Double minimum = asDouble(property.minimum); + if (property.dataType.equals("int") && minimum != null) { + if ((!property.exclusiveMinimum && asInteger(property.minimum) == null) || (property.exclusiveMinimum && asInteger((minimum - 1) + "") == null)) { + property.dataType = "long"; + property.datatypeWithEnum = "long"; + } + } + } + + /** If the value can be parsed as a double, returns the value, otherwise returns null */ + public static Double asDouble(String strNum) { + if (strNum == null) { + return null; + } + try { + return Double.parseDouble(strNum); + } catch (NumberFormatException nfe) { + return null; + } + } + + /** If the value can be parsed as an integer, returns the value, otherwise returns null */ + public static Integer asInteger(String strNum) { + if (strNum == null) { + return null; + } + try { + return Integer.parseInt(strNum); + } catch (NumberFormatException nfe) { + return null; + } } @Override diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache index eff9ec9313f..9331beec688 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api.mustache @@ -436,7 +436,6 @@ namespace {{packageName}}.{{apiPackage}} {{#queryParams}} {{^required}} if ({{paramName}}.IsSet) - // here too parseQueryStringLocalVar["{{baseName}}"] = ClientUtils.ParameterToString({{paramName}}.Value); {{/required}} diff --git a/modules/openapi-generator/src/main/resources/csharp/validatable.mustache b/modules/openapi-generator/src/main/resources/csharp/validatable.mustache index a79db1a641a..429eed118e1 100644 --- a/modules/openapi-generator/src/main/resources/csharp/validatable.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/validatable.mustache @@ -78,17 +78,17 @@ {{/minLength}} {{#maximum}} // {{{name}}} ({{{dataType}}}) maximum - if ({{#useGenericHost}}{{^required}}this.{{{name}}}Option.IsSet && {{/required}}{{/useGenericHost}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} > ({{{dataType}}}){{maximum}}) + if ({{#useGenericHost}}{{^required}}this.{{{name}}}Option.IsSet && {{/required}}{{/useGenericHost}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} {{#exclusiveMaximum}}<={{/exclusiveMaximum}}{{^exclusiveMaximum}}>{{/exclusiveMaximum}} ({{{dataType}}}){{maximum}}) { - yield return new ValidationResult("Invalid value for {{{name}}}, must be a value less than or equal to {{maximum}}.", new [] { "{{{name}}}" }); + yield return new ValidationResult("Invalid value for {{{name}}}, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}.", new [] { "{{{name}}}" }); } {{/maximum}} {{#minimum}} // {{{name}}} ({{{dataType}}}) minimum - if ({{#useGenericHost}}{{^required}}this.{{{name}}}Option.IsSet && {{/required}}{{/useGenericHost}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} < ({{{dataType}}}){{minimum}}) + if ({{#useGenericHost}}{{^required}}this.{{{name}}}Option.IsSet && {{/required}}{{/useGenericHost}}this.{{{name}}}{{#useGenericHost}}{{^required}}Option.Value{{/required}}{{/useGenericHost}} {{#exclusiveMaximum}}>={{/exclusiveMaximum}}{{^exclusiveMaximum}}<{{/exclusiveMaximum}} ({{{dataType}}}){{minimum}}) { - yield return new ValidationResult("Invalid value for {{{name}}}, must be a value greater than or equal to {{minimum}}.", new [] { "{{{name}}}" }); + yield return new ValidationResult("Invalid value for {{{name}}}, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}.", new [] { "{{{name}}}" }); } {{/minimum}} 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 985ef28a398..51c27299631 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 @@ -1684,6 +1684,24 @@ components: format: int32 maximum: 200 minimum: 20 + int32Range: + type: integer + maximum: 2147483647 + minimum: -2147483648 + int64Positive: + type: integer + minimum: 2147483648 # int.MaxValue + 1 + int64Negative: + type: integer + maximum: -2147483649 # int.MinValue - 1 + int64PositiveExclusive: + type: integer + minimum: 2147483647 + exclusiveMinimum: true + int64NegativeExclusive: + type: integer + maximum: -2147483648 + exclusiveMaximum: true unsigned_integer: type: integer format: int32 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 0143839cb66..915be7ae8ba 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 @@ -1576,6 +1576,24 @@ components: maximum: 200 minimum: 20 type: integer + int32Range: + maximum: 2147483647 + minimum: -2147483648 + type: integer + int64Positive: + minimum: 2147483648 + type: integer + int64Negative: + maximum: -2147483649 + type: integer + int64PositiveExclusive: + exclusiveMinimum: true + minimum: 2147483647 + type: integer + int64NegativeExclusive: + exclusiveMaximum: true + maximum: -2147483648 + type: integer unsigned_integer: format: int32 maximum: 200 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 0983002c5da..5983bc09690 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 @@ -14,7 +14,12 @@ Name | Type | Description | Notes **Double** | **double** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] +**Int32Range** | **int** | | [optional] **Int64** | **long** | | [optional] +**Int64Negative** | **long** | | [optional] +**Int64NegativeExclusive** | **long** | | [optional] +**Int64Positive** | **long** | | [optional] +**Int64PositiveExclusive** | **long** | | [optional] **Integer** | **int** | | [optional] **PatternWithBackslash** | **string** | None | [optional] **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [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 b658f317f1c..7dad1b08bc0 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 @@ -143,6 +143,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int32' } + /// + /// Test the property 'Int32Range' + /// + [Fact] + public void Int32RangeTest() + { + // TODO unit test for the property 'Int32Range' + } + /// /// Test the property 'Int64' /// @@ -152,6 +161,42 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int64' } + /// + /// Test the property 'Int64Negative' + /// + [Fact] + public void Int64NegativeTest() + { + // TODO unit test for the property 'Int64Negative' + } + + /// + /// Test the property 'Int64NegativeExclusive' + /// + [Fact] + public void Int64NegativeExclusiveTest() + { + // TODO unit test for the property 'Int64NegativeExclusive' + } + + /// + /// Test the property 'Int64Positive' + /// + [Fact] + public void Int64PositiveTest() + { + // TODO unit test for the property 'Int64Positive' + } + + /// + /// Test the property 'Int64PositiveExclusive' + /// + [Fact] + public void Int64PositiveExclusiveTest() + { + // TODO unit test for the property 'Int64PositiveExclusive' + } + /// /// Test the property 'Integer' /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs index 01eeeb00511..6ad90eba93c 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs @@ -4281,19 +4281,15 @@ namespace Org.OpenAPITools.Api System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); if (enumQueryStringArray.IsSet) - // here too parseQueryStringLocalVar["enum_query_string_array"] = ClientUtils.ParameterToString(enumQueryStringArray.Value); if (enumQueryString.IsSet) - // here too parseQueryStringLocalVar["enum_query_string"] = ClientUtils.ParameterToString(enumQueryString.Value); if (enumQueryDouble.IsSet) - // here too parseQueryStringLocalVar["enum_query_double"] = ClientUtils.ParameterToString(enumQueryDouble.Value); if (enumQueryInteger.IsSet) - // here too parseQueryStringLocalVar["enum_query_integer"] = ClientUtils.ParameterToString(enumQueryInteger.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -4530,11 +4526,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["required_int64_group"] = ClientUtils.ParameterToString(requiredInt64Group); if (stringGroup.IsSet) - // here too parseQueryStringLocalVar["string_group"] = ClientUtils.ParameterToString(stringGroup.Value); if (int64Group.IsSet) - // here too parseQueryStringLocalVar["int64_group"] = ClientUtils.ParameterToString(int64Group.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -5398,11 +5392,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["requiredNullable"] = ClientUtils.ParameterToString(requiredNullable); if (notRequiredNotNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNotNullable"] = ClientUtils.ParameterToString(notRequiredNotNullable.Value); if (notRequiredNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNullable"] = ClientUtils.ParameterToString(notRequiredNullable.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); 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 3fc88d4d403..9aa5ea7d327 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 @@ -42,7 +42,12 @@ namespace Org.OpenAPITools.Model /// double /// float /// int32 + /// int32Range /// int64 + /// int64Negative + /// int64NegativeExclusive + /// int64Positive + /// int64PositiveExclusive /// integer /// None /// A string that is a 10 digit number. Can have leading zeros. @@ -52,7 +57,7 @@ namespace Org.OpenAPITools.Model /// 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 int64 = 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, 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) { Byte = @byte; Date = date; @@ -64,7 +69,12 @@ namespace Org.OpenAPITools.Model DoubleOption = @double; FloatOption = @float; Int32Option = int32; + Int32RangeOption = int32Range; Int64Option = int64; + Int64NegativeOption = int64Negative; + Int64NegativeExclusiveOption = int64NegativeExclusive; + Int64PositiveOption = int64Positive; + Int64PositiveExclusiveOption = int64PositiveExclusive; IntegerOption = integer; PatternWithBackslashOption = patternWithBackslash; PatternWithDigitsOption = patternWithDigits; @@ -182,6 +192,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int32")] public int? Int32 { get { return this.Int32Option; } set { this.Int32Option = new Option(value); } } + /// + /// Used to track the state of Int32Range + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int32RangeOption { get; private set; } + + /// + /// Gets or Sets Int32Range + /// + [JsonPropertyName("int32Range")] + public int? Int32Range { get { return this.Int32RangeOption; } set { this.Int32RangeOption = new Option(value); } } + /// /// Used to track the state of Int64 /// @@ -195,6 +218,58 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int64")] public long? Int64 { get { return this.Int64Option; } set { this.Int64Option = new Option(value); } } + /// + /// Used to track the state of Int64Negative + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeOption { get; private set; } + + /// + /// Gets or Sets Int64Negative + /// + [JsonPropertyName("int64Negative")] + public long? Int64Negative { get { return this.Int64NegativeOption; } set { this.Int64NegativeOption = new Option(value); } } + + /// + /// Used to track the state of Int64NegativeExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64NegativeExclusive + /// + [JsonPropertyName("int64NegativeExclusive")] + public long? Int64NegativeExclusive { get { return this.Int64NegativeExclusiveOption; } set { this.Int64NegativeExclusiveOption = new Option(value); } } + + /// + /// Used to track the state of Int64Positive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveOption { get; private set; } + + /// + /// Gets or Sets Int64Positive + /// + [JsonPropertyName("int64Positive")] + public long? Int64Positive { get { return this.Int64PositiveOption; } set { this.Int64PositiveOption = new Option(value); } } + + /// + /// Used to track the state of Int64PositiveExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64PositiveExclusive + /// + [JsonPropertyName("int64PositiveExclusive")] + public long? Int64PositiveExclusive { get { return this.Int64PositiveExclusiveOption; } set { this.Int64PositiveExclusiveOption = new Option(value); } } + /// /// Used to track the state of Integer /// @@ -327,7 +402,12 @@ namespace Org.OpenAPITools.Model sb.Append(" Double: ").Append(Double).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Int64Negative: ").Append(Int64Negative).Append("\n"); + sb.Append(" Int64NegativeExclusive: ").Append(Int64NegativeExclusive).Append("\n"); + sb.Append(" Int64Positive: ").Append(Int64Positive).Append("\n"); + sb.Append(" Int64PositiveExclusive: ").Append(Int64PositiveExclusive).Append("\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); @@ -408,6 +488,42 @@ namespace Org.OpenAPITools.Model yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // Int32Range (int) maximum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value > (int)2147483647) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value less than or equal to 2147483647.", new [] { "Int32Range" }); + } + + // Int32Range (int) minimum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value < (int)-2147483648) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value greater than or equal to -2147483648.", new [] { "Int32Range" }); + } + + // Int64Negative (long) maximum + if (this.Int64NegativeOption.IsSet && this.Int64NegativeOption.Value > (long)-2147483649) + { + yield return new ValidationResult("Invalid value for Int64Negative, must be a value less than or equal to -2147483649.", new [] { "Int64Negative" }); + } + + // Int64NegativeExclusive (long) maximum + if (this.Int64NegativeExclusiveOption.IsSet && this.Int64NegativeExclusiveOption.Value <= (long)-2147483648) + { + yield return new ValidationResult("Invalid value for Int64NegativeExclusive, must be a value less than -2147483648.", new [] { "Int64NegativeExclusive" }); + } + + // Int64Positive (long) minimum + if (this.Int64PositiveOption.IsSet && this.Int64PositiveOption.Value < (long)2147483648) + { + yield return new ValidationResult("Invalid value for Int64Positive, must be a value greater than or equal to 2147483648.", new [] { "Int64Positive" }); + } + + // Int64PositiveExclusive (long) minimum + if (this.Int64PositiveExclusiveOption.IsSet && this.Int64PositiveExclusiveOption.Value < (long)2147483647) + { + yield return new ValidationResult("Invalid value for Int64PositiveExclusive, must be a value greater than 2147483647.", new [] { "Int64PositiveExclusive" }); + } + // Integer (int) maximum if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) { @@ -518,7 +634,12 @@ namespace Org.OpenAPITools.Model Option varDouble = default; Option varFloat = 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; @@ -582,10 +703,30 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) int32 = new Option(utf8JsonReader.GetInt32()); break; + case "int32Range": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int32Range = new Option(utf8JsonReader.GetInt32()); + break; case "int64": if (utf8JsonReader.TokenType != JsonTokenType.Null) int64 = new Option(utf8JsonReader.GetInt64()); break; + case "int64Negative": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Negative = new Option(utf8JsonReader.GetInt32()); + break; + case "int64NegativeExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64Positive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Positive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64PositiveExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + break; case "integer": if (utf8JsonReader.TokenType != JsonTokenType.Null) integer = new Option(utf8JsonReader.GetInt32()); @@ -662,9 +803,24 @@ namespace Org.OpenAPITools.Model if (int32.IsSet && int32.Value == null) throw new ArgumentNullException(nameof(int32), "Property is not nullable for class FormatTest."); + if (int32Range.IsSet && int32Range.Value == null) + throw new ArgumentNullException(nameof(int32Range), "Property is not nullable for class FormatTest."); + if (int64.IsSet && int64.Value == null) throw new ArgumentNullException(nameof(int64), "Property is not nullable for class FormatTest."); + if (int64Negative.IsSet && int64Negative.Value == null) + throw new ArgumentNullException(nameof(int64Negative), "Property is not nullable for class FormatTest."); + + if (int64NegativeExclusive.IsSet && int64NegativeExclusive.Value == null) + throw new ArgumentNullException(nameof(int64NegativeExclusive), "Property is not nullable for class FormatTest."); + + if (int64Positive.IsSet && int64Positive.Value == null) + throw new ArgumentNullException(nameof(int64Positive), "Property is not nullable for class FormatTest."); + + if (int64PositiveExclusive.IsSet && int64PositiveExclusive.Value == null) + throw new ArgumentNullException(nameof(int64PositiveExclusive), "Property is not nullable for class FormatTest."); + if (integer.IsSet && integer.Value == null) throw new ArgumentNullException(nameof(integer), "Property is not nullable for class FormatTest."); @@ -689,7 +845,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, int64, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + 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); } /// @@ -767,9 +923,24 @@ namespace Org.OpenAPITools.Model if (formatTest.Int32Option.IsSet) writer.WriteNumber("int32", formatTest.Int32Option.Value.Value); + if (formatTest.Int32RangeOption.IsSet) + writer.WriteNumber("int32Range", formatTest.Int32RangeOption.Value.Value); + if (formatTest.Int64Option.IsSet) writer.WriteNumber("int64", formatTest.Int64Option.Value.Value); + if (formatTest.Int64NegativeOption.IsSet) + writer.WriteNumber("int64Negative", formatTest.Int64NegativeOption.Value.Value); + + if (formatTest.Int64NegativeExclusiveOption.IsSet) + writer.WriteNumber("int64NegativeExclusive", formatTest.Int64NegativeExclusiveOption.Value.Value); + + if (formatTest.Int64PositiveOption.IsSet) + writer.WriteNumber("int64Positive", formatTest.Int64PositiveOption.Value.Value); + + if (formatTest.Int64PositiveExclusiveOption.IsSet) + writer.WriteNumber("int64PositiveExclusive", formatTest.Int64PositiveExclusiveOption.Value.Value); + if (formatTest.IntegerOption.IsSet) writer.WriteNumber("integer", formatTest.IntegerOption.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 95cd969e02c..ced7c2c5db9 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 @@ -1617,6 +1617,24 @@ components: maximum: 200 minimum: 20 type: integer + int32Range: + maximum: 2147483647 + minimum: -2147483648 + type: integer + int64Positive: + minimum: 2147483648 + type: integer + int64Negative: + maximum: -2147483649 + type: integer + int64PositiveExclusive: + exclusiveMinimum: true + minimum: 2147483647 + type: integer + int64NegativeExclusive: + exclusiveMaximum: true + maximum: -2147483648 + type: integer unsigned_integer: format: int32 maximum: 200 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 0983002c5da..5983bc09690 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 @@ -14,7 +14,12 @@ Name | Type | Description | Notes **Double** | **double** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] +**Int32Range** | **int** | | [optional] **Int64** | **long** | | [optional] +**Int64Negative** | **long** | | [optional] +**Int64NegativeExclusive** | **long** | | [optional] +**Int64Positive** | **long** | | [optional] +**Int64PositiveExclusive** | **long** | | [optional] **Integer** | **int** | | [optional] **PatternWithBackslash** | **string** | None | [optional] **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [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 b658f317f1c..7dad1b08bc0 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 @@ -143,6 +143,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int32' } + /// + /// Test the property 'Int32Range' + /// + [Fact] + public void Int32RangeTest() + { + // TODO unit test for the property 'Int32Range' + } + /// /// Test the property 'Int64' /// @@ -152,6 +161,42 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int64' } + /// + /// Test the property 'Int64Negative' + /// + [Fact] + public void Int64NegativeTest() + { + // TODO unit test for the property 'Int64Negative' + } + + /// + /// Test the property 'Int64NegativeExclusive' + /// + [Fact] + public void Int64NegativeExclusiveTest() + { + // TODO unit test for the property 'Int64NegativeExclusive' + } + + /// + /// Test the property 'Int64Positive' + /// + [Fact] + public void Int64PositiveTest() + { + // TODO unit test for the property 'Int64Positive' + } + + /// + /// Test the property 'Int64PositiveExclusive' + /// + [Fact] + public void Int64PositiveExclusiveTest() + { + // TODO unit test for the property 'Int64PositiveExclusive' + } + /// /// Test the property 'Integer' /// diff --git a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index f0ab0b4ca0a..2303d5e4cc1 100644 --- a/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.7/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -4293,19 +4293,15 @@ namespace Org.OpenAPITools.Api System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); if (enumQueryStringArray.IsSet) - // here too parseQueryStringLocalVar["enum_query_string_array"] = ClientUtils.ParameterToString(enumQueryStringArray.Value); if (enumQueryDouble.IsSet) - // here too parseQueryStringLocalVar["enum_query_double"] = ClientUtils.ParameterToString(enumQueryDouble.Value); if (enumQueryInteger.IsSet) - // here too parseQueryStringLocalVar["enum_query_integer"] = ClientUtils.ParameterToString(enumQueryInteger.Value); if (enumQueryString.IsSet) - // here too parseQueryStringLocalVar["enum_query_string"] = ClientUtils.ParameterToString(enumQueryString.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -4542,11 +4538,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["required_int64_group"] = ClientUtils.ParameterToString(requiredInt64Group); if (stringGroup.IsSet) - // here too parseQueryStringLocalVar["string_group"] = ClientUtils.ParameterToString(stringGroup.Value); if (int64Group.IsSet) - // here too parseQueryStringLocalVar["int64_group"] = ClientUtils.ParameterToString(int64Group.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -5410,11 +5404,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["requiredNullable"] = ClientUtils.ParameterToString(requiredNullable); if (notRequiredNotNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNotNullable"] = ClientUtils.ParameterToString(notRequiredNotNullable.Value); if (notRequiredNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNullable"] = ClientUtils.ParameterToString(notRequiredNullable.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); 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 3fc88d4d403..9aa5ea7d327 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 @@ -42,7 +42,12 @@ namespace Org.OpenAPITools.Model /// double /// float /// int32 + /// int32Range /// int64 + /// int64Negative + /// int64NegativeExclusive + /// int64Positive + /// int64PositiveExclusive /// integer /// None /// A string that is a 10 digit number. Can have leading zeros. @@ -52,7 +57,7 @@ namespace Org.OpenAPITools.Model /// 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 int64 = 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, 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) { Byte = @byte; Date = date; @@ -64,7 +69,12 @@ namespace Org.OpenAPITools.Model DoubleOption = @double; FloatOption = @float; Int32Option = int32; + Int32RangeOption = int32Range; Int64Option = int64; + Int64NegativeOption = int64Negative; + Int64NegativeExclusiveOption = int64NegativeExclusive; + Int64PositiveOption = int64Positive; + Int64PositiveExclusiveOption = int64PositiveExclusive; IntegerOption = integer; PatternWithBackslashOption = patternWithBackslash; PatternWithDigitsOption = patternWithDigits; @@ -182,6 +192,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int32")] public int? Int32 { get { return this.Int32Option; } set { this.Int32Option = new Option(value); } } + /// + /// Used to track the state of Int32Range + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int32RangeOption { get; private set; } + + /// + /// Gets or Sets Int32Range + /// + [JsonPropertyName("int32Range")] + public int? Int32Range { get { return this.Int32RangeOption; } set { this.Int32RangeOption = new Option(value); } } + /// /// Used to track the state of Int64 /// @@ -195,6 +218,58 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int64")] public long? Int64 { get { return this.Int64Option; } set { this.Int64Option = new Option(value); } } + /// + /// Used to track the state of Int64Negative + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeOption { get; private set; } + + /// + /// Gets or Sets Int64Negative + /// + [JsonPropertyName("int64Negative")] + public long? Int64Negative { get { return this.Int64NegativeOption; } set { this.Int64NegativeOption = new Option(value); } } + + /// + /// Used to track the state of Int64NegativeExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64NegativeExclusive + /// + [JsonPropertyName("int64NegativeExclusive")] + public long? Int64NegativeExclusive { get { return this.Int64NegativeExclusiveOption; } set { this.Int64NegativeExclusiveOption = new Option(value); } } + + /// + /// Used to track the state of Int64Positive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveOption { get; private set; } + + /// + /// Gets or Sets Int64Positive + /// + [JsonPropertyName("int64Positive")] + public long? Int64Positive { get { return this.Int64PositiveOption; } set { this.Int64PositiveOption = new Option(value); } } + + /// + /// Used to track the state of Int64PositiveExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64PositiveExclusive + /// + [JsonPropertyName("int64PositiveExclusive")] + public long? Int64PositiveExclusive { get { return this.Int64PositiveExclusiveOption; } set { this.Int64PositiveExclusiveOption = new Option(value); } } + /// /// Used to track the state of Integer /// @@ -327,7 +402,12 @@ namespace Org.OpenAPITools.Model sb.Append(" Double: ").Append(Double).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Int64Negative: ").Append(Int64Negative).Append("\n"); + sb.Append(" Int64NegativeExclusive: ").Append(Int64NegativeExclusive).Append("\n"); + sb.Append(" Int64Positive: ").Append(Int64Positive).Append("\n"); + sb.Append(" Int64PositiveExclusive: ").Append(Int64PositiveExclusive).Append("\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); @@ -408,6 +488,42 @@ namespace Org.OpenAPITools.Model yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // Int32Range (int) maximum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value > (int)2147483647) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value less than or equal to 2147483647.", new [] { "Int32Range" }); + } + + // Int32Range (int) minimum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value < (int)-2147483648) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value greater than or equal to -2147483648.", new [] { "Int32Range" }); + } + + // Int64Negative (long) maximum + if (this.Int64NegativeOption.IsSet && this.Int64NegativeOption.Value > (long)-2147483649) + { + yield return new ValidationResult("Invalid value for Int64Negative, must be a value less than or equal to -2147483649.", new [] { "Int64Negative" }); + } + + // Int64NegativeExclusive (long) maximum + if (this.Int64NegativeExclusiveOption.IsSet && this.Int64NegativeExclusiveOption.Value <= (long)-2147483648) + { + yield return new ValidationResult("Invalid value for Int64NegativeExclusive, must be a value less than -2147483648.", new [] { "Int64NegativeExclusive" }); + } + + // Int64Positive (long) minimum + if (this.Int64PositiveOption.IsSet && this.Int64PositiveOption.Value < (long)2147483648) + { + yield return new ValidationResult("Invalid value for Int64Positive, must be a value greater than or equal to 2147483648.", new [] { "Int64Positive" }); + } + + // Int64PositiveExclusive (long) minimum + if (this.Int64PositiveExclusiveOption.IsSet && this.Int64PositiveExclusiveOption.Value < (long)2147483647) + { + yield return new ValidationResult("Invalid value for Int64PositiveExclusive, must be a value greater than 2147483647.", new [] { "Int64PositiveExclusive" }); + } + // Integer (int) maximum if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) { @@ -518,7 +634,12 @@ namespace Org.OpenAPITools.Model Option varDouble = default; Option varFloat = 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; @@ -582,10 +703,30 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) int32 = new Option(utf8JsonReader.GetInt32()); break; + case "int32Range": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int32Range = new Option(utf8JsonReader.GetInt32()); + break; case "int64": if (utf8JsonReader.TokenType != JsonTokenType.Null) int64 = new Option(utf8JsonReader.GetInt64()); break; + case "int64Negative": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Negative = new Option(utf8JsonReader.GetInt32()); + break; + case "int64NegativeExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64Positive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Positive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64PositiveExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + break; case "integer": if (utf8JsonReader.TokenType != JsonTokenType.Null) integer = new Option(utf8JsonReader.GetInt32()); @@ -662,9 +803,24 @@ namespace Org.OpenAPITools.Model if (int32.IsSet && int32.Value == null) throw new ArgumentNullException(nameof(int32), "Property is not nullable for class FormatTest."); + if (int32Range.IsSet && int32Range.Value == null) + throw new ArgumentNullException(nameof(int32Range), "Property is not nullable for class FormatTest."); + if (int64.IsSet && int64.Value == null) throw new ArgumentNullException(nameof(int64), "Property is not nullable for class FormatTest."); + if (int64Negative.IsSet && int64Negative.Value == null) + throw new ArgumentNullException(nameof(int64Negative), "Property is not nullable for class FormatTest."); + + if (int64NegativeExclusive.IsSet && int64NegativeExclusive.Value == null) + throw new ArgumentNullException(nameof(int64NegativeExclusive), "Property is not nullable for class FormatTest."); + + if (int64Positive.IsSet && int64Positive.Value == null) + throw new ArgumentNullException(nameof(int64Positive), "Property is not nullable for class FormatTest."); + + if (int64PositiveExclusive.IsSet && int64PositiveExclusive.Value == null) + throw new ArgumentNullException(nameof(int64PositiveExclusive), "Property is not nullable for class FormatTest."); + if (integer.IsSet && integer.Value == null) throw new ArgumentNullException(nameof(integer), "Property is not nullable for class FormatTest."); @@ -689,7 +845,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, int64, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + 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); } /// @@ -767,9 +923,24 @@ namespace Org.OpenAPITools.Model if (formatTest.Int32Option.IsSet) writer.WriteNumber("int32", formatTest.Int32Option.Value.Value); + if (formatTest.Int32RangeOption.IsSet) + writer.WriteNumber("int32Range", formatTest.Int32RangeOption.Value.Value); + if (formatTest.Int64Option.IsSet) writer.WriteNumber("int64", formatTest.Int64Option.Value.Value); + if (formatTest.Int64NegativeOption.IsSet) + writer.WriteNumber("int64Negative", formatTest.Int64NegativeOption.Value.Value); + + if (formatTest.Int64NegativeExclusiveOption.IsSet) + writer.WriteNumber("int64NegativeExclusive", formatTest.Int64NegativeExclusiveOption.Value.Value); + + if (formatTest.Int64PositiveOption.IsSet) + writer.WriteNumber("int64Positive", formatTest.Int64PositiveOption.Value.Value); + + if (formatTest.Int64PositiveExclusiveOption.IsSet) + writer.WriteNumber("int64PositiveExclusive", formatTest.Int64PositiveExclusiveOption.Value.Value); + if (formatTest.IntegerOption.IsSet) writer.WriteNumber("integer", formatTest.IntegerOption.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 0143839cb66..915be7ae8ba 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 @@ -1576,6 +1576,24 @@ components: maximum: 200 minimum: 20 type: integer + int32Range: + maximum: 2147483647 + minimum: -2147483648 + type: integer + int64Positive: + minimum: 2147483648 + type: integer + int64Negative: + maximum: -2147483649 + type: integer + int64PositiveExclusive: + exclusiveMinimum: true + minimum: 2147483647 + type: integer + int64NegativeExclusive: + exclusiveMaximum: true + maximum: -2147483648 + type: integer unsigned_integer: format: int32 maximum: 200 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 0983002c5da..5983bc09690 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 @@ -14,7 +14,12 @@ Name | Type | Description | Notes **Double** | **double** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] +**Int32Range** | **int** | | [optional] **Int64** | **long** | | [optional] +**Int64Negative** | **long** | | [optional] +**Int64NegativeExclusive** | **long** | | [optional] +**Int64Positive** | **long** | | [optional] +**Int64PositiveExclusive** | **long** | | [optional] **Integer** | **int** | | [optional] **PatternWithBackslash** | **string** | None | [optional] **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [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 b658f317f1c..7dad1b08bc0 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 @@ -143,6 +143,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int32' } + /// + /// Test the property 'Int32Range' + /// + [Fact] + public void Int32RangeTest() + { + // TODO unit test for the property 'Int32Range' + } + /// /// Test the property 'Int64' /// @@ -152,6 +161,42 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int64' } + /// + /// Test the property 'Int64Negative' + /// + [Fact] + public void Int64NegativeTest() + { + // TODO unit test for the property 'Int64Negative' + } + + /// + /// Test the property 'Int64NegativeExclusive' + /// + [Fact] + public void Int64NegativeExclusiveTest() + { + // TODO unit test for the property 'Int64NegativeExclusive' + } + + /// + /// Test the property 'Int64Positive' + /// + [Fact] + public void Int64PositiveTest() + { + // TODO unit test for the property 'Int64Positive' + } + + /// + /// Test the property 'Int64PositiveExclusive' + /// + [Fact] + public void Int64PositiveExclusiveTest() + { + // TODO unit test for the property 'Int64PositiveExclusive' + } + /// /// Test the property 'Integer' /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs index 01eeeb00511..6ad90eba93c 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs @@ -4281,19 +4281,15 @@ namespace Org.OpenAPITools.Api System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); if (enumQueryStringArray.IsSet) - // here too parseQueryStringLocalVar["enum_query_string_array"] = ClientUtils.ParameterToString(enumQueryStringArray.Value); if (enumQueryString.IsSet) - // here too parseQueryStringLocalVar["enum_query_string"] = ClientUtils.ParameterToString(enumQueryString.Value); if (enumQueryDouble.IsSet) - // here too parseQueryStringLocalVar["enum_query_double"] = ClientUtils.ParameterToString(enumQueryDouble.Value); if (enumQueryInteger.IsSet) - // here too parseQueryStringLocalVar["enum_query_integer"] = ClientUtils.ParameterToString(enumQueryInteger.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -4530,11 +4526,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["required_int64_group"] = ClientUtils.ParameterToString(requiredInt64Group); if (stringGroup.IsSet) - // here too parseQueryStringLocalVar["string_group"] = ClientUtils.ParameterToString(stringGroup.Value); if (int64Group.IsSet) - // here too parseQueryStringLocalVar["int64_group"] = ClientUtils.ParameterToString(int64Group.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -5398,11 +5392,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["requiredNullable"] = ClientUtils.ParameterToString(requiredNullable); if (notRequiredNotNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNotNullable"] = ClientUtils.ParameterToString(notRequiredNotNullable.Value); if (notRequiredNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNullable"] = ClientUtils.ParameterToString(notRequiredNullable.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); 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 3fc88d4d403..9aa5ea7d327 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 @@ -42,7 +42,12 @@ namespace Org.OpenAPITools.Model /// double /// float /// int32 + /// int32Range /// int64 + /// int64Negative + /// int64NegativeExclusive + /// int64Positive + /// int64PositiveExclusive /// integer /// None /// A string that is a 10 digit number. Can have leading zeros. @@ -52,7 +57,7 @@ namespace Org.OpenAPITools.Model /// 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 int64 = 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, 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) { Byte = @byte; Date = date; @@ -64,7 +69,12 @@ namespace Org.OpenAPITools.Model DoubleOption = @double; FloatOption = @float; Int32Option = int32; + Int32RangeOption = int32Range; Int64Option = int64; + Int64NegativeOption = int64Negative; + Int64NegativeExclusiveOption = int64NegativeExclusive; + Int64PositiveOption = int64Positive; + Int64PositiveExclusiveOption = int64PositiveExclusive; IntegerOption = integer; PatternWithBackslashOption = patternWithBackslash; PatternWithDigitsOption = patternWithDigits; @@ -182,6 +192,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int32")] public int? Int32 { get { return this.Int32Option; } set { this.Int32Option = new Option(value); } } + /// + /// Used to track the state of Int32Range + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int32RangeOption { get; private set; } + + /// + /// Gets or Sets Int32Range + /// + [JsonPropertyName("int32Range")] + public int? Int32Range { get { return this.Int32RangeOption; } set { this.Int32RangeOption = new Option(value); } } + /// /// Used to track the state of Int64 /// @@ -195,6 +218,58 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int64")] public long? Int64 { get { return this.Int64Option; } set { this.Int64Option = new Option(value); } } + /// + /// Used to track the state of Int64Negative + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeOption { get; private set; } + + /// + /// Gets or Sets Int64Negative + /// + [JsonPropertyName("int64Negative")] + public long? Int64Negative { get { return this.Int64NegativeOption; } set { this.Int64NegativeOption = new Option(value); } } + + /// + /// Used to track the state of Int64NegativeExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64NegativeExclusive + /// + [JsonPropertyName("int64NegativeExclusive")] + public long? Int64NegativeExclusive { get { return this.Int64NegativeExclusiveOption; } set { this.Int64NegativeExclusiveOption = new Option(value); } } + + /// + /// Used to track the state of Int64Positive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveOption { get; private set; } + + /// + /// Gets or Sets Int64Positive + /// + [JsonPropertyName("int64Positive")] + public long? Int64Positive { get { return this.Int64PositiveOption; } set { this.Int64PositiveOption = new Option(value); } } + + /// + /// Used to track the state of Int64PositiveExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64PositiveExclusive + /// + [JsonPropertyName("int64PositiveExclusive")] + public long? Int64PositiveExclusive { get { return this.Int64PositiveExclusiveOption; } set { this.Int64PositiveExclusiveOption = new Option(value); } } + /// /// Used to track the state of Integer /// @@ -327,7 +402,12 @@ namespace Org.OpenAPITools.Model sb.Append(" Double: ").Append(Double).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Int64Negative: ").Append(Int64Negative).Append("\n"); + sb.Append(" Int64NegativeExclusive: ").Append(Int64NegativeExclusive).Append("\n"); + sb.Append(" Int64Positive: ").Append(Int64Positive).Append("\n"); + sb.Append(" Int64PositiveExclusive: ").Append(Int64PositiveExclusive).Append("\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); @@ -408,6 +488,42 @@ namespace Org.OpenAPITools.Model yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // Int32Range (int) maximum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value > (int)2147483647) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value less than or equal to 2147483647.", new [] { "Int32Range" }); + } + + // Int32Range (int) minimum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value < (int)-2147483648) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value greater than or equal to -2147483648.", new [] { "Int32Range" }); + } + + // Int64Negative (long) maximum + if (this.Int64NegativeOption.IsSet && this.Int64NegativeOption.Value > (long)-2147483649) + { + yield return new ValidationResult("Invalid value for Int64Negative, must be a value less than or equal to -2147483649.", new [] { "Int64Negative" }); + } + + // Int64NegativeExclusive (long) maximum + if (this.Int64NegativeExclusiveOption.IsSet && this.Int64NegativeExclusiveOption.Value <= (long)-2147483648) + { + yield return new ValidationResult("Invalid value for Int64NegativeExclusive, must be a value less than -2147483648.", new [] { "Int64NegativeExclusive" }); + } + + // Int64Positive (long) minimum + if (this.Int64PositiveOption.IsSet && this.Int64PositiveOption.Value < (long)2147483648) + { + yield return new ValidationResult("Invalid value for Int64Positive, must be a value greater than or equal to 2147483648.", new [] { "Int64Positive" }); + } + + // Int64PositiveExclusive (long) minimum + if (this.Int64PositiveExclusiveOption.IsSet && this.Int64PositiveExclusiveOption.Value < (long)2147483647) + { + yield return new ValidationResult("Invalid value for Int64PositiveExclusive, must be a value greater than 2147483647.", new [] { "Int64PositiveExclusive" }); + } + // Integer (int) maximum if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) { @@ -518,7 +634,12 @@ namespace Org.OpenAPITools.Model Option varDouble = default; Option varFloat = 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; @@ -582,10 +703,30 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) int32 = new Option(utf8JsonReader.GetInt32()); break; + case "int32Range": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int32Range = new Option(utf8JsonReader.GetInt32()); + break; case "int64": if (utf8JsonReader.TokenType != JsonTokenType.Null) int64 = new Option(utf8JsonReader.GetInt64()); break; + case "int64Negative": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Negative = new Option(utf8JsonReader.GetInt32()); + break; + case "int64NegativeExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64Positive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Positive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64PositiveExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + break; case "integer": if (utf8JsonReader.TokenType != JsonTokenType.Null) integer = new Option(utf8JsonReader.GetInt32()); @@ -662,9 +803,24 @@ namespace Org.OpenAPITools.Model if (int32.IsSet && int32.Value == null) throw new ArgumentNullException(nameof(int32), "Property is not nullable for class FormatTest."); + if (int32Range.IsSet && int32Range.Value == null) + throw new ArgumentNullException(nameof(int32Range), "Property is not nullable for class FormatTest."); + if (int64.IsSet && int64.Value == null) throw new ArgumentNullException(nameof(int64), "Property is not nullable for class FormatTest."); + if (int64Negative.IsSet && int64Negative.Value == null) + throw new ArgumentNullException(nameof(int64Negative), "Property is not nullable for class FormatTest."); + + if (int64NegativeExclusive.IsSet && int64NegativeExclusive.Value == null) + throw new ArgumentNullException(nameof(int64NegativeExclusive), "Property is not nullable for class FormatTest."); + + if (int64Positive.IsSet && int64Positive.Value == null) + throw new ArgumentNullException(nameof(int64Positive), "Property is not nullable for class FormatTest."); + + if (int64PositiveExclusive.IsSet && int64PositiveExclusive.Value == null) + throw new ArgumentNullException(nameof(int64PositiveExclusive), "Property is not nullable for class FormatTest."); + if (integer.IsSet && integer.Value == null) throw new ArgumentNullException(nameof(integer), "Property is not nullable for class FormatTest."); @@ -689,7 +845,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, int64, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + 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); } /// @@ -767,9 +923,24 @@ namespace Org.OpenAPITools.Model if (formatTest.Int32Option.IsSet) writer.WriteNumber("int32", formatTest.Int32Option.Value.Value); + if (formatTest.Int32RangeOption.IsSet) + writer.WriteNumber("int32Range", formatTest.Int32RangeOption.Value.Value); + if (formatTest.Int64Option.IsSet) writer.WriteNumber("int64", formatTest.Int64Option.Value.Value); + if (formatTest.Int64NegativeOption.IsSet) + writer.WriteNumber("int64Negative", formatTest.Int64NegativeOption.Value.Value); + + if (formatTest.Int64NegativeExclusiveOption.IsSet) + writer.WriteNumber("int64NegativeExclusive", formatTest.Int64NegativeExclusiveOption.Value.Value); + + if (formatTest.Int64PositiveOption.IsSet) + writer.WriteNumber("int64Positive", formatTest.Int64PositiveOption.Value.Value); + + if (formatTest.Int64PositiveExclusiveOption.IsSet) + writer.WriteNumber("int64PositiveExclusive", formatTest.Int64PositiveExclusiveOption.Value.Value); + if (formatTest.IntegerOption.IsSet) writer.WriteNumber("integer", formatTest.IntegerOption.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 95cd969e02c..ced7c2c5db9 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 @@ -1617,6 +1617,24 @@ components: maximum: 200 minimum: 20 type: integer + int32Range: + maximum: 2147483647 + minimum: -2147483648 + type: integer + int64Positive: + minimum: 2147483648 + type: integer + int64Negative: + maximum: -2147483649 + type: integer + int64PositiveExclusive: + exclusiveMinimum: true + minimum: 2147483647 + type: integer + int64NegativeExclusive: + exclusiveMaximum: true + maximum: -2147483648 + type: integer unsigned_integer: format: int32 maximum: 200 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 0983002c5da..5983bc09690 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 @@ -14,7 +14,12 @@ Name | Type | Description | Notes **Double** | **double** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] +**Int32Range** | **int** | | [optional] **Int64** | **long** | | [optional] +**Int64Negative** | **long** | | [optional] +**Int64NegativeExclusive** | **long** | | [optional] +**Int64Positive** | **long** | | [optional] +**Int64PositiveExclusive** | **long** | | [optional] **Integer** | **int** | | [optional] **PatternWithBackslash** | **string** | None | [optional] **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [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 b658f317f1c..7dad1b08bc0 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 @@ -143,6 +143,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int32' } + /// + /// Test the property 'Int32Range' + /// + [Fact] + public void Int32RangeTest() + { + // TODO unit test for the property 'Int32Range' + } + /// /// Test the property 'Int64' /// @@ -152,6 +161,42 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int64' } + /// + /// Test the property 'Int64Negative' + /// + [Fact] + public void Int64NegativeTest() + { + // TODO unit test for the property 'Int64Negative' + } + + /// + /// Test the property 'Int64NegativeExclusive' + /// + [Fact] + public void Int64NegativeExclusiveTest() + { + // TODO unit test for the property 'Int64NegativeExclusive' + } + + /// + /// Test the property 'Int64Positive' + /// + [Fact] + public void Int64PositiveTest() + { + // TODO unit test for the property 'Int64Positive' + } + + /// + /// Test the property 'Int64PositiveExclusive' + /// + [Fact] + public void Int64PositiveExclusiveTest() + { + // TODO unit test for the property 'Int64PositiveExclusive' + } + /// /// Test the property 'Integer' /// diff --git a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index f0ab0b4ca0a..2303d5e4cc1 100644 --- a/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net4.8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -4293,19 +4293,15 @@ namespace Org.OpenAPITools.Api System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); if (enumQueryStringArray.IsSet) - // here too parseQueryStringLocalVar["enum_query_string_array"] = ClientUtils.ParameterToString(enumQueryStringArray.Value); if (enumQueryDouble.IsSet) - // here too parseQueryStringLocalVar["enum_query_double"] = ClientUtils.ParameterToString(enumQueryDouble.Value); if (enumQueryInteger.IsSet) - // here too parseQueryStringLocalVar["enum_query_integer"] = ClientUtils.ParameterToString(enumQueryInteger.Value); if (enumQueryString.IsSet) - // here too parseQueryStringLocalVar["enum_query_string"] = ClientUtils.ParameterToString(enumQueryString.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -4542,11 +4538,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["required_int64_group"] = ClientUtils.ParameterToString(requiredInt64Group); if (stringGroup.IsSet) - // here too parseQueryStringLocalVar["string_group"] = ClientUtils.ParameterToString(stringGroup.Value); if (int64Group.IsSet) - // here too parseQueryStringLocalVar["int64_group"] = ClientUtils.ParameterToString(int64Group.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -5410,11 +5404,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["requiredNullable"] = ClientUtils.ParameterToString(requiredNullable); if (notRequiredNotNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNotNullable"] = ClientUtils.ParameterToString(notRequiredNotNullable.Value); if (notRequiredNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNullable"] = ClientUtils.ParameterToString(notRequiredNullable.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); 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 3fc88d4d403..9aa5ea7d327 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 @@ -42,7 +42,12 @@ namespace Org.OpenAPITools.Model /// double /// float /// int32 + /// int32Range /// int64 + /// int64Negative + /// int64NegativeExclusive + /// int64Positive + /// int64PositiveExclusive /// integer /// None /// A string that is a 10 digit number. Can have leading zeros. @@ -52,7 +57,7 @@ namespace Org.OpenAPITools.Model /// 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 int64 = 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, 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) { Byte = @byte; Date = date; @@ -64,7 +69,12 @@ namespace Org.OpenAPITools.Model DoubleOption = @double; FloatOption = @float; Int32Option = int32; + Int32RangeOption = int32Range; Int64Option = int64; + Int64NegativeOption = int64Negative; + Int64NegativeExclusiveOption = int64NegativeExclusive; + Int64PositiveOption = int64Positive; + Int64PositiveExclusiveOption = int64PositiveExclusive; IntegerOption = integer; PatternWithBackslashOption = patternWithBackslash; PatternWithDigitsOption = patternWithDigits; @@ -182,6 +192,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int32")] public int? Int32 { get { return this.Int32Option; } set { this.Int32Option = new Option(value); } } + /// + /// Used to track the state of Int32Range + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int32RangeOption { get; private set; } + + /// + /// Gets or Sets Int32Range + /// + [JsonPropertyName("int32Range")] + public int? Int32Range { get { return this.Int32RangeOption; } set { this.Int32RangeOption = new Option(value); } } + /// /// Used to track the state of Int64 /// @@ -195,6 +218,58 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int64")] public long? Int64 { get { return this.Int64Option; } set { this.Int64Option = new Option(value); } } + /// + /// Used to track the state of Int64Negative + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeOption { get; private set; } + + /// + /// Gets or Sets Int64Negative + /// + [JsonPropertyName("int64Negative")] + public long? Int64Negative { get { return this.Int64NegativeOption; } set { this.Int64NegativeOption = new Option(value); } } + + /// + /// Used to track the state of Int64NegativeExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64NegativeExclusive + /// + [JsonPropertyName("int64NegativeExclusive")] + public long? Int64NegativeExclusive { get { return this.Int64NegativeExclusiveOption; } set { this.Int64NegativeExclusiveOption = new Option(value); } } + + /// + /// Used to track the state of Int64Positive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveOption { get; private set; } + + /// + /// Gets or Sets Int64Positive + /// + [JsonPropertyName("int64Positive")] + public long? Int64Positive { get { return this.Int64PositiveOption; } set { this.Int64PositiveOption = new Option(value); } } + + /// + /// Used to track the state of Int64PositiveExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64PositiveExclusive + /// + [JsonPropertyName("int64PositiveExclusive")] + public long? Int64PositiveExclusive { get { return this.Int64PositiveExclusiveOption; } set { this.Int64PositiveExclusiveOption = new Option(value); } } + /// /// Used to track the state of Integer /// @@ -327,7 +402,12 @@ namespace Org.OpenAPITools.Model sb.Append(" Double: ").Append(Double).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Int64Negative: ").Append(Int64Negative).Append("\n"); + sb.Append(" Int64NegativeExclusive: ").Append(Int64NegativeExclusive).Append("\n"); + sb.Append(" Int64Positive: ").Append(Int64Positive).Append("\n"); + sb.Append(" Int64PositiveExclusive: ").Append(Int64PositiveExclusive).Append("\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); @@ -408,6 +488,42 @@ namespace Org.OpenAPITools.Model yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // Int32Range (int) maximum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value > (int)2147483647) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value less than or equal to 2147483647.", new [] { "Int32Range" }); + } + + // Int32Range (int) minimum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value < (int)-2147483648) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value greater than or equal to -2147483648.", new [] { "Int32Range" }); + } + + // Int64Negative (long) maximum + if (this.Int64NegativeOption.IsSet && this.Int64NegativeOption.Value > (long)-2147483649) + { + yield return new ValidationResult("Invalid value for Int64Negative, must be a value less than or equal to -2147483649.", new [] { "Int64Negative" }); + } + + // Int64NegativeExclusive (long) maximum + if (this.Int64NegativeExclusiveOption.IsSet && this.Int64NegativeExclusiveOption.Value <= (long)-2147483648) + { + yield return new ValidationResult("Invalid value for Int64NegativeExclusive, must be a value less than -2147483648.", new [] { "Int64NegativeExclusive" }); + } + + // Int64Positive (long) minimum + if (this.Int64PositiveOption.IsSet && this.Int64PositiveOption.Value < (long)2147483648) + { + yield return new ValidationResult("Invalid value for Int64Positive, must be a value greater than or equal to 2147483648.", new [] { "Int64Positive" }); + } + + // Int64PositiveExclusive (long) minimum + if (this.Int64PositiveExclusiveOption.IsSet && this.Int64PositiveExclusiveOption.Value < (long)2147483647) + { + yield return new ValidationResult("Invalid value for Int64PositiveExclusive, must be a value greater than 2147483647.", new [] { "Int64PositiveExclusive" }); + } + // Integer (int) maximum if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) { @@ -518,7 +634,12 @@ namespace Org.OpenAPITools.Model Option varDouble = default; Option varFloat = 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; @@ -582,10 +703,30 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) int32 = new Option(utf8JsonReader.GetInt32()); break; + case "int32Range": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int32Range = new Option(utf8JsonReader.GetInt32()); + break; case "int64": if (utf8JsonReader.TokenType != JsonTokenType.Null) int64 = new Option(utf8JsonReader.GetInt64()); break; + case "int64Negative": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Negative = new Option(utf8JsonReader.GetInt32()); + break; + case "int64NegativeExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64Positive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Positive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64PositiveExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + break; case "integer": if (utf8JsonReader.TokenType != JsonTokenType.Null) integer = new Option(utf8JsonReader.GetInt32()); @@ -662,9 +803,24 @@ namespace Org.OpenAPITools.Model if (int32.IsSet && int32.Value == null) throw new ArgumentNullException(nameof(int32), "Property is not nullable for class FormatTest."); + if (int32Range.IsSet && int32Range.Value == null) + throw new ArgumentNullException(nameof(int32Range), "Property is not nullable for class FormatTest."); + if (int64.IsSet && int64.Value == null) throw new ArgumentNullException(nameof(int64), "Property is not nullable for class FormatTest."); + if (int64Negative.IsSet && int64Negative.Value == null) + throw new ArgumentNullException(nameof(int64Negative), "Property is not nullable for class FormatTest."); + + if (int64NegativeExclusive.IsSet && int64NegativeExclusive.Value == null) + throw new ArgumentNullException(nameof(int64NegativeExclusive), "Property is not nullable for class FormatTest."); + + if (int64Positive.IsSet && int64Positive.Value == null) + throw new ArgumentNullException(nameof(int64Positive), "Property is not nullable for class FormatTest."); + + if (int64PositiveExclusive.IsSet && int64PositiveExclusive.Value == null) + throw new ArgumentNullException(nameof(int64PositiveExclusive), "Property is not nullable for class FormatTest."); + if (integer.IsSet && integer.Value == null) throw new ArgumentNullException(nameof(integer), "Property is not nullable for class FormatTest."); @@ -689,7 +845,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, int64, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + 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); } /// @@ -767,9 +923,24 @@ namespace Org.OpenAPITools.Model if (formatTest.Int32Option.IsSet) writer.WriteNumber("int32", formatTest.Int32Option.Value.Value); + if (formatTest.Int32RangeOption.IsSet) + writer.WriteNumber("int32Range", formatTest.Int32RangeOption.Value.Value); + if (formatTest.Int64Option.IsSet) writer.WriteNumber("int64", formatTest.Int64Option.Value.Value); + if (formatTest.Int64NegativeOption.IsSet) + writer.WriteNumber("int64Negative", formatTest.Int64NegativeOption.Value.Value); + + if (formatTest.Int64NegativeExclusiveOption.IsSet) + writer.WriteNumber("int64NegativeExclusive", formatTest.Int64NegativeExclusiveOption.Value.Value); + + if (formatTest.Int64PositiveOption.IsSet) + writer.WriteNumber("int64Positive", formatTest.Int64PositiveOption.Value.Value); + + if (formatTest.Int64PositiveExclusiveOption.IsSet) + writer.WriteNumber("int64PositiveExclusive", formatTest.Int64PositiveExclusiveOption.Value.Value); + if (formatTest.IntegerOption.IsSet) writer.WriteNumber("integer", formatTest.IntegerOption.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 0143839cb66..915be7ae8ba 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml @@ -1576,6 +1576,24 @@ components: maximum: 200 minimum: 20 type: integer + int32Range: + maximum: 2147483647 + minimum: -2147483648 + type: integer + int64Positive: + minimum: 2147483648 + type: integer + int64Negative: + maximum: -2147483649 + type: integer + int64PositiveExclusive: + exclusiveMinimum: true + minimum: 2147483647 + type: integer + int64NegativeExclusive: + exclusiveMaximum: true + maximum: -2147483648 + type: integer unsigned_integer: format: int32 maximum: 200 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 fec6adcefdf..1009f35198f 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 @@ -14,7 +14,12 @@ Name | Type | Description | Notes **Double** | **double** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] +**Int32Range** | **int** | | [optional] **Int64** | **long** | | [optional] +**Int64Negative** | **long** | | [optional] +**Int64NegativeExclusive** | **long** | | [optional] +**Int64Positive** | **long** | | [optional] +**Int64PositiveExclusive** | **long** | | [optional] **Integer** | **int** | | [optional] **PatternWithBackslash** | **string** | None | [optional] **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [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 b658f317f1c..7dad1b08bc0 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 @@ -143,6 +143,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int32' } + /// + /// Test the property 'Int32Range' + /// + [Fact] + public void Int32RangeTest() + { + // TODO unit test for the property 'Int32Range' + } + /// /// Test the property 'Int64' /// @@ -152,6 +161,42 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int64' } + /// + /// Test the property 'Int64Negative' + /// + [Fact] + public void Int64NegativeTest() + { + // TODO unit test for the property 'Int64Negative' + } + + /// + /// Test the property 'Int64NegativeExclusive' + /// + [Fact] + public void Int64NegativeExclusiveTest() + { + // TODO unit test for the property 'Int64NegativeExclusive' + } + + /// + /// Test the property 'Int64Positive' + /// + [Fact] + public void Int64PositiveTest() + { + // TODO unit test for the property 'Int64Positive' + } + + /// + /// Test the property 'Int64PositiveExclusive' + /// + [Fact] + public void Int64PositiveExclusiveTest() + { + // TODO unit test for the property 'Int64PositiveExclusive' + } + /// /// Test the property 'Integer' /// diff --git a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs index 0dc06a0c06e..1af73803f88 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/src/Org.OpenAPITools/Api/FakeApi.cs @@ -4290,19 +4290,15 @@ namespace Org.OpenAPITools.Api System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); if (enumQueryStringArray.IsSet) - // here too parseQueryStringLocalVar["enum_query_string_array"] = ClientUtils.ParameterToString(enumQueryStringArray.Value); if (enumQueryString.IsSet) - // here too parseQueryStringLocalVar["enum_query_string"] = ClientUtils.ParameterToString(enumQueryString.Value); if (enumQueryDouble.IsSet) - // here too parseQueryStringLocalVar["enum_query_double"] = ClientUtils.ParameterToString(enumQueryDouble.Value); if (enumQueryInteger.IsSet) - // here too parseQueryStringLocalVar["enum_query_integer"] = ClientUtils.ParameterToString(enumQueryInteger.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -4539,11 +4535,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["required_int64_group"] = ClientUtils.ParameterToString(requiredInt64Group); if (stringGroup.IsSet) - // here too parseQueryStringLocalVar["string_group"] = ClientUtils.ParameterToString(stringGroup.Value); if (int64Group.IsSet) - // here too parseQueryStringLocalVar["int64_group"] = ClientUtils.ParameterToString(int64Group.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -5408,11 +5402,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["requiredNullable"] = ClientUtils.ParameterToString(requiredNullable); if (notRequiredNotNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNotNullable"] = ClientUtils.ParameterToString(notRequiredNotNullable.Value); if (notRequiredNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNullable"] = ClientUtils.ParameterToString(notRequiredNullable.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); 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 9113c366efe..91aea77dbdf 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 @@ -42,7 +42,12 @@ namespace Org.OpenAPITools.Model /// double /// float /// int32 + /// int32Range /// int64 + /// int64Negative + /// int64NegativeExclusive + /// int64Positive + /// int64PositiveExclusive /// integer /// None /// A string that is a 10 digit number. Can have leading zeros. @@ -52,7 +57,7 @@ namespace Org.OpenAPITools.Model /// 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 int64 = 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, 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) { Byte = @byte; Date = date; @@ -64,7 +69,12 @@ namespace Org.OpenAPITools.Model DoubleOption = @double; FloatOption = @float; Int32Option = int32; + Int32RangeOption = int32Range; Int64Option = int64; + Int64NegativeOption = int64Negative; + Int64NegativeExclusiveOption = int64NegativeExclusive; + Int64PositiveOption = int64Positive; + Int64PositiveExclusiveOption = int64PositiveExclusive; IntegerOption = integer; PatternWithBackslashOption = patternWithBackslash; PatternWithDigitsOption = patternWithDigits; @@ -182,6 +192,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int32")] public int? Int32 { get { return this.Int32Option; } set { this.Int32Option = new(value); } } + /// + /// Used to track the state of Int32Range + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int32RangeOption { get; private set; } + + /// + /// Gets or Sets Int32Range + /// + [JsonPropertyName("int32Range")] + public int? Int32Range { get { return this.Int32RangeOption; } set { this.Int32RangeOption = new(value); } } + /// /// Used to track the state of Int64 /// @@ -195,6 +218,58 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int64")] public long? Int64 { get { return this.Int64Option; } set { this.Int64Option = new(value); } } + /// + /// Used to track the state of Int64Negative + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeOption { get; private set; } + + /// + /// Gets or Sets Int64Negative + /// + [JsonPropertyName("int64Negative")] + public long? Int64Negative { get { return this.Int64NegativeOption; } set { this.Int64NegativeOption = new(value); } } + + /// + /// Used to track the state of Int64NegativeExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64NegativeExclusive + /// + [JsonPropertyName("int64NegativeExclusive")] + public long? Int64NegativeExclusive { get { return this.Int64NegativeExclusiveOption; } set { this.Int64NegativeExclusiveOption = new(value); } } + + /// + /// Used to track the state of Int64Positive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveOption { get; private set; } + + /// + /// Gets or Sets Int64Positive + /// + [JsonPropertyName("int64Positive")] + public long? Int64Positive { get { return this.Int64PositiveOption; } set { this.Int64PositiveOption = new(value); } } + + /// + /// Used to track the state of Int64PositiveExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64PositiveExclusive + /// + [JsonPropertyName("int64PositiveExclusive")] + public long? Int64PositiveExclusive { get { return this.Int64PositiveExclusiveOption; } set { this.Int64PositiveExclusiveOption = new(value); } } + /// /// Used to track the state of Integer /// @@ -327,7 +402,12 @@ namespace Org.OpenAPITools.Model sb.Append(" Double: ").Append(Double).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Int64Negative: ").Append(Int64Negative).Append("\n"); + sb.Append(" Int64NegativeExclusive: ").Append(Int64NegativeExclusive).Append("\n"); + sb.Append(" Int64Positive: ").Append(Int64Positive).Append("\n"); + sb.Append(" Int64PositiveExclusive: ").Append(Int64PositiveExclusive).Append("\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); @@ -408,6 +488,42 @@ namespace Org.OpenAPITools.Model yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // Int32Range (int) maximum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value > (int)2147483647) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value less than or equal to 2147483647.", new [] { "Int32Range" }); + } + + // Int32Range (int) minimum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value < (int)-2147483648) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value greater than or equal to -2147483648.", new [] { "Int32Range" }); + } + + // Int64Negative (long) maximum + if (this.Int64NegativeOption.IsSet && this.Int64NegativeOption.Value > (long)-2147483649) + { + yield return new ValidationResult("Invalid value for Int64Negative, must be a value less than or equal to -2147483649.", new [] { "Int64Negative" }); + } + + // Int64NegativeExclusive (long) maximum + if (this.Int64NegativeExclusiveOption.IsSet && this.Int64NegativeExclusiveOption.Value <= (long)-2147483648) + { + yield return new ValidationResult("Invalid value for Int64NegativeExclusive, must be a value less than -2147483648.", new [] { "Int64NegativeExclusive" }); + } + + // Int64Positive (long) minimum + if (this.Int64PositiveOption.IsSet && this.Int64PositiveOption.Value < (long)2147483648) + { + yield return new ValidationResult("Invalid value for Int64Positive, must be a value greater than or equal to 2147483648.", new [] { "Int64Positive" }); + } + + // Int64PositiveExclusive (long) minimum + if (this.Int64PositiveExclusiveOption.IsSet && this.Int64PositiveExclusiveOption.Value < (long)2147483647) + { + yield return new ValidationResult("Invalid value for Int64PositiveExclusive, must be a value greater than 2147483647.", new [] { "Int64PositiveExclusive" }); + } + // Integer (int) maximum if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) { @@ -518,7 +634,12 @@ namespace Org.OpenAPITools.Model Option varDouble = default; Option varFloat = 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; @@ -582,10 +703,30 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) int32 = new Option(utf8JsonReader.GetInt32()); break; + case "int32Range": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int32Range = new Option(utf8JsonReader.GetInt32()); + break; case "int64": if (utf8JsonReader.TokenType != JsonTokenType.Null) int64 = new Option(utf8JsonReader.GetInt64()); break; + case "int64Negative": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Negative = new Option(utf8JsonReader.GetInt32()); + break; + case "int64NegativeExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64Positive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Positive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64PositiveExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + break; case "integer": if (utf8JsonReader.TokenType != JsonTokenType.Null) integer = new Option(utf8JsonReader.GetInt32()); @@ -662,9 +803,24 @@ namespace Org.OpenAPITools.Model if (int32.IsSet && int32.Value == null) throw new ArgumentNullException(nameof(int32), "Property is not nullable for class FormatTest."); + if (int32Range.IsSet && int32Range.Value == null) + throw new ArgumentNullException(nameof(int32Range), "Property is not nullable for class FormatTest."); + if (int64.IsSet && int64.Value == null) throw new ArgumentNullException(nameof(int64), "Property is not nullable for class FormatTest."); + if (int64Negative.IsSet && int64Negative.Value == null) + throw new ArgumentNullException(nameof(int64Negative), "Property is not nullable for class FormatTest."); + + if (int64NegativeExclusive.IsSet && int64NegativeExclusive.Value == null) + throw new ArgumentNullException(nameof(int64NegativeExclusive), "Property is not nullable for class FormatTest."); + + if (int64Positive.IsSet && int64Positive.Value == null) + throw new ArgumentNullException(nameof(int64Positive), "Property is not nullable for class FormatTest."); + + if (int64PositiveExclusive.IsSet && int64PositiveExclusive.Value == null) + throw new ArgumentNullException(nameof(int64PositiveExclusive), "Property is not nullable for class FormatTest."); + if (integer.IsSet && integer.Value == null) throw new ArgumentNullException(nameof(integer), "Property is not nullable for class FormatTest."); @@ -689,7 +845,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, int64, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + 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); } /// @@ -767,9 +923,24 @@ namespace Org.OpenAPITools.Model if (formatTest.Int32Option.IsSet) writer.WriteNumber("int32", formatTest.Int32Option.Value.Value); + if (formatTest.Int32RangeOption.IsSet) + writer.WriteNumber("int32Range", formatTest.Int32RangeOption.Value.Value); + if (formatTest.Int64Option.IsSet) writer.WriteNumber("int64", formatTest.Int64Option.Value.Value); + if (formatTest.Int64NegativeOption.IsSet) + writer.WriteNumber("int64Negative", formatTest.Int64NegativeOption.Value.Value); + + if (formatTest.Int64NegativeExclusiveOption.IsSet) + writer.WriteNumber("int64NegativeExclusive", formatTest.Int64NegativeExclusiveOption.Value.Value); + + if (formatTest.Int64PositiveOption.IsSet) + writer.WriteNumber("int64Positive", formatTest.Int64PositiveOption.Value.Value); + + if (formatTest.Int64PositiveExclusiveOption.IsSet) + writer.WriteNumber("int64PositiveExclusive", formatTest.Int64PositiveExclusiveOption.Value.Value); + if (formatTest.IntegerOption.IsSet) writer.WriteNumber("integer", formatTest.IntegerOption.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 95cd969e02c..ced7c2c5db9 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml @@ -1617,6 +1617,24 @@ components: maximum: 200 minimum: 20 type: integer + int32Range: + maximum: 2147483647 + minimum: -2147483648 + type: integer + int64Positive: + minimum: 2147483648 + type: integer + int64Negative: + maximum: -2147483649 + type: integer + int64PositiveExclusive: + exclusiveMinimum: true + minimum: 2147483647 + type: integer + int64NegativeExclusive: + exclusiveMaximum: true + maximum: -2147483648 + type: integer unsigned_integer: format: int32 maximum: 200 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 fec6adcefdf..1009f35198f 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 @@ -14,7 +14,12 @@ Name | Type | Description | Notes **Double** | **double** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] +**Int32Range** | **int** | | [optional] **Int64** | **long** | | [optional] +**Int64Negative** | **long** | | [optional] +**Int64NegativeExclusive** | **long** | | [optional] +**Int64Positive** | **long** | | [optional] +**Int64PositiveExclusive** | **long** | | [optional] **Integer** | **int** | | [optional] **PatternWithBackslash** | **string** | None | [optional] **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [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 b658f317f1c..7dad1b08bc0 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 @@ -143,6 +143,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int32' } + /// + /// Test the property 'Int32Range' + /// + [Fact] + public void Int32RangeTest() + { + // TODO unit test for the property 'Int32Range' + } + /// /// Test the property 'Int64' /// @@ -152,6 +161,42 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int64' } + /// + /// Test the property 'Int64Negative' + /// + [Fact] + public void Int64NegativeTest() + { + // TODO unit test for the property 'Int64Negative' + } + + /// + /// Test the property 'Int64NegativeExclusive' + /// + [Fact] + public void Int64NegativeExclusiveTest() + { + // TODO unit test for the property 'Int64NegativeExclusive' + } + + /// + /// Test the property 'Int64Positive' + /// + [Fact] + public void Int64PositiveTest() + { + // TODO unit test for the property 'Int64Positive' + } + + /// + /// Test the property 'Int64PositiveExclusive' + /// + [Fact] + public void Int64PositiveExclusiveTest() + { + // TODO unit test for the property 'Int64PositiveExclusive' + } + /// /// Test the property 'Integer' /// diff --git a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs index 1f45ab88e83..a8d4a64fcf5 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/src/Org.OpenAPITools/Api/FakeApi.cs @@ -4304,19 +4304,15 @@ namespace Org.OpenAPITools.Api System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); if (enumQueryStringArray.IsSet) - // here too parseQueryStringLocalVar["enum_query_string_array"] = ClientUtils.ParameterToString(enumQueryStringArray.Value); if (enumQueryDouble.IsSet) - // here too parseQueryStringLocalVar["enum_query_double"] = ClientUtils.ParameterToString(enumQueryDouble.Value); if (enumQueryInteger.IsSet) - // here too parseQueryStringLocalVar["enum_query_integer"] = ClientUtils.ParameterToString(enumQueryInteger.Value); if (enumQueryString.IsSet) - // here too parseQueryStringLocalVar["enum_query_string"] = ClientUtils.ParameterToString(enumQueryString.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -4553,11 +4549,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["required_int64_group"] = ClientUtils.ParameterToString(requiredInt64Group); if (stringGroup.IsSet) - // here too parseQueryStringLocalVar["string_group"] = ClientUtils.ParameterToString(stringGroup.Value); if (int64Group.IsSet) - // here too parseQueryStringLocalVar["int64_group"] = ClientUtils.ParameterToString(int64Group.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -5422,11 +5416,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["requiredNullable"] = ClientUtils.ParameterToString(requiredNullable); if (notRequiredNotNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNotNullable"] = ClientUtils.ParameterToString(notRequiredNotNullable.Value); if (notRequiredNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNullable"] = ClientUtils.ParameterToString(notRequiredNullable.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); 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 340a84ca1e2..249857fdd15 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 @@ -44,7 +44,12 @@ namespace Org.OpenAPITools.Model /// double /// float /// int32 + /// int32Range /// int64 + /// int64Negative + /// int64NegativeExclusive + /// int64Positive + /// int64PositiveExclusive /// integer /// None /// A string that is a 10 digit number. Can have leading zeros. @@ -54,7 +59,7 @@ namespace Org.OpenAPITools.Model /// 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 int64 = 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, 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) { Byte = @byte; Date = date; @@ -66,7 +71,12 @@ namespace Org.OpenAPITools.Model DoubleOption = @double; FloatOption = @float; Int32Option = int32; + Int32RangeOption = int32Range; Int64Option = int64; + Int64NegativeOption = int64Negative; + Int64NegativeExclusiveOption = int64NegativeExclusive; + Int64PositiveOption = int64Positive; + Int64PositiveExclusiveOption = int64PositiveExclusive; IntegerOption = integer; PatternWithBackslashOption = patternWithBackslash; PatternWithDigitsOption = patternWithDigits; @@ -184,6 +194,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int32")] public int? Int32 { get { return this.Int32Option; } set { this.Int32Option = new(value); } } + /// + /// Used to track the state of Int32Range + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int32RangeOption { get; private set; } + + /// + /// Gets or Sets Int32Range + /// + [JsonPropertyName("int32Range")] + public int? Int32Range { get { return this.Int32RangeOption; } set { this.Int32RangeOption = new(value); } } + /// /// Used to track the state of Int64 /// @@ -197,6 +220,58 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int64")] public long? Int64 { get { return this.Int64Option; } set { this.Int64Option = new(value); } } + /// + /// Used to track the state of Int64Negative + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeOption { get; private set; } + + /// + /// Gets or Sets Int64Negative + /// + [JsonPropertyName("int64Negative")] + public long? Int64Negative { get { return this.Int64NegativeOption; } set { this.Int64NegativeOption = new(value); } } + + /// + /// Used to track the state of Int64NegativeExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64NegativeExclusive + /// + [JsonPropertyName("int64NegativeExclusive")] + public long? Int64NegativeExclusive { get { return this.Int64NegativeExclusiveOption; } set { this.Int64NegativeExclusiveOption = new(value); } } + + /// + /// Used to track the state of Int64Positive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveOption { get; private set; } + + /// + /// Gets or Sets Int64Positive + /// + [JsonPropertyName("int64Positive")] + public long? Int64Positive { get { return this.Int64PositiveOption; } set { this.Int64PositiveOption = new(value); } } + + /// + /// Used to track the state of Int64PositiveExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64PositiveExclusive + /// + [JsonPropertyName("int64PositiveExclusive")] + public long? Int64PositiveExclusive { get { return this.Int64PositiveExclusiveOption; } set { this.Int64PositiveExclusiveOption = new(value); } } + /// /// Used to track the state of Integer /// @@ -329,7 +404,12 @@ namespace Org.OpenAPITools.Model sb.Append(" Double: ").Append(Double).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Int64Negative: ").Append(Int64Negative).Append("\n"); + sb.Append(" Int64NegativeExclusive: ").Append(Int64NegativeExclusive).Append("\n"); + sb.Append(" Int64Positive: ").Append(Int64Positive).Append("\n"); + sb.Append(" Int64PositiveExclusive: ").Append(Int64PositiveExclusive).Append("\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); @@ -410,6 +490,42 @@ namespace Org.OpenAPITools.Model yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // Int32Range (int) maximum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value > (int)2147483647) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value less than or equal to 2147483647.", new [] { "Int32Range" }); + } + + // Int32Range (int) minimum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value < (int)-2147483648) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value greater than or equal to -2147483648.", new [] { "Int32Range" }); + } + + // Int64Negative (long) maximum + if (this.Int64NegativeOption.IsSet && this.Int64NegativeOption.Value > (long)-2147483649) + { + yield return new ValidationResult("Invalid value for Int64Negative, must be a value less than or equal to -2147483649.", new [] { "Int64Negative" }); + } + + // Int64NegativeExclusive (long) maximum + if (this.Int64NegativeExclusiveOption.IsSet && this.Int64NegativeExclusiveOption.Value <= (long)-2147483648) + { + yield return new ValidationResult("Invalid value for Int64NegativeExclusive, must be a value less than -2147483648.", new [] { "Int64NegativeExclusive" }); + } + + // Int64Positive (long) minimum + if (this.Int64PositiveOption.IsSet && this.Int64PositiveOption.Value < (long)2147483648) + { + yield return new ValidationResult("Invalid value for Int64Positive, must be a value greater than or equal to 2147483648.", new [] { "Int64Positive" }); + } + + // Int64PositiveExclusive (long) minimum + if (this.Int64PositiveExclusiveOption.IsSet && this.Int64PositiveExclusiveOption.Value < (long)2147483647) + { + yield return new ValidationResult("Invalid value for Int64PositiveExclusive, must be a value greater than 2147483647.", new [] { "Int64PositiveExclusive" }); + } + // Integer (int) maximum if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) { @@ -520,7 +636,12 @@ namespace Org.OpenAPITools.Model Option varDouble = default; Option varFloat = 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; @@ -584,10 +705,30 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) int32 = new Option(utf8JsonReader.GetInt32()); break; + case "int32Range": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int32Range = new Option(utf8JsonReader.GetInt32()); + break; case "int64": if (utf8JsonReader.TokenType != JsonTokenType.Null) int64 = new Option(utf8JsonReader.GetInt64()); break; + case "int64Negative": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Negative = new Option(utf8JsonReader.GetInt32()); + break; + case "int64NegativeExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64Positive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Positive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64PositiveExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + break; case "integer": if (utf8JsonReader.TokenType != JsonTokenType.Null) integer = new Option(utf8JsonReader.GetInt32()); @@ -664,9 +805,24 @@ namespace Org.OpenAPITools.Model if (int32.IsSet && int32.Value == null) throw new ArgumentNullException(nameof(int32), "Property is not nullable for class FormatTest."); + if (int32Range.IsSet && int32Range.Value == null) + throw new ArgumentNullException(nameof(int32Range), "Property is not nullable for class FormatTest."); + if (int64.IsSet && int64.Value == null) throw new ArgumentNullException(nameof(int64), "Property is not nullable for class FormatTest."); + if (int64Negative.IsSet && int64Negative.Value == null) + throw new ArgumentNullException(nameof(int64Negative), "Property is not nullable for class FormatTest."); + + if (int64NegativeExclusive.IsSet && int64NegativeExclusive.Value == null) + throw new ArgumentNullException(nameof(int64NegativeExclusive), "Property is not nullable for class FormatTest."); + + if (int64Positive.IsSet && int64Positive.Value == null) + throw new ArgumentNullException(nameof(int64Positive), "Property is not nullable for class FormatTest."); + + if (int64PositiveExclusive.IsSet && int64PositiveExclusive.Value == null) + throw new ArgumentNullException(nameof(int64PositiveExclusive), "Property is not nullable for class FormatTest."); + if (integer.IsSet && integer.Value == null) throw new ArgumentNullException(nameof(integer), "Property is not nullable for class FormatTest."); @@ -691,7 +847,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, int64, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + 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); } /// @@ -769,9 +925,24 @@ namespace Org.OpenAPITools.Model if (formatTest.Int32Option.IsSet) writer.WriteNumber("int32", formatTest.Int32Option.Value!.Value); + if (formatTest.Int32RangeOption.IsSet) + writer.WriteNumber("int32Range", formatTest.Int32RangeOption.Value!.Value); + if (formatTest.Int64Option.IsSet) writer.WriteNumber("int64", formatTest.Int64Option.Value!.Value); + if (formatTest.Int64NegativeOption.IsSet) + writer.WriteNumber("int64Negative", formatTest.Int64NegativeOption.Value!.Value); + + if (formatTest.Int64NegativeExclusiveOption.IsSet) + writer.WriteNumber("int64NegativeExclusive", formatTest.Int64NegativeExclusiveOption.Value!.Value); + + if (formatTest.Int64PositiveOption.IsSet) + writer.WriteNumber("int64Positive", formatTest.Int64PositiveOption.Value!.Value); + + if (formatTest.Int64PositiveExclusiveOption.IsSet) + writer.WriteNumber("int64PositiveExclusive", formatTest.Int64PositiveExclusiveOption.Value!.Value); + if (formatTest.IntegerOption.IsSet) writer.WriteNumber("integer", formatTest.IntegerOption.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 95cd969e02c..ced7c2c5db9 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml @@ -1617,6 +1617,24 @@ components: maximum: 200 minimum: 20 type: integer + int32Range: + maximum: 2147483647 + minimum: -2147483648 + type: integer + int64Positive: + minimum: 2147483648 + type: integer + int64Negative: + maximum: -2147483649 + type: integer + int64PositiveExclusive: + exclusiveMinimum: true + minimum: 2147483647 + type: integer + int64NegativeExclusive: + exclusiveMaximum: true + maximum: -2147483648 + type: integer unsigned_integer: format: int32 maximum: 200 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 fec6adcefdf..1009f35198f 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 @@ -14,7 +14,12 @@ Name | Type | Description | Notes **Double** | **double** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] +**Int32Range** | **int** | | [optional] **Int64** | **long** | | [optional] +**Int64Negative** | **long** | | [optional] +**Int64NegativeExclusive** | **long** | | [optional] +**Int64Positive** | **long** | | [optional] +**Int64PositiveExclusive** | **long** | | [optional] **Integer** | **int** | | [optional] **PatternWithBackslash** | **string** | None | [optional] **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [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 b658f317f1c..7dad1b08bc0 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 @@ -143,6 +143,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int32' } + /// + /// Test the property 'Int32Range' + /// + [Fact] + public void Int32RangeTest() + { + // TODO unit test for the property 'Int32Range' + } + /// /// Test the property 'Int64' /// @@ -152,6 +161,42 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int64' } + /// + /// Test the property 'Int64Negative' + /// + [Fact] + public void Int64NegativeTest() + { + // TODO unit test for the property 'Int64Negative' + } + + /// + /// Test the property 'Int64NegativeExclusive' + /// + [Fact] + public void Int64NegativeExclusiveTest() + { + // TODO unit test for the property 'Int64NegativeExclusive' + } + + /// + /// Test the property 'Int64Positive' + /// + [Fact] + public void Int64PositiveTest() + { + // TODO unit test for the property 'Int64Positive' + } + + /// + /// Test the property 'Int64PositiveExclusive' + /// + [Fact] + public void Int64PositiveExclusiveTest() + { + // TODO unit test for the property 'Int64PositiveExclusive' + } + /// /// Test the property 'Integer' /// diff --git a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index c47a501885e..58c98588223 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -4302,19 +4302,15 @@ namespace Org.OpenAPITools.Api System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); if (enumQueryStringArray.IsSet) - // here too parseQueryStringLocalVar["enum_query_string_array"] = ClientUtils.ParameterToString(enumQueryStringArray.Value); if (enumQueryDouble.IsSet) - // here too parseQueryStringLocalVar["enum_query_double"] = ClientUtils.ParameterToString(enumQueryDouble.Value); if (enumQueryInteger.IsSet) - // here too parseQueryStringLocalVar["enum_query_integer"] = ClientUtils.ParameterToString(enumQueryInteger.Value); if (enumQueryString.IsSet) - // here too parseQueryStringLocalVar["enum_query_string"] = ClientUtils.ParameterToString(enumQueryString.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -4551,11 +4547,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["required_int64_group"] = ClientUtils.ParameterToString(requiredInt64Group); if (stringGroup.IsSet) - // here too parseQueryStringLocalVar["string_group"] = ClientUtils.ParameterToString(stringGroup.Value); if (int64Group.IsSet) - // here too parseQueryStringLocalVar["int64_group"] = ClientUtils.ParameterToString(int64Group.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -5420,11 +5414,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["requiredNullable"] = ClientUtils.ParameterToString(requiredNullable); if (notRequiredNotNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNotNullable"] = ClientUtils.ParameterToString(notRequiredNotNullable.Value); if (notRequiredNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNullable"] = ClientUtils.ParameterToString(notRequiredNullable.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); 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 9113c366efe..91aea77dbdf 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 @@ -42,7 +42,12 @@ namespace Org.OpenAPITools.Model /// double /// float /// int32 + /// int32Range /// int64 + /// int64Negative + /// int64NegativeExclusive + /// int64Positive + /// int64PositiveExclusive /// integer /// None /// A string that is a 10 digit number. Can have leading zeros. @@ -52,7 +57,7 @@ namespace Org.OpenAPITools.Model /// 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 int64 = 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, 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) { Byte = @byte; Date = date; @@ -64,7 +69,12 @@ namespace Org.OpenAPITools.Model DoubleOption = @double; FloatOption = @float; Int32Option = int32; + Int32RangeOption = int32Range; Int64Option = int64; + Int64NegativeOption = int64Negative; + Int64NegativeExclusiveOption = int64NegativeExclusive; + Int64PositiveOption = int64Positive; + Int64PositiveExclusiveOption = int64PositiveExclusive; IntegerOption = integer; PatternWithBackslashOption = patternWithBackslash; PatternWithDigitsOption = patternWithDigits; @@ -182,6 +192,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int32")] public int? Int32 { get { return this.Int32Option; } set { this.Int32Option = new(value); } } + /// + /// Used to track the state of Int32Range + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int32RangeOption { get; private set; } + + /// + /// Gets or Sets Int32Range + /// + [JsonPropertyName("int32Range")] + public int? Int32Range { get { return this.Int32RangeOption; } set { this.Int32RangeOption = new(value); } } + /// /// Used to track the state of Int64 /// @@ -195,6 +218,58 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int64")] public long? Int64 { get { return this.Int64Option; } set { this.Int64Option = new(value); } } + /// + /// Used to track the state of Int64Negative + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeOption { get; private set; } + + /// + /// Gets or Sets Int64Negative + /// + [JsonPropertyName("int64Negative")] + public long? Int64Negative { get { return this.Int64NegativeOption; } set { this.Int64NegativeOption = new(value); } } + + /// + /// Used to track the state of Int64NegativeExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64NegativeExclusive + /// + [JsonPropertyName("int64NegativeExclusive")] + public long? Int64NegativeExclusive { get { return this.Int64NegativeExclusiveOption; } set { this.Int64NegativeExclusiveOption = new(value); } } + + /// + /// Used to track the state of Int64Positive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveOption { get; private set; } + + /// + /// Gets or Sets Int64Positive + /// + [JsonPropertyName("int64Positive")] + public long? Int64Positive { get { return this.Int64PositiveOption; } set { this.Int64PositiveOption = new(value); } } + + /// + /// Used to track the state of Int64PositiveExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64PositiveExclusive + /// + [JsonPropertyName("int64PositiveExclusive")] + public long? Int64PositiveExclusive { get { return this.Int64PositiveExclusiveOption; } set { this.Int64PositiveExclusiveOption = new(value); } } + /// /// Used to track the state of Integer /// @@ -327,7 +402,12 @@ namespace Org.OpenAPITools.Model sb.Append(" Double: ").Append(Double).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Int64Negative: ").Append(Int64Negative).Append("\n"); + sb.Append(" Int64NegativeExclusive: ").Append(Int64NegativeExclusive).Append("\n"); + sb.Append(" Int64Positive: ").Append(Int64Positive).Append("\n"); + sb.Append(" Int64PositiveExclusive: ").Append(Int64PositiveExclusive).Append("\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); @@ -408,6 +488,42 @@ namespace Org.OpenAPITools.Model yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // Int32Range (int) maximum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value > (int)2147483647) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value less than or equal to 2147483647.", new [] { "Int32Range" }); + } + + // Int32Range (int) minimum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value < (int)-2147483648) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value greater than or equal to -2147483648.", new [] { "Int32Range" }); + } + + // Int64Negative (long) maximum + if (this.Int64NegativeOption.IsSet && this.Int64NegativeOption.Value > (long)-2147483649) + { + yield return new ValidationResult("Invalid value for Int64Negative, must be a value less than or equal to -2147483649.", new [] { "Int64Negative" }); + } + + // Int64NegativeExclusive (long) maximum + if (this.Int64NegativeExclusiveOption.IsSet && this.Int64NegativeExclusiveOption.Value <= (long)-2147483648) + { + yield return new ValidationResult("Invalid value for Int64NegativeExclusive, must be a value less than -2147483648.", new [] { "Int64NegativeExclusive" }); + } + + // Int64Positive (long) minimum + if (this.Int64PositiveOption.IsSet && this.Int64PositiveOption.Value < (long)2147483648) + { + yield return new ValidationResult("Invalid value for Int64Positive, must be a value greater than or equal to 2147483648.", new [] { "Int64Positive" }); + } + + // Int64PositiveExclusive (long) minimum + if (this.Int64PositiveExclusiveOption.IsSet && this.Int64PositiveExclusiveOption.Value < (long)2147483647) + { + yield return new ValidationResult("Invalid value for Int64PositiveExclusive, must be a value greater than 2147483647.", new [] { "Int64PositiveExclusive" }); + } + // Integer (int) maximum if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) { @@ -518,7 +634,12 @@ namespace Org.OpenAPITools.Model Option varDouble = default; Option varFloat = 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; @@ -582,10 +703,30 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) int32 = new Option(utf8JsonReader.GetInt32()); break; + case "int32Range": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int32Range = new Option(utf8JsonReader.GetInt32()); + break; case "int64": if (utf8JsonReader.TokenType != JsonTokenType.Null) int64 = new Option(utf8JsonReader.GetInt64()); break; + case "int64Negative": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Negative = new Option(utf8JsonReader.GetInt32()); + break; + case "int64NegativeExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64Positive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Positive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64PositiveExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + break; case "integer": if (utf8JsonReader.TokenType != JsonTokenType.Null) integer = new Option(utf8JsonReader.GetInt32()); @@ -662,9 +803,24 @@ namespace Org.OpenAPITools.Model if (int32.IsSet && int32.Value == null) throw new ArgumentNullException(nameof(int32), "Property is not nullable for class FormatTest."); + if (int32Range.IsSet && int32Range.Value == null) + throw new ArgumentNullException(nameof(int32Range), "Property is not nullable for class FormatTest."); + if (int64.IsSet && int64.Value == null) throw new ArgumentNullException(nameof(int64), "Property is not nullable for class FormatTest."); + if (int64Negative.IsSet && int64Negative.Value == null) + throw new ArgumentNullException(nameof(int64Negative), "Property is not nullable for class FormatTest."); + + if (int64NegativeExclusive.IsSet && int64NegativeExclusive.Value == null) + throw new ArgumentNullException(nameof(int64NegativeExclusive), "Property is not nullable for class FormatTest."); + + if (int64Positive.IsSet && int64Positive.Value == null) + throw new ArgumentNullException(nameof(int64Positive), "Property is not nullable for class FormatTest."); + + if (int64PositiveExclusive.IsSet && int64PositiveExclusive.Value == null) + throw new ArgumentNullException(nameof(int64PositiveExclusive), "Property is not nullable for class FormatTest."); + if (integer.IsSet && integer.Value == null) throw new ArgumentNullException(nameof(integer), "Property is not nullable for class FormatTest."); @@ -689,7 +845,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, int64, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + 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); } /// @@ -767,9 +923,24 @@ namespace Org.OpenAPITools.Model if (formatTest.Int32Option.IsSet) writer.WriteNumber("int32", formatTest.Int32Option.Value.Value); + if (formatTest.Int32RangeOption.IsSet) + writer.WriteNumber("int32Range", formatTest.Int32RangeOption.Value.Value); + if (formatTest.Int64Option.IsSet) writer.WriteNumber("int64", formatTest.Int64Option.Value.Value); + if (formatTest.Int64NegativeOption.IsSet) + writer.WriteNumber("int64Negative", formatTest.Int64NegativeOption.Value.Value); + + if (formatTest.Int64NegativeExclusiveOption.IsSet) + writer.WriteNumber("int64NegativeExclusive", formatTest.Int64NegativeExclusiveOption.Value.Value); + + if (formatTest.Int64PositiveOption.IsSet) + writer.WriteNumber("int64Positive", formatTest.Int64PositiveOption.Value.Value); + + if (formatTest.Int64PositiveExclusiveOption.IsSet) + writer.WriteNumber("int64PositiveExclusive", formatTest.Int64PositiveExclusiveOption.Value.Value); + if (formatTest.IntegerOption.IsSet) writer.WriteNumber("integer", formatTest.IntegerOption.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 95cd969e02c..ced7c2c5db9 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml @@ -1617,6 +1617,24 @@ components: maximum: 200 minimum: 20 type: integer + int32Range: + maximum: 2147483647 + minimum: -2147483648 + type: integer + int64Positive: + minimum: 2147483648 + type: integer + int64Negative: + maximum: -2147483649 + type: integer + int64PositiveExclusive: + exclusiveMinimum: true + minimum: 2147483647 + type: integer + int64NegativeExclusive: + exclusiveMaximum: true + maximum: -2147483648 + type: integer unsigned_integer: format: int32 maximum: 200 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 fec6adcefdf..1009f35198f 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 @@ -14,7 +14,12 @@ Name | Type | Description | Notes **Double** | **double** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] +**Int32Range** | **int** | | [optional] **Int64** | **long** | | [optional] +**Int64Negative** | **long** | | [optional] +**Int64NegativeExclusive** | **long** | | [optional] +**Int64Positive** | **long** | | [optional] +**Int64PositiveExclusive** | **long** | | [optional] **Integer** | **int** | | [optional] **PatternWithBackslash** | **string** | None | [optional] **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [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 b658f317f1c..7dad1b08bc0 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 @@ -143,6 +143,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int32' } + /// + /// Test the property 'Int32Range' + /// + [Fact] + public void Int32RangeTest() + { + // TODO unit test for the property 'Int32Range' + } + /// /// Test the property 'Int64' /// @@ -152,6 +161,42 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int64' } + /// + /// Test the property 'Int64Negative' + /// + [Fact] + public void Int64NegativeTest() + { + // TODO unit test for the property 'Int64Negative' + } + + /// + /// Test the property 'Int64NegativeExclusive' + /// + [Fact] + public void Int64NegativeExclusiveTest() + { + // TODO unit test for the property 'Int64NegativeExclusive' + } + + /// + /// Test the property 'Int64Positive' + /// + [Fact] + public void Int64PositiveTest() + { + // TODO unit test for the property 'Int64Positive' + } + + /// + /// Test the property 'Int64PositiveExclusive' + /// + [Fact] + public void Int64PositiveExclusiveTest() + { + // TODO unit test for the property 'Int64PositiveExclusive' + } + /// /// Test the property 'Integer' /// diff --git a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs index 1f45ab88e83..a8d4a64fcf5 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/src/Org.OpenAPITools/Api/FakeApi.cs @@ -4304,19 +4304,15 @@ namespace Org.OpenAPITools.Api System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); if (enumQueryStringArray.IsSet) - // here too parseQueryStringLocalVar["enum_query_string_array"] = ClientUtils.ParameterToString(enumQueryStringArray.Value); if (enumQueryDouble.IsSet) - // here too parseQueryStringLocalVar["enum_query_double"] = ClientUtils.ParameterToString(enumQueryDouble.Value); if (enumQueryInteger.IsSet) - // here too parseQueryStringLocalVar["enum_query_integer"] = ClientUtils.ParameterToString(enumQueryInteger.Value); if (enumQueryString.IsSet) - // here too parseQueryStringLocalVar["enum_query_string"] = ClientUtils.ParameterToString(enumQueryString.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -4553,11 +4549,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["required_int64_group"] = ClientUtils.ParameterToString(requiredInt64Group); if (stringGroup.IsSet) - // here too parseQueryStringLocalVar["string_group"] = ClientUtils.ParameterToString(stringGroup.Value); if (int64Group.IsSet) - // here too parseQueryStringLocalVar["int64_group"] = ClientUtils.ParameterToString(int64Group.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -5422,11 +5416,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["requiredNullable"] = ClientUtils.ParameterToString(requiredNullable); if (notRequiredNotNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNotNullable"] = ClientUtils.ParameterToString(notRequiredNotNullable.Value); if (notRequiredNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNullable"] = ClientUtils.ParameterToString(notRequiredNullable.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); 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 5c1aad8e009..f986ee25a56 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 @@ -45,7 +45,12 @@ namespace Org.OpenAPITools.Model /// double /// float /// int32 + /// int32Range /// int64 + /// int64Negative + /// int64NegativeExclusive + /// int64Positive + /// int64PositiveExclusive /// integer /// None /// A string that is a 10 digit number. Can have leading zeros. @@ -55,7 +60,7 @@ namespace Org.OpenAPITools.Model /// 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 int64 = 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, 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) { Byte = @byte; Date = date; @@ -67,7 +72,12 @@ namespace Org.OpenAPITools.Model DoubleOption = @double; FloatOption = @float; Int32Option = int32; + Int32RangeOption = int32Range; Int64Option = int64; + Int64NegativeOption = int64Negative; + Int64NegativeExclusiveOption = int64NegativeExclusive; + Int64PositiveOption = int64Positive; + Int64PositiveExclusiveOption = int64PositiveExclusive; IntegerOption = integer; PatternWithBackslashOption = patternWithBackslash; PatternWithDigitsOption = patternWithDigits; @@ -185,6 +195,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int32")] public int? Int32 { get { return this.Int32Option; } set { this.Int32Option = new(value); } } + /// + /// Used to track the state of Int32Range + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int32RangeOption { get; private set; } + + /// + /// Gets or Sets Int32Range + /// + [JsonPropertyName("int32Range")] + public int? Int32Range { get { return this.Int32RangeOption; } set { this.Int32RangeOption = new(value); } } + /// /// Used to track the state of Int64 /// @@ -198,6 +221,58 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int64")] public long? Int64 { get { return this.Int64Option; } set { this.Int64Option = new(value); } } + /// + /// Used to track the state of Int64Negative + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeOption { get; private set; } + + /// + /// Gets or Sets Int64Negative + /// + [JsonPropertyName("int64Negative")] + public long? Int64Negative { get { return this.Int64NegativeOption; } set { this.Int64NegativeOption = new(value); } } + + /// + /// Used to track the state of Int64NegativeExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64NegativeExclusive + /// + [JsonPropertyName("int64NegativeExclusive")] + public long? Int64NegativeExclusive { get { return this.Int64NegativeExclusiveOption; } set { this.Int64NegativeExclusiveOption = new(value); } } + + /// + /// Used to track the state of Int64Positive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveOption { get; private set; } + + /// + /// Gets or Sets Int64Positive + /// + [JsonPropertyName("int64Positive")] + public long? Int64Positive { get { return this.Int64PositiveOption; } set { this.Int64PositiveOption = new(value); } } + + /// + /// Used to track the state of Int64PositiveExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64PositiveExclusive + /// + [JsonPropertyName("int64PositiveExclusive")] + public long? Int64PositiveExclusive { get { return this.Int64PositiveExclusiveOption; } set { this.Int64PositiveExclusiveOption = new(value); } } + /// /// Used to track the state of Integer /// @@ -330,7 +405,12 @@ namespace Org.OpenAPITools.Model sb.Append(" Double: ").Append(Double).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Int64Negative: ").Append(Int64Negative).Append("\n"); + sb.Append(" Int64NegativeExclusive: ").Append(Int64NegativeExclusive).Append("\n"); + sb.Append(" Int64Positive: ").Append(Int64Positive).Append("\n"); + sb.Append(" Int64PositiveExclusive: ").Append(Int64PositiveExclusive).Append("\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); @@ -411,6 +491,42 @@ namespace Org.OpenAPITools.Model yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // Int32Range (int) maximum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value > (int)2147483647) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value less than or equal to 2147483647.", new [] { "Int32Range" }); + } + + // Int32Range (int) minimum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value < (int)-2147483648) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value greater than or equal to -2147483648.", new [] { "Int32Range" }); + } + + // Int64Negative (long) maximum + if (this.Int64NegativeOption.IsSet && this.Int64NegativeOption.Value > (long)-2147483649) + { + yield return new ValidationResult("Invalid value for Int64Negative, must be a value less than or equal to -2147483649.", new [] { "Int64Negative" }); + } + + // Int64NegativeExclusive (long) maximum + if (this.Int64NegativeExclusiveOption.IsSet && this.Int64NegativeExclusiveOption.Value <= (long)-2147483648) + { + yield return new ValidationResult("Invalid value for Int64NegativeExclusive, must be a value less than -2147483648.", new [] { "Int64NegativeExclusive" }); + } + + // Int64Positive (long) minimum + if (this.Int64PositiveOption.IsSet && this.Int64PositiveOption.Value < (long)2147483648) + { + yield return new ValidationResult("Invalid value for Int64Positive, must be a value greater than or equal to 2147483648.", new [] { "Int64Positive" }); + } + + // Int64PositiveExclusive (long) minimum + if (this.Int64PositiveExclusiveOption.IsSet && this.Int64PositiveExclusiveOption.Value < (long)2147483647) + { + yield return new ValidationResult("Invalid value for Int64PositiveExclusive, must be a value greater than 2147483647.", new [] { "Int64PositiveExclusive" }); + } + // Integer (int) maximum if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) { @@ -521,7 +637,12 @@ namespace Org.OpenAPITools.Model Option varDouble = default; Option varFloat = 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; @@ -585,10 +706,30 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) int32 = new Option(utf8JsonReader.GetInt32()); break; + case "int32Range": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int32Range = new Option(utf8JsonReader.GetInt32()); + break; case "int64": if (utf8JsonReader.TokenType != JsonTokenType.Null) int64 = new Option(utf8JsonReader.GetInt64()); break; + case "int64Negative": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Negative = new Option(utf8JsonReader.GetInt32()); + break; + case "int64NegativeExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64Positive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Positive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64PositiveExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + break; case "integer": if (utf8JsonReader.TokenType != JsonTokenType.Null) integer = new Option(utf8JsonReader.GetInt32()); @@ -665,9 +806,24 @@ namespace Org.OpenAPITools.Model if (int32.IsSet && int32.Value == null) throw new ArgumentNullException(nameof(int32), "Property is not nullable for class FormatTest."); + if (int32Range.IsSet && int32Range.Value == null) + throw new ArgumentNullException(nameof(int32Range), "Property is not nullable for class FormatTest."); + if (int64.IsSet && int64.Value == null) throw new ArgumentNullException(nameof(int64), "Property is not nullable for class FormatTest."); + if (int64Negative.IsSet && int64Negative.Value == null) + throw new ArgumentNullException(nameof(int64Negative), "Property is not nullable for class FormatTest."); + + if (int64NegativeExclusive.IsSet && int64NegativeExclusive.Value == null) + throw new ArgumentNullException(nameof(int64NegativeExclusive), "Property is not nullable for class FormatTest."); + + if (int64Positive.IsSet && int64Positive.Value == null) + throw new ArgumentNullException(nameof(int64Positive), "Property is not nullable for class FormatTest."); + + if (int64PositiveExclusive.IsSet && int64PositiveExclusive.Value == null) + throw new ArgumentNullException(nameof(int64PositiveExclusive), "Property is not nullable for class FormatTest."); + if (integer.IsSet && integer.Value == null) throw new ArgumentNullException(nameof(integer), "Property is not nullable for class FormatTest."); @@ -692,7 +848,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, int64, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + 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); } /// @@ -770,9 +926,24 @@ namespace Org.OpenAPITools.Model if (formatTest.Int32Option.IsSet) writer.WriteNumber("int32", formatTest.Int32Option.Value!.Value); + if (formatTest.Int32RangeOption.IsSet) + writer.WriteNumber("int32Range", formatTest.Int32RangeOption.Value!.Value); + if (formatTest.Int64Option.IsSet) writer.WriteNumber("int64", formatTest.Int64Option.Value!.Value); + if (formatTest.Int64NegativeOption.IsSet) + writer.WriteNumber("int64Negative", formatTest.Int64NegativeOption.Value!.Value); + + if (formatTest.Int64NegativeExclusiveOption.IsSet) + writer.WriteNumber("int64NegativeExclusive", formatTest.Int64NegativeExclusiveOption.Value!.Value); + + if (formatTest.Int64PositiveOption.IsSet) + writer.WriteNumber("int64Positive", formatTest.Int64PositiveOption.Value!.Value); + + if (formatTest.Int64PositiveExclusiveOption.IsSet) + writer.WriteNumber("int64PositiveExclusive", formatTest.Int64PositiveExclusiveOption.Value!.Value); + if (formatTest.IntegerOption.IsSet) writer.WriteNumber("integer", formatTest.IntegerOption.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 95cd969e02c..ced7c2c5db9 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 @@ -1617,6 +1617,24 @@ components: maximum: 200 minimum: 20 type: integer + int32Range: + maximum: 2147483647 + minimum: -2147483648 + type: integer + int64Positive: + minimum: 2147483648 + type: integer + int64Negative: + maximum: -2147483649 + type: integer + int64PositiveExclusive: + exclusiveMinimum: true + minimum: 2147483647 + type: integer + int64NegativeExclusive: + exclusiveMaximum: true + maximum: -2147483648 + type: integer unsigned_integer: format: int32 maximum: 200 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 0983002c5da..5983bc09690 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 @@ -14,7 +14,12 @@ Name | Type | Description | Notes **Double** | **double** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] +**Int32Range** | **int** | | [optional] **Int64** | **long** | | [optional] +**Int64Negative** | **long** | | [optional] +**Int64NegativeExclusive** | **long** | | [optional] +**Int64Positive** | **long** | | [optional] +**Int64PositiveExclusive** | **long** | | [optional] **Integer** | **int** | | [optional] **PatternWithBackslash** | **string** | None | [optional] **PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [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 b658f317f1c..7dad1b08bc0 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 @@ -143,6 +143,15 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int32' } + /// + /// Test the property 'Int32Range' + /// + [Fact] + public void Int32RangeTest() + { + // TODO unit test for the property 'Int32Range' + } + /// /// Test the property 'Int64' /// @@ -152,6 +161,42 @@ namespace Org.OpenAPITools.Test.Model // TODO unit test for the property 'Int64' } + /// + /// Test the property 'Int64Negative' + /// + [Fact] + public void Int64NegativeTest() + { + // TODO unit test for the property 'Int64Negative' + } + + /// + /// Test the property 'Int64NegativeExclusive' + /// + [Fact] + public void Int64NegativeExclusiveTest() + { + // TODO unit test for the property 'Int64NegativeExclusive' + } + + /// + /// Test the property 'Int64Positive' + /// + [Fact] + public void Int64PositiveTest() + { + // TODO unit test for the property 'Int64Positive' + } + + /// + /// Test the property 'Int64PositiveExclusive' + /// + [Fact] + public void Int64PositiveExclusiveTest() + { + // TODO unit test for the property 'Int64PositiveExclusive' + } + /// /// Test the property 'Integer' /// diff --git a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs index e386a6d5809..7428cb17c2d 100644 --- a/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/generichost/standard2.0/Petstore/src/Org.OpenAPITools/Api/FakeApi.cs @@ -4292,19 +4292,15 @@ namespace Org.OpenAPITools.Api System.Collections.Specialized.NameValueCollection parseQueryStringLocalVar = System.Web.HttpUtility.ParseQueryString(string.Empty); if (enumQueryStringArray.IsSet) - // here too parseQueryStringLocalVar["enum_query_string_array"] = ClientUtils.ParameterToString(enumQueryStringArray.Value); if (enumQueryDouble.IsSet) - // here too parseQueryStringLocalVar["enum_query_double"] = ClientUtils.ParameterToString(enumQueryDouble.Value); if (enumQueryInteger.IsSet) - // here too parseQueryStringLocalVar["enum_query_integer"] = ClientUtils.ParameterToString(enumQueryInteger.Value); if (enumQueryString.IsSet) - // here too parseQueryStringLocalVar["enum_query_string"] = ClientUtils.ParameterToString(enumQueryString.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -4541,11 +4537,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["required_int64_group"] = ClientUtils.ParameterToString(requiredInt64Group); if (stringGroup.IsSet) - // here too parseQueryStringLocalVar["string_group"] = ClientUtils.ParameterToString(stringGroup.Value); if (int64Group.IsSet) - // here too parseQueryStringLocalVar["int64_group"] = ClientUtils.ParameterToString(int64Group.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); @@ -5409,11 +5403,9 @@ namespace Org.OpenAPITools.Api parseQueryStringLocalVar["requiredNullable"] = ClientUtils.ParameterToString(requiredNullable); if (notRequiredNotNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNotNullable"] = ClientUtils.ParameterToString(notRequiredNotNullable.Value); if (notRequiredNullable.IsSet) - // here too parseQueryStringLocalVar["notRequiredNullable"] = ClientUtils.ParameterToString(notRequiredNullable.Value); uriBuilderLocalVar.Query = parseQueryStringLocalVar.ToString(); 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 3fc88d4d403..9aa5ea7d327 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 @@ -42,7 +42,12 @@ namespace Org.OpenAPITools.Model /// double /// float /// int32 + /// int32Range /// int64 + /// int64Negative + /// int64NegativeExclusive + /// int64Positive + /// int64PositiveExclusive /// integer /// None /// A string that is a 10 digit number. Can have leading zeros. @@ -52,7 +57,7 @@ namespace Org.OpenAPITools.Model /// 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 int64 = 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, 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) { Byte = @byte; Date = date; @@ -64,7 +69,12 @@ namespace Org.OpenAPITools.Model DoubleOption = @double; FloatOption = @float; Int32Option = int32; + Int32RangeOption = int32Range; Int64Option = int64; + Int64NegativeOption = int64Negative; + Int64NegativeExclusiveOption = int64NegativeExclusive; + Int64PositiveOption = int64Positive; + Int64PositiveExclusiveOption = int64PositiveExclusive; IntegerOption = integer; PatternWithBackslashOption = patternWithBackslash; PatternWithDigitsOption = patternWithDigits; @@ -182,6 +192,19 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int32")] public int? Int32 { get { return this.Int32Option; } set { this.Int32Option = new Option(value); } } + /// + /// Used to track the state of Int32Range + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int32RangeOption { get; private set; } + + /// + /// Gets or Sets Int32Range + /// + [JsonPropertyName("int32Range")] + public int? Int32Range { get { return this.Int32RangeOption; } set { this.Int32RangeOption = new Option(value); } } + /// /// Used to track the state of Int64 /// @@ -195,6 +218,58 @@ namespace Org.OpenAPITools.Model [JsonPropertyName("int64")] public long? Int64 { get { return this.Int64Option; } set { this.Int64Option = new Option(value); } } + /// + /// Used to track the state of Int64Negative + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeOption { get; private set; } + + /// + /// Gets or Sets Int64Negative + /// + [JsonPropertyName("int64Negative")] + public long? Int64Negative { get { return this.Int64NegativeOption; } set { this.Int64NegativeOption = new Option(value); } } + + /// + /// Used to track the state of Int64NegativeExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64NegativeExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64NegativeExclusive + /// + [JsonPropertyName("int64NegativeExclusive")] + public long? Int64NegativeExclusive { get { return this.Int64NegativeExclusiveOption; } set { this.Int64NegativeExclusiveOption = new Option(value); } } + + /// + /// Used to track the state of Int64Positive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveOption { get; private set; } + + /// + /// Gets or Sets Int64Positive + /// + [JsonPropertyName("int64Positive")] + public long? Int64Positive { get { return this.Int64PositiveOption; } set { this.Int64PositiveOption = new Option(value); } } + + /// + /// Used to track the state of Int64PositiveExclusive + /// + [JsonIgnore] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public Option Int64PositiveExclusiveOption { get; private set; } + + /// + /// Gets or Sets Int64PositiveExclusive + /// + [JsonPropertyName("int64PositiveExclusive")] + public long? Int64PositiveExclusive { get { return this.Int64PositiveExclusiveOption; } set { this.Int64PositiveExclusiveOption = new Option(value); } } + /// /// Used to track the state of Integer /// @@ -327,7 +402,12 @@ namespace Org.OpenAPITools.Model sb.Append(" Double: ").Append(Double).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); + sb.Append(" Int64Negative: ").Append(Int64Negative).Append("\n"); + sb.Append(" Int64NegativeExclusive: ").Append(Int64NegativeExclusive).Append("\n"); + sb.Append(" Int64Positive: ").Append(Int64Positive).Append("\n"); + sb.Append(" Int64PositiveExclusive: ").Append(Int64PositiveExclusive).Append("\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n"); @@ -408,6 +488,42 @@ namespace Org.OpenAPITools.Model yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // Int32Range (int) maximum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value > (int)2147483647) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value less than or equal to 2147483647.", new [] { "Int32Range" }); + } + + // Int32Range (int) minimum + if (this.Int32RangeOption.IsSet && this.Int32RangeOption.Value < (int)-2147483648) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value greater than or equal to -2147483648.", new [] { "Int32Range" }); + } + + // Int64Negative (long) maximum + if (this.Int64NegativeOption.IsSet && this.Int64NegativeOption.Value > (long)-2147483649) + { + yield return new ValidationResult("Invalid value for Int64Negative, must be a value less than or equal to -2147483649.", new [] { "Int64Negative" }); + } + + // Int64NegativeExclusive (long) maximum + if (this.Int64NegativeExclusiveOption.IsSet && this.Int64NegativeExclusiveOption.Value <= (long)-2147483648) + { + yield return new ValidationResult("Invalid value for Int64NegativeExclusive, must be a value less than -2147483648.", new [] { "Int64NegativeExclusive" }); + } + + // Int64Positive (long) minimum + if (this.Int64PositiveOption.IsSet && this.Int64PositiveOption.Value < (long)2147483648) + { + yield return new ValidationResult("Invalid value for Int64Positive, must be a value greater than or equal to 2147483648.", new [] { "Int64Positive" }); + } + + // Int64PositiveExclusive (long) minimum + if (this.Int64PositiveExclusiveOption.IsSet && this.Int64PositiveExclusiveOption.Value < (long)2147483647) + { + yield return new ValidationResult("Invalid value for Int64PositiveExclusive, must be a value greater than 2147483647.", new [] { "Int64PositiveExclusive" }); + } + // Integer (int) maximum if (this.IntegerOption.IsSet && this.IntegerOption.Value > (int)100) { @@ -518,7 +634,12 @@ namespace Org.OpenAPITools.Model Option varDouble = default; Option varFloat = 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; @@ -582,10 +703,30 @@ namespace Org.OpenAPITools.Model if (utf8JsonReader.TokenType != JsonTokenType.Null) int32 = new Option(utf8JsonReader.GetInt32()); break; + case "int32Range": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int32Range = new Option(utf8JsonReader.GetInt32()); + break; case "int64": if (utf8JsonReader.TokenType != JsonTokenType.Null) int64 = new Option(utf8JsonReader.GetInt64()); break; + case "int64Negative": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Negative = new Option(utf8JsonReader.GetInt32()); + break; + case "int64NegativeExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64NegativeExclusive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64Positive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64Positive = new Option(utf8JsonReader.GetInt32()); + break; + case "int64PositiveExclusive": + if (utf8JsonReader.TokenType != JsonTokenType.Null) + int64PositiveExclusive = new Option(utf8JsonReader.GetInt32()); + break; case "integer": if (utf8JsonReader.TokenType != JsonTokenType.Null) integer = new Option(utf8JsonReader.GetInt32()); @@ -662,9 +803,24 @@ namespace Org.OpenAPITools.Model if (int32.IsSet && int32.Value == null) throw new ArgumentNullException(nameof(int32), "Property is not nullable for class FormatTest."); + if (int32Range.IsSet && int32Range.Value == null) + throw new ArgumentNullException(nameof(int32Range), "Property is not nullable for class FormatTest."); + if (int64.IsSet && int64.Value == null) throw new ArgumentNullException(nameof(int64), "Property is not nullable for class FormatTest."); + if (int64Negative.IsSet && int64Negative.Value == null) + throw new ArgumentNullException(nameof(int64Negative), "Property is not nullable for class FormatTest."); + + if (int64NegativeExclusive.IsSet && int64NegativeExclusive.Value == null) + throw new ArgumentNullException(nameof(int64NegativeExclusive), "Property is not nullable for class FormatTest."); + + if (int64Positive.IsSet && int64Positive.Value == null) + throw new ArgumentNullException(nameof(int64Positive), "Property is not nullable for class FormatTest."); + + if (int64PositiveExclusive.IsSet && int64PositiveExclusive.Value == null) + throw new ArgumentNullException(nameof(int64PositiveExclusive), "Property is not nullable for class FormatTest."); + if (integer.IsSet && integer.Value == null) throw new ArgumentNullException(nameof(integer), "Property is not nullable for class FormatTest."); @@ -689,7 +845,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, int64, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid); + 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); } /// @@ -767,9 +923,24 @@ namespace Org.OpenAPITools.Model if (formatTest.Int32Option.IsSet) writer.WriteNumber("int32", formatTest.Int32Option.Value.Value); + if (formatTest.Int32RangeOption.IsSet) + writer.WriteNumber("int32Range", formatTest.Int32RangeOption.Value.Value); + if (formatTest.Int64Option.IsSet) writer.WriteNumber("int64", formatTest.Int64Option.Value.Value); + if (formatTest.Int64NegativeOption.IsSet) + writer.WriteNumber("int64Negative", formatTest.Int64NegativeOption.Value.Value); + + if (formatTest.Int64NegativeExclusiveOption.IsSet) + writer.WriteNumber("int64NegativeExclusive", formatTest.Int64NegativeExclusiveOption.Value.Value); + + if (formatTest.Int64PositiveOption.IsSet) + writer.WriteNumber("int64Positive", formatTest.Int64PositiveOption.Value.Value); + + if (formatTest.Int64PositiveExclusiveOption.IsSet) + writer.WriteNumber("int64PositiveExclusive", formatTest.Int64PositiveExclusiveOption.Value.Value); + if (formatTest.IntegerOption.IsSet) writer.WriteNumber("integer", formatTest.IntegerOption.Value.Value); 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 95cd969e02c..ced7c2c5db9 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 @@ -1617,6 +1617,24 @@ components: maximum: 200 minimum: 20 type: integer + int32Range: + maximum: 2147483647 + minimum: -2147483648 + type: integer + int64Positive: + minimum: 2147483648 + type: integer + int64Negative: + maximum: -2147483649 + type: integer + int64PositiveExclusive: + exclusiveMinimum: true + minimum: 2147483647 + type: integer + int64NegativeExclusive: + exclusiveMaximum: true + maximum: -2147483648 + type: integer unsigned_integer: format: int32 maximum: 200 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 7c06c37839c..c028ca73901 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 @@ -6,6 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Integer** | **int** | | [optional] **Int32** | **int** | | [optional] +**Int32Range** | **int** | | [optional] +**Int64Positive** | **long** | | [optional] +**Int64Negative** | **long** | | [optional] +**Int64PositiveExclusive** | **long** | | [optional] +**Int64NegativeExclusive** | **long** | | [optional] **UnsignedInteger** | **uint** | | [optional] **Int64** | **long** | | [optional] **UnsignedLong** | **ulong** | | [optional] 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 5781be7cf5b..87fac8c15b6 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 @@ -46,6 +46,11 @@ namespace Org.OpenAPITools.Model /// /// integer. /// int32. + /// int32Range. + /// int64Positive. + /// int64Negative. + /// int64PositiveExclusive. + /// int64NegativeExclusive. /// unsignedInteger. /// int64. /// unsignedLong. @@ -63,7 +68,7 @@ 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), 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)) + 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)) { this.Number = number; // to ensure "varByte" is required (not null) @@ -81,6 +86,11 @@ namespace Org.OpenAPITools.Model this.Password = password; this.Integer = integer; this.Int32 = int32; + this.Int32Range = int32Range; + this.Int64Positive = int64Positive; + this.Int64Negative = int64Negative; + this.Int64PositiveExclusive = int64PositiveExclusive; + this.Int64NegativeExclusive = int64NegativeExclusive; this.UnsignedInteger = unsignedInteger; this.Int64 = int64; this.UnsignedLong = unsignedLong; @@ -109,6 +119,36 @@ namespace Org.OpenAPITools.Model [DataMember(Name = "int32", EmitDefaultValue = false)] public int Int32 { get; set; } + /// + /// Gets or Sets Int32Range + /// + [DataMember(Name = "int32Range", EmitDefaultValue = false)] + public int Int32Range { get; set; } + + /// + /// Gets or Sets Int64Positive + /// + [DataMember(Name = "int64Positive", EmitDefaultValue = false)] + public long Int64Positive { get; set; } + + /// + /// Gets or Sets Int64Negative + /// + [DataMember(Name = "int64Negative", EmitDefaultValue = false)] + public long Int64Negative { get; set; } + + /// + /// Gets or Sets Int64PositiveExclusive + /// + [DataMember(Name = "int64PositiveExclusive", EmitDefaultValue = false)] + public long Int64PositiveExclusive { get; set; } + + /// + /// Gets or Sets Int64NegativeExclusive + /// + [DataMember(Name = "int64NegativeExclusive", EmitDefaultValue = false)] + public long Int64NegativeExclusive { get; set; } + /// /// Gets or Sets UnsignedInteger /// @@ -234,6 +274,11 @@ namespace Org.OpenAPITools.Model sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); + sb.Append(" Int64Positive: ").Append(Int64Positive).Append("\n"); + sb.Append(" Int64Negative: ").Append(Int64Negative).Append("\n"); + sb.Append(" Int64PositiveExclusive: ").Append(Int64PositiveExclusive).Append("\n"); + sb.Append(" Int64NegativeExclusive: ").Append(Int64NegativeExclusive).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); @@ -296,6 +341,11 @@ namespace Org.OpenAPITools.Model int hashCode = 41; hashCode = (hashCode * 59) + this.Integer.GetHashCode(); hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.Int32Range.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64Positive.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64Negative.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64PositiveExclusive.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64NegativeExclusive.GetHashCode(); hashCode = (hashCode * 59) + this.UnsignedInteger.GetHashCode(); hashCode = (hashCode * 59) + this.Int64.GetHashCode(); hashCode = (hashCode * 59) + this.UnsignedLong.GetHashCode(); @@ -382,6 +432,42 @@ namespace Org.OpenAPITools.Model yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // Int32Range (int) maximum + if (this.Int32Range > (int)2147483647) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value less than or equal to 2147483647.", new [] { "Int32Range" }); + } + + // Int32Range (int) minimum + if (this.Int32Range < (int)-2147483648) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value greater than or equal to -2147483648.", new [] { "Int32Range" }); + } + + // Int64Positive (long) minimum + if (this.Int64Positive < (long)2147483648) + { + yield return new ValidationResult("Invalid value for Int64Positive, must be a value greater than or equal to 2147483648.", new [] { "Int64Positive" }); + } + + // Int64Negative (long) maximum + if (this.Int64Negative > (long)-2147483649) + { + yield return new ValidationResult("Invalid value for Int64Negative, must be a value less than or equal to -2147483649.", new [] { "Int64Negative" }); + } + + // Int64PositiveExclusive (long) minimum + if (this.Int64PositiveExclusive < (long)2147483647) + { + yield return new ValidationResult("Invalid value for Int64PositiveExclusive, must be a value greater than 2147483647.", new [] { "Int64PositiveExclusive" }); + } + + // Int64NegativeExclusive (long) maximum + if (this.Int64NegativeExclusive <= (long)-2147483648) + { + yield return new ValidationResult("Invalid value for Int64NegativeExclusive, must be a value less than -2147483648.", new [] { "Int64NegativeExclusive" }); + } + // UnsignedInteger (uint) maximum if (this.UnsignedInteger > (uint)200) { diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/net7/Petstore/api/openapi.yaml index 95cd969e02c..ced7c2c5db9 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/api/openapi.yaml @@ -1617,6 +1617,24 @@ components: maximum: 200 minimum: 20 type: integer + int32Range: + maximum: 2147483647 + minimum: -2147483648 + type: integer + int64Positive: + minimum: 2147483648 + type: integer + int64Negative: + maximum: -2147483649 + type: integer + int64PositiveExclusive: + exclusiveMinimum: true + minimum: 2147483647 + type: integer + int64NegativeExclusive: + exclusiveMaximum: true + maximum: -2147483648 + type: integer unsigned_integer: format: int32 maximum: 200 diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/docs/FormatTest.md b/samples/client/petstore/csharp/restsharp/net7/Petstore/docs/FormatTest.md index 14efa7b0f63..2fe92b2cac8 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/docs/FormatTest.md +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/docs/FormatTest.md @@ -6,6 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Integer** | **int** | | [optional] **Int32** | **int** | | [optional] +**Int32Range** | **int** | | [optional] +**Int64Positive** | **long** | | [optional] +**Int64Negative** | **long** | | [optional] +**Int64PositiveExclusive** | **long** | | [optional] +**Int64NegativeExclusive** | **long** | | [optional] **UnsignedInteger** | **uint** | | [optional] **Int64** | **long** | | [optional] **UnsignedLong** | **ulong** | | [optional] diff --git a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 4ca4eff5ca4..611b3dade2d 100644 --- a/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/restsharp/net7/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -42,6 +42,11 @@ namespace Org.OpenAPITools.Model /// /// integer. /// int32. + /// int32Range. + /// int64Positive. + /// int64Negative. + /// int64PositiveExclusive. + /// int64NegativeExclusive. /// unsignedInteger. /// int64. /// unsignedLong. @@ -59,7 +64,7 @@ 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), 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)) + 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)) { this.Number = number; // to ensure "varByte" is required (not null) @@ -82,6 +87,11 @@ namespace Org.OpenAPITools.Model this.Password = password; this.Integer = integer; this.Int32 = int32; + this.Int32Range = int32Range; + this.Int64Positive = int64Positive; + this.Int64Negative = int64Negative; + this.Int64PositiveExclusive = int64PositiveExclusive; + this.Int64NegativeExclusive = int64NegativeExclusive; this.UnsignedInteger = unsignedInteger; this.Int64 = int64; this.UnsignedLong = unsignedLong; @@ -109,6 +119,36 @@ namespace Org.OpenAPITools.Model [DataMember(Name = "int32", EmitDefaultValue = false)] public int Int32 { get; set; } + /// + /// Gets or Sets Int32Range + /// + [DataMember(Name = "int32Range", EmitDefaultValue = false)] + public int Int32Range { get; set; } + + /// + /// Gets or Sets Int64Positive + /// + [DataMember(Name = "int64Positive", EmitDefaultValue = false)] + public long Int64Positive { get; set; } + + /// + /// Gets or Sets Int64Negative + /// + [DataMember(Name = "int64Negative", EmitDefaultValue = false)] + public long Int64Negative { get; set; } + + /// + /// Gets or Sets Int64PositiveExclusive + /// + [DataMember(Name = "int64PositiveExclusive", EmitDefaultValue = false)] + public long Int64PositiveExclusive { get; set; } + + /// + /// Gets or Sets Int64NegativeExclusive + /// + [DataMember(Name = "int64NegativeExclusive", EmitDefaultValue = false)] + public long Int64NegativeExclusive { get; set; } + /// /// Gets or Sets UnsignedInteger /// @@ -227,6 +267,11 @@ namespace Org.OpenAPITools.Model sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); + sb.Append(" Int64Positive: ").Append(Int64Positive).Append("\n"); + sb.Append(" Int64Negative: ").Append(Int64Negative).Append("\n"); + sb.Append(" Int64PositiveExclusive: ").Append(Int64PositiveExclusive).Append("\n"); + sb.Append(" Int64NegativeExclusive: ").Append(Int64NegativeExclusive).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); @@ -288,6 +333,11 @@ namespace Org.OpenAPITools.Model int hashCode = 41; hashCode = (hashCode * 59) + this.Integer.GetHashCode(); hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.Int32Range.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64Positive.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64Negative.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64PositiveExclusive.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64NegativeExclusive.GetHashCode(); hashCode = (hashCode * 59) + this.UnsignedInteger.GetHashCode(); hashCode = (hashCode * 59) + this.Int64.GetHashCode(); hashCode = (hashCode * 59) + this.UnsignedLong.GetHashCode(); @@ -370,6 +420,42 @@ namespace Org.OpenAPITools.Model yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // Int32Range (int) maximum + if (this.Int32Range > (int)2147483647) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value less than or equal to 2147483647.", new [] { "Int32Range" }); + } + + // Int32Range (int) minimum + if (this.Int32Range < (int)-2147483648) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value greater than or equal to -2147483648.", new [] { "Int32Range" }); + } + + // Int64Positive (long) minimum + if (this.Int64Positive < (long)2147483648) + { + yield return new ValidationResult("Invalid value for Int64Positive, must be a value greater than or equal to 2147483648.", new [] { "Int64Positive" }); + } + + // Int64Negative (long) maximum + if (this.Int64Negative > (long)-2147483649) + { + yield return new ValidationResult("Invalid value for Int64Negative, must be a value less than or equal to -2147483649.", new [] { "Int64Negative" }); + } + + // Int64PositiveExclusive (long) minimum + if (this.Int64PositiveExclusive < (long)2147483647) + { + yield return new ValidationResult("Invalid value for Int64PositiveExclusive, must be a value greater than 2147483647.", new [] { "Int64PositiveExclusive" }); + } + + // Int64NegativeExclusive (long) maximum + if (this.Int64NegativeExclusive <= (long)-2147483648) + { + yield return new ValidationResult("Invalid value for Int64NegativeExclusive, must be a value less than -2147483648.", new [] { "Int64NegativeExclusive" }); + } + // UnsignedInteger (uint) maximum if (this.UnsignedInteger > (uint)200) { 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 95cd969e02c..ced7c2c5db9 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 @@ -1617,6 +1617,24 @@ components: maximum: 200 minimum: 20 type: integer + int32Range: + maximum: 2147483647 + minimum: -2147483648 + type: integer + int64Positive: + minimum: 2147483648 + type: integer + int64Negative: + maximum: -2147483649 + type: integer + int64PositiveExclusive: + exclusiveMinimum: true + minimum: 2147483647 + type: integer + int64NegativeExclusive: + exclusiveMaximum: true + maximum: -2147483648 + type: integer unsigned_integer: format: int32 maximum: 200 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 c2144b5e3cf..1b12163e9a6 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 @@ -6,6 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Integer** | **int** | | [optional] **Int32** | **int** | | [optional] +**Int32Range** | **int** | | [optional] +**Int64Positive** | **long** | | [optional] +**Int64Negative** | **long** | | [optional] +**Int64PositiveExclusive** | **long** | | [optional] +**Int64NegativeExclusive** | **long** | | [optional] **UnsignedInteger** | **uint** | | [optional] **Int64** | **long** | | [optional] **UnsignedLong** | **ulong** | | [optional] 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 c31adf8c301..0b59ca8e6ef 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 @@ -45,6 +45,11 @@ namespace Org.OpenAPITools.Model /// /// integer. /// int32. + /// int32Range. + /// int64Positive. + /// int64Negative. + /// int64PositiveExclusive. + /// int64NegativeExclusive. /// unsignedInteger. /// int64. /// unsignedLong. @@ -62,7 +67,7 @@ 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), 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)) + 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)) { this._Number = number; // to ensure "varByte" is required (not null) @@ -88,6 +93,31 @@ namespace Org.OpenAPITools.Model { this._flagInt32 = true; } + this._Int32Range = int32Range; + if (this.Int32Range != null) + { + this._flagInt32Range = true; + } + this._Int64Positive = int64Positive; + if (this.Int64Positive != null) + { + this._flagInt64Positive = true; + } + this._Int64Negative = int64Negative; + if (this.Int64Negative != null) + { + this._flagInt64Negative = true; + } + this._Int64PositiveExclusive = int64PositiveExclusive; + if (this.Int64PositiveExclusive != null) + { + this._flagInt64PositiveExclusive = true; + } + this._Int64NegativeExclusive = int64NegativeExclusive; + if (this.Int64NegativeExclusive != null) + { + this._flagInt64NegativeExclusive = true; + } this._UnsignedInteger = unsignedInteger; if (this.UnsignedInteger != null) { @@ -205,6 +235,126 @@ namespace Org.OpenAPITools.Model return _flagInt32; } /// + /// Gets or Sets Int32Range + /// + [DataMember(Name = "int32Range", EmitDefaultValue = false)] + public int Int32Range + { + get{ return _Int32Range;} + set + { + _Int32Range = value; + _flagInt32Range = true; + } + } + private int _Int32Range; + private bool _flagInt32Range; + + /// + /// Returns false as Int32Range should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeInt32Range() + { + return _flagInt32Range; + } + /// + /// Gets or Sets Int64Positive + /// + [DataMember(Name = "int64Positive", EmitDefaultValue = false)] + public long Int64Positive + { + get{ return _Int64Positive;} + set + { + _Int64Positive = value; + _flagInt64Positive = true; + } + } + private long _Int64Positive; + private bool _flagInt64Positive; + + /// + /// Returns false as Int64Positive should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeInt64Positive() + { + return _flagInt64Positive; + } + /// + /// Gets or Sets Int64Negative + /// + [DataMember(Name = "int64Negative", EmitDefaultValue = false)] + public long Int64Negative + { + get{ return _Int64Negative;} + set + { + _Int64Negative = value; + _flagInt64Negative = true; + } + } + private long _Int64Negative; + private bool _flagInt64Negative; + + /// + /// Returns false as Int64Negative should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeInt64Negative() + { + return _flagInt64Negative; + } + /// + /// Gets or Sets Int64PositiveExclusive + /// + [DataMember(Name = "int64PositiveExclusive", EmitDefaultValue = false)] + public long Int64PositiveExclusive + { + get{ return _Int64PositiveExclusive;} + set + { + _Int64PositiveExclusive = value; + _flagInt64PositiveExclusive = true; + } + } + private long _Int64PositiveExclusive; + private bool _flagInt64PositiveExclusive; + + /// + /// Returns false as Int64PositiveExclusive should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeInt64PositiveExclusive() + { + return _flagInt64PositiveExclusive; + } + /// + /// Gets or Sets Int64NegativeExclusive + /// + [DataMember(Name = "int64NegativeExclusive", EmitDefaultValue = false)] + public long Int64NegativeExclusive + { + get{ return _Int64NegativeExclusive;} + set + { + _Int64NegativeExclusive = value; + _flagInt64NegativeExclusive = true; + } + } + private long _Int64NegativeExclusive; + private bool _flagInt64NegativeExclusive; + + /// + /// Returns false as Int64NegativeExclusive should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeInt64NegativeExclusive() + { + return _flagInt64NegativeExclusive; + } + /// /// Gets or Sets UnsignedInteger /// [DataMember(Name = "unsigned_integer", EmitDefaultValue = false)] @@ -635,6 +785,11 @@ namespace Org.OpenAPITools.Model sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); + sb.Append(" Int64Positive: ").Append(Int64Positive).Append("\n"); + sb.Append(" Int64Negative: ").Append(Int64Negative).Append("\n"); + sb.Append(" Int64PositiveExclusive: ").Append(Int64PositiveExclusive).Append("\n"); + sb.Append(" Int64NegativeExclusive: ").Append(Int64NegativeExclusive).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); @@ -697,6 +852,11 @@ namespace Org.OpenAPITools.Model int hashCode = 41; hashCode = (hashCode * 59) + this.Integer.GetHashCode(); hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.Int32Range.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64Positive.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64Negative.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64PositiveExclusive.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64NegativeExclusive.GetHashCode(); hashCode = (hashCode * 59) + this.UnsignedInteger.GetHashCode(); hashCode = (hashCode * 59) + this.Int64.GetHashCode(); hashCode = (hashCode * 59) + this.UnsignedLong.GetHashCode(); @@ -783,6 +943,42 @@ namespace Org.OpenAPITools.Model yield return new ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.", new [] { "Int32" }); } + // Int32Range (int) maximum + if (this.Int32Range > (int)2147483647) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value less than or equal to 2147483647.", new [] { "Int32Range" }); + } + + // Int32Range (int) minimum + if (this.Int32Range < (int)-2147483648) + { + yield return new ValidationResult("Invalid value for Int32Range, must be a value greater than or equal to -2147483648.", new [] { "Int32Range" }); + } + + // Int64Positive (long) minimum + if (this.Int64Positive < (long)2147483648) + { + yield return new ValidationResult("Invalid value for Int64Positive, must be a value greater than or equal to 2147483648.", new [] { "Int64Positive" }); + } + + // Int64Negative (long) maximum + if (this.Int64Negative > (long)-2147483649) + { + yield return new ValidationResult("Invalid value for Int64Negative, must be a value less than or equal to -2147483649.", new [] { "Int64Negative" }); + } + + // Int64PositiveExclusive (long) minimum + if (this.Int64PositiveExclusive < (long)2147483647) + { + yield return new ValidationResult("Invalid value for Int64PositiveExclusive, must be a value greater than 2147483647.", new [] { "Int64PositiveExclusive" }); + } + + // Int64NegativeExclusive (long) maximum + if (this.Int64NegativeExclusive <= (long)-2147483648) + { + yield return new ValidationResult("Invalid value for Int64NegativeExclusive, must be a value less than -2147483648.", new [] { "Int64NegativeExclusive" }); + } + // UnsignedInteger (uint) maximum if (this.UnsignedInteger > (uint)200) { 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 95cd969e02c..ced7c2c5db9 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 @@ -1617,6 +1617,24 @@ components: maximum: 200 minimum: 20 type: integer + int32Range: + maximum: 2147483647 + minimum: -2147483648 + type: integer + int64Positive: + minimum: 2147483648 + type: integer + int64Negative: + maximum: -2147483649 + type: integer + int64PositiveExclusive: + exclusiveMinimum: true + minimum: 2147483647 + type: integer + int64NegativeExclusive: + exclusiveMaximum: true + maximum: -2147483648 + type: integer unsigned_integer: format: int32 maximum: 200 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 c2144b5e3cf..1b12163e9a6 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 @@ -6,6 +6,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Integer** | **int** | | [optional] **Int32** | **int** | | [optional] +**Int32Range** | **int** | | [optional] +**Int64Positive** | **long** | | [optional] +**Int64Negative** | **long** | | [optional] +**Int64PositiveExclusive** | **long** | | [optional] +**Int64NegativeExclusive** | **long** | | [optional] **UnsignedInteger** | **uint** | | [optional] **Int64** | **long** | | [optional] **UnsignedLong** | **ulong** | | [optional] 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 58e9af3d249..75f2f9581cf 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 @@ -40,6 +40,11 @@ namespace Org.OpenAPITools.Model /// /// integer. /// int32. + /// int32Range. + /// int64Positive. + /// int64Negative. + /// int64PositiveExclusive. + /// int64NegativeExclusive. /// unsignedInteger. /// int64. /// unsignedLong. @@ -57,7 +62,7 @@ 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), 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)) + 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)) { this.Number = number; // to ensure "varByte" is required (not null) @@ -75,6 +80,11 @@ namespace Org.OpenAPITools.Model this.Password = password; this.Integer = integer; this.Int32 = int32; + this.Int32Range = int32Range; + this.Int64Positive = int64Positive; + this.Int64Negative = int64Negative; + this.Int64PositiveExclusive = int64PositiveExclusive; + this.Int64NegativeExclusive = int64NegativeExclusive; this.UnsignedInteger = unsignedInteger; this.Int64 = int64; this.UnsignedLong = unsignedLong; @@ -102,6 +112,36 @@ namespace Org.OpenAPITools.Model [DataMember(Name = "int32", EmitDefaultValue = false)] public int Int32 { get; set; } + /// + /// Gets or Sets Int32Range + /// + [DataMember(Name = "int32Range", EmitDefaultValue = false)] + public int Int32Range { get; set; } + + /// + /// Gets or Sets Int64Positive + /// + [DataMember(Name = "int64Positive", EmitDefaultValue = false)] + public long Int64Positive { get; set; } + + /// + /// Gets or Sets Int64Negative + /// + [DataMember(Name = "int64Negative", EmitDefaultValue = false)] + public long Int64Negative { get; set; } + + /// + /// Gets or Sets Int64PositiveExclusive + /// + [DataMember(Name = "int64PositiveExclusive", EmitDefaultValue = false)] + public long Int64PositiveExclusive { get; set; } + + /// + /// Gets or Sets Int64NegativeExclusive + /// + [DataMember(Name = "int64NegativeExclusive", EmitDefaultValue = false)] + public long Int64NegativeExclusive { get; set; } + /// /// Gets or Sets UnsignedInteger /// @@ -221,6 +261,11 @@ namespace Org.OpenAPITools.Model sb.Append("class FormatTest {\n"); sb.Append(" Integer: ").Append(Integer).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); + sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); + sb.Append(" Int64Positive: ").Append(Int64Positive).Append("\n"); + sb.Append(" Int64Negative: ").Append(Int64Negative).Append("\n"); + sb.Append(" Int64PositiveExclusive: ").Append(Int64PositiveExclusive).Append("\n"); + sb.Append(" Int64NegativeExclusive: ").Append(Int64NegativeExclusive).Append("\n"); sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n"); sb.Append(" Int64: ").Append(Int64).Append("\n"); sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n"); @@ -281,6 +326,26 @@ namespace Org.OpenAPITools.Model this.Int32 == input.Int32 || this.Int32.Equals(input.Int32) ) && + ( + this.Int32Range == input.Int32Range || + this.Int32Range.Equals(input.Int32Range) + ) && + ( + this.Int64Positive == input.Int64Positive || + this.Int64Positive.Equals(input.Int64Positive) + ) && + ( + this.Int64Negative == input.Int64Negative || + this.Int64Negative.Equals(input.Int64Negative) + ) && + ( + this.Int64PositiveExclusive == input.Int64PositiveExclusive || + this.Int64PositiveExclusive.Equals(input.Int64PositiveExclusive) + ) && + ( + this.Int64NegativeExclusive == input.Int64NegativeExclusive || + this.Int64NegativeExclusive.Equals(input.Int64NegativeExclusive) + ) && ( this.UnsignedInteger == input.UnsignedInteger || this.UnsignedInteger.Equals(input.UnsignedInteger) @@ -372,6 +437,11 @@ namespace Org.OpenAPITools.Model int hashCode = 41; hashCode = (hashCode * 59) + this.Integer.GetHashCode(); hashCode = (hashCode * 59) + this.Int32.GetHashCode(); + hashCode = (hashCode * 59) + this.Int32Range.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64Positive.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64Negative.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64PositiveExclusive.GetHashCode(); + hashCode = (hashCode * 59) + this.Int64NegativeExclusive.GetHashCode(); hashCode = (hashCode * 59) + this.UnsignedInteger.GetHashCode(); hashCode = (hashCode * 59) + this.Int64.GetHashCode(); hashCode = (hashCode * 59) + this.UnsignedLong.GetHashCode();