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 fbfe2cf39a77..eac38bf01e46 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 @@ -629,7 +629,7 @@ public Map postProcessAllModels(Map objs) List allOf = composedSchemas.getAllOf(); if (allOf != null) { for (CodegenProperty property : allOf) { - property.name = patchPropertyName(model, camelize(property.baseType), composedPropertyNames); + property.name = patchPropertyName(model, property, camelize(property.baseType), composedPropertyNames); patchPropertyVendorExtensions(property); } } @@ -638,7 +638,7 @@ public Map postProcessAllModels(Map objs) if (anyOf != null) { removePropertiesDeclaredInComposedTypes(objs, model, anyOf); for (CodegenProperty property : anyOf) { - property.name = patchPropertyName(model, camelize(property.baseType), composedPropertyNames); + property.name = patchPropertyName(model, property, camelize(property.baseType), composedPropertyNames); property.isNullable = true; patchPropertyVendorExtensions(property); property.vendorExtensions.put("x-base-name", model.name.substring(model.name.lastIndexOf('_') + 1)); @@ -649,7 +649,7 @@ public Map postProcessAllModels(Map objs) if (oneOf != null) { removePropertiesDeclaredInComposedTypes(objs, model, oneOf); for (CodegenProperty property : oneOf) { - property.name = patchPropertyName(model, camelize(property.baseType), composedPropertyNames); + property.name = patchPropertyName(model, property, camelize(property.baseType), composedPropertyNames); property.isNullable = true; patchPropertyVendorExtensions(property); property.vendorExtensions.put("x-base-name", model.name.substring(model.name.lastIndexOf('_') + 1)); @@ -716,7 +716,51 @@ private boolean modelIsMutable(CodegenModel model, Set processed) { protected void removePropertiesDeclaredInComposedTypes(Map objs, CodegenModel model, List composedProperties) { } - private String patchPropertyName(CodegenModel model, String value, Set composedPropertyNames) { + /** + * If the model has duplicate proprety names, just make it unique + * This can happen for base names like "id" and "@id" + * @param model + * @param property + * @param value + * @return + */ + private String setUniquePropertyName(CodegenModel model, CodegenProperty property, String value) { + if (property.name.equalsIgnoreCase(property.baseName)) { + return value; + } + + Optional alreadyUpdatedProperty = model.allVars.stream() + .filter(p -> !p.name.equals(property.name) && p.baseName.equals(property.baseName)) + .collect(Collectors.toList()) + .stream() + .findFirst(); + + if (alreadyUpdatedProperty.isPresent()) { + // above iterates allVars, which may have already been corrected + return alreadyUpdatedProperty.get().name; + } + + final String tmp = value; + + long count = model.allVars.stream() + .filter(v -> v.name.equalsIgnoreCase(tmp)) + .count(); + + if (count > 1) { + value = value + count; + value = setUniquePropertyName(model, property, value); + } + + return value; + } + + /** + * Fixes nested maps so the generic type is defined + * Convertes List> to List> + */ + private String patchPropertyName(CodegenModel model, CodegenProperty property, String value, Set composedPropertyNames) { + value = setUniquePropertyName(model, property, value); + String name = escapeReservedWord(model, value); if (name.startsWith(AbstractCSharpCodegen.invalidParameterNamePrefix)) { @@ -799,7 +843,7 @@ protected void patchProperty(Map enumRefs, CodegenModel mo patchPropertyVendorExtensions(property); - property.name = patchPropertyName(model, property.name, null); + property.name = patchPropertyName(model, property, property.name, null); patchNestedMaps(property); 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 d4a570cdb157..53a2e45a7817 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 @@ -1780,6 +1780,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string EnumClass: type: string default: '-efg' diff --git a/samples/client/petstore/csharp/generichost/net4.7/FormModels/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net4.7/FormModels/api/openapi.yaml index 3afd9359ab7d..816608604456 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 @@ -1673,6 +1673,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date 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 950546c1812f..8ba789fb729e 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 @@ -13,6 +13,8 @@ Name | Type | Description | Notes **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] **Double** | **double** | | [optional] +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] **Int32Range** | **int** | | [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 fe89f7090c4c..a144a3103489 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 @@ -134,6 +134,24 @@ public void DoubleTest() // TODO unit test for the property 'Double' } + /// + /// Test the property 'DuplicatePropertyName2' + /// + [Fact] + public void DuplicatePropertyName2Test() + { + // TODO unit test for the property 'DuplicatePropertyName2' + } + + /// + /// Test the property 'DuplicatePropertyName' + /// + [Fact] + public void DuplicatePropertyNameTest() + { + // TODO unit test for the property 'DuplicatePropertyName' + } + /// /// Test the property 'Float' /// 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 1887346c88b6..ae0854b6be45 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 @@ -41,6 +41,8 @@ public partial class FormatTest : IValidatableObject /// dateTime /// decimal /// double + /// duplicatePropertyName2 + /// duplicatePropertyName /// float /// int32 /// int32Range @@ -59,7 +61,7 @@ public partial class FormatTest : IValidatableObject /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateTime date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateTime date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option duplicatePropertyName2 = default, Option duplicatePropertyName = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; @@ -70,6 +72,8 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password, DateTimeOption = dateTime; DecimalOption = @decimal; DoubleOption = @double; + DuplicatePropertyName2Option = duplicatePropertyName2; + DuplicatePropertyNameOption = duplicatePropertyName; FloatOption = @float; Int32Option = int32; Int32RangeOption = int32Range; @@ -176,6 +180,32 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password, [JsonPropertyName("double")] public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new Option(value); } } + /// + /// Used to track the state of DuplicatePropertyName2 + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyName2Option { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [JsonPropertyName("duplicate_property_name")] + public string DuplicatePropertyName2 { get { return this.DuplicatePropertyName2Option; } set { this.DuplicatePropertyName2Option = new Option(value); } } + + /// + /// Used to track the state of DuplicatePropertyName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyNameOption { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [JsonPropertyName("@duplicate_property_name")] + public string DuplicatePropertyName { get { return this.DuplicatePropertyNameOption; } set { this.DuplicatePropertyNameOption = new Option(value); } } + /// /// Used to track the state of Float /// @@ -424,6 +454,8 @@ public override string ToString() sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); @@ -658,6 +690,8 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo Option dateTime = default; Option varDecimal = default; Option varDouble = default; + Option duplicatePropertyName2 = default; + Option duplicatePropertyName = default; Option varFloat = default; Option int32 = default; Option int32Range = default; @@ -718,6 +752,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo case "double": varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; + case "duplicate_property_name": + duplicatePropertyName2 = new Option(utf8JsonReader.GetString()); + break; + case "@duplicate_property_name": + duplicatePropertyName = new Option(utf8JsonReader.GetString()); + break; case "float": varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; @@ -817,6 +857,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (varDouble.IsSet && varDouble.Value == null) throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + if (duplicatePropertyName2.IsSet && duplicatePropertyName2.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName2), "Property is not nullable for class FormatTest."); + + if (duplicatePropertyName.IsSet && duplicatePropertyName.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName), "Property is not nullable for class FormatTest."); + if (varFloat.IsSet && varFloat.Value == null) throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); @@ -868,7 +914,7 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo 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, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, duplicatePropertyName2, duplicatePropertyName, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -904,6 +950,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + if (formatTest.DuplicatePropertyName2Option.IsSet && formatTest.DuplicatePropertyName2 == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName2), "Property is required for class FormatTest."); + + if (formatTest.DuplicatePropertyNameOption.IsSet && formatTest.DuplicatePropertyName == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName), "Property is required for class FormatTest."); + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); @@ -942,6 +994,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.DoubleOption.IsSet) writer.WriteNumber("double", formatTest.DoubleOption.Value.Value); + if (formatTest.DuplicatePropertyName2Option.IsSet) + writer.WriteString("duplicate_property_name", formatTest.DuplicatePropertyName2); + + if (formatTest.DuplicatePropertyNameOption.IsSet) + writer.WriteString("@duplicate_property_name", formatTest.DuplicatePropertyName); + if (formatTest.FloatOption.IsSet) writer.WriteNumber("float", formatTest.FloatOption.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 d86a1d2f6d87..1aa598117f1a 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 @@ -1714,6 +1714,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date 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 950546c1812f..8ba789fb729e 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 @@ -13,6 +13,8 @@ Name | Type | Description | Notes **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] **Double** | **double** | | [optional] +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] **Int32Range** | **int** | | [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 fe89f7090c4c..a144a3103489 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 @@ -134,6 +134,24 @@ public void DoubleTest() // TODO unit test for the property 'Double' } + /// + /// Test the property 'DuplicatePropertyName2' + /// + [Fact] + public void DuplicatePropertyName2Test() + { + // TODO unit test for the property 'DuplicatePropertyName2' + } + + /// + /// Test the property 'DuplicatePropertyName' + /// + [Fact] + public void DuplicatePropertyNameTest() + { + // TODO unit test for the property 'DuplicatePropertyName' + } + /// /// Test the property 'Float' /// 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 1887346c88b6..ae0854b6be45 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 @@ -41,6 +41,8 @@ public partial class FormatTest : IValidatableObject /// dateTime /// decimal /// double + /// duplicatePropertyName2 + /// duplicatePropertyName /// float /// int32 /// int32Range @@ -59,7 +61,7 @@ public partial class FormatTest : IValidatableObject /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateTime date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateTime date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option duplicatePropertyName2 = default, Option duplicatePropertyName = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; @@ -70,6 +72,8 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password, DateTimeOption = dateTime; DecimalOption = @decimal; DoubleOption = @double; + DuplicatePropertyName2Option = duplicatePropertyName2; + DuplicatePropertyNameOption = duplicatePropertyName; FloatOption = @float; Int32Option = int32; Int32RangeOption = int32Range; @@ -176,6 +180,32 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password, [JsonPropertyName("double")] public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new Option(value); } } + /// + /// Used to track the state of DuplicatePropertyName2 + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyName2Option { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [JsonPropertyName("duplicate_property_name")] + public string DuplicatePropertyName2 { get { return this.DuplicatePropertyName2Option; } set { this.DuplicatePropertyName2Option = new Option(value); } } + + /// + /// Used to track the state of DuplicatePropertyName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyNameOption { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [JsonPropertyName("@duplicate_property_name")] + public string DuplicatePropertyName { get { return this.DuplicatePropertyNameOption; } set { this.DuplicatePropertyNameOption = new Option(value); } } + /// /// Used to track the state of Float /// @@ -424,6 +454,8 @@ public override string ToString() sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); @@ -658,6 +690,8 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo Option dateTime = default; Option varDecimal = default; Option varDouble = default; + Option duplicatePropertyName2 = default; + Option duplicatePropertyName = default; Option varFloat = default; Option int32 = default; Option int32Range = default; @@ -718,6 +752,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo case "double": varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; + case "duplicate_property_name": + duplicatePropertyName2 = new Option(utf8JsonReader.GetString()); + break; + case "@duplicate_property_name": + duplicatePropertyName = new Option(utf8JsonReader.GetString()); + break; case "float": varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; @@ -817,6 +857,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (varDouble.IsSet && varDouble.Value == null) throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + if (duplicatePropertyName2.IsSet && duplicatePropertyName2.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName2), "Property is not nullable for class FormatTest."); + + if (duplicatePropertyName.IsSet && duplicatePropertyName.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName), "Property is not nullable for class FormatTest."); + if (varFloat.IsSet && varFloat.Value == null) throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); @@ -868,7 +914,7 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo 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, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, duplicatePropertyName2, duplicatePropertyName, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -904,6 +950,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + if (formatTest.DuplicatePropertyName2Option.IsSet && formatTest.DuplicatePropertyName2 == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName2), "Property is required for class FormatTest."); + + if (formatTest.DuplicatePropertyNameOption.IsSet && formatTest.DuplicatePropertyName == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName), "Property is required for class FormatTest."); + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); @@ -942,6 +994,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.DoubleOption.IsSet) writer.WriteNumber("double", formatTest.DoubleOption.Value.Value); + if (formatTest.DuplicatePropertyName2Option.IsSet) + writer.WriteString("duplicate_property_name", formatTest.DuplicatePropertyName2); + + if (formatTest.DuplicatePropertyNameOption.IsSet) + writer.WriteString("@duplicate_property_name", formatTest.DuplicatePropertyName); + if (formatTest.FloatOption.IsSet) writer.WriteNumber("float", formatTest.FloatOption.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 3afd9359ab7d..816608604456 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 @@ -1673,6 +1673,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date 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 950546c1812f..8ba789fb729e 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 @@ -13,6 +13,8 @@ Name | Type | Description | Notes **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] **Double** | **double** | | [optional] +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] **Int32Range** | **int** | | [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 fe89f7090c4c..a144a3103489 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 @@ -134,6 +134,24 @@ public void DoubleTest() // TODO unit test for the property 'Double' } + /// + /// Test the property 'DuplicatePropertyName2' + /// + [Fact] + public void DuplicatePropertyName2Test() + { + // TODO unit test for the property 'DuplicatePropertyName2' + } + + /// + /// Test the property 'DuplicatePropertyName' + /// + [Fact] + public void DuplicatePropertyNameTest() + { + // TODO unit test for the property 'DuplicatePropertyName' + } + /// /// Test the property 'Float' /// 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 1887346c88b6..ae0854b6be45 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 @@ -41,6 +41,8 @@ public partial class FormatTest : IValidatableObject /// dateTime /// decimal /// double + /// duplicatePropertyName2 + /// duplicatePropertyName /// float /// int32 /// int32Range @@ -59,7 +61,7 @@ public partial class FormatTest : IValidatableObject /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateTime date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateTime date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option duplicatePropertyName2 = default, Option duplicatePropertyName = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; @@ -70,6 +72,8 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password, DateTimeOption = dateTime; DecimalOption = @decimal; DoubleOption = @double; + DuplicatePropertyName2Option = duplicatePropertyName2; + DuplicatePropertyNameOption = duplicatePropertyName; FloatOption = @float; Int32Option = int32; Int32RangeOption = int32Range; @@ -176,6 +180,32 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password, [JsonPropertyName("double")] public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new Option(value); } } + /// + /// Used to track the state of DuplicatePropertyName2 + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyName2Option { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [JsonPropertyName("duplicate_property_name")] + public string DuplicatePropertyName2 { get { return this.DuplicatePropertyName2Option; } set { this.DuplicatePropertyName2Option = new Option(value); } } + + /// + /// Used to track the state of DuplicatePropertyName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyNameOption { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [JsonPropertyName("@duplicate_property_name")] + public string DuplicatePropertyName { get { return this.DuplicatePropertyNameOption; } set { this.DuplicatePropertyNameOption = new Option(value); } } + /// /// Used to track the state of Float /// @@ -424,6 +454,8 @@ public override string ToString() sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); @@ -658,6 +690,8 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo Option dateTime = default; Option varDecimal = default; Option varDouble = default; + Option duplicatePropertyName2 = default; + Option duplicatePropertyName = default; Option varFloat = default; Option int32 = default; Option int32Range = default; @@ -718,6 +752,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo case "double": varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; + case "duplicate_property_name": + duplicatePropertyName2 = new Option(utf8JsonReader.GetString()); + break; + case "@duplicate_property_name": + duplicatePropertyName = new Option(utf8JsonReader.GetString()); + break; case "float": varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; @@ -817,6 +857,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (varDouble.IsSet && varDouble.Value == null) throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + if (duplicatePropertyName2.IsSet && duplicatePropertyName2.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName2), "Property is not nullable for class FormatTest."); + + if (duplicatePropertyName.IsSet && duplicatePropertyName.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName), "Property is not nullable for class FormatTest."); + if (varFloat.IsSet && varFloat.Value == null) throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); @@ -868,7 +914,7 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo 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, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, duplicatePropertyName2, duplicatePropertyName, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -904,6 +950,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + if (formatTest.DuplicatePropertyName2Option.IsSet && formatTest.DuplicatePropertyName2 == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName2), "Property is required for class FormatTest."); + + if (formatTest.DuplicatePropertyNameOption.IsSet && formatTest.DuplicatePropertyName == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName), "Property is required for class FormatTest."); + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); @@ -942,6 +994,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.DoubleOption.IsSet) writer.WriteNumber("double", formatTest.DoubleOption.Value.Value); + if (formatTest.DuplicatePropertyName2Option.IsSet) + writer.WriteString("duplicate_property_name", formatTest.DuplicatePropertyName2); + + if (formatTest.DuplicatePropertyNameOption.IsSet) + writer.WriteString("@duplicate_property_name", formatTest.DuplicatePropertyName); + if (formatTest.FloatOption.IsSet) writer.WriteNumber("float", formatTest.FloatOption.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 d86a1d2f6d87..1aa598117f1a 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 @@ -1714,6 +1714,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date 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 950546c1812f..8ba789fb729e 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 @@ -13,6 +13,8 @@ Name | Type | Description | Notes **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] **Double** | **double** | | [optional] +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] **Int32Range** | **int** | | [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 fe89f7090c4c..a144a3103489 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 @@ -134,6 +134,24 @@ public void DoubleTest() // TODO unit test for the property 'Double' } + /// + /// Test the property 'DuplicatePropertyName2' + /// + [Fact] + public void DuplicatePropertyName2Test() + { + // TODO unit test for the property 'DuplicatePropertyName2' + } + + /// + /// Test the property 'DuplicatePropertyName' + /// + [Fact] + public void DuplicatePropertyNameTest() + { + // TODO unit test for the property 'DuplicatePropertyName' + } + /// /// Test the property 'Float' /// 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 1887346c88b6..ae0854b6be45 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 @@ -41,6 +41,8 @@ public partial class FormatTest : IValidatableObject /// dateTime /// decimal /// double + /// duplicatePropertyName2 + /// duplicatePropertyName /// float /// int32 /// int32Range @@ -59,7 +61,7 @@ public partial class FormatTest : IValidatableObject /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateTime date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateTime date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option duplicatePropertyName2 = default, Option duplicatePropertyName = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; @@ -70,6 +72,8 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password, DateTimeOption = dateTime; DecimalOption = @decimal; DoubleOption = @double; + DuplicatePropertyName2Option = duplicatePropertyName2; + DuplicatePropertyNameOption = duplicatePropertyName; FloatOption = @float; Int32Option = int32; Int32RangeOption = int32Range; @@ -176,6 +180,32 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password, [JsonPropertyName("double")] public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new Option(value); } } + /// + /// Used to track the state of DuplicatePropertyName2 + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyName2Option { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [JsonPropertyName("duplicate_property_name")] + public string DuplicatePropertyName2 { get { return this.DuplicatePropertyName2Option; } set { this.DuplicatePropertyName2Option = new Option(value); } } + + /// + /// Used to track the state of DuplicatePropertyName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyNameOption { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [JsonPropertyName("@duplicate_property_name")] + public string DuplicatePropertyName { get { return this.DuplicatePropertyNameOption; } set { this.DuplicatePropertyNameOption = new Option(value); } } + /// /// Used to track the state of Float /// @@ -424,6 +454,8 @@ public override string ToString() sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); @@ -658,6 +690,8 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo Option dateTime = default; Option varDecimal = default; Option varDouble = default; + Option duplicatePropertyName2 = default; + Option duplicatePropertyName = default; Option varFloat = default; Option int32 = default; Option int32Range = default; @@ -718,6 +752,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo case "double": varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; + case "duplicate_property_name": + duplicatePropertyName2 = new Option(utf8JsonReader.GetString()); + break; + case "@duplicate_property_name": + duplicatePropertyName = new Option(utf8JsonReader.GetString()); + break; case "float": varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; @@ -817,6 +857,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (varDouble.IsSet && varDouble.Value == null) throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + if (duplicatePropertyName2.IsSet && duplicatePropertyName2.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName2), "Property is not nullable for class FormatTest."); + + if (duplicatePropertyName.IsSet && duplicatePropertyName.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName), "Property is not nullable for class FormatTest."); + if (varFloat.IsSet && varFloat.Value == null) throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); @@ -868,7 +914,7 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo 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, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, duplicatePropertyName2, duplicatePropertyName, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -904,6 +950,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + if (formatTest.DuplicatePropertyName2Option.IsSet && formatTest.DuplicatePropertyName2 == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName2), "Property is required for class FormatTest."); + + if (formatTest.DuplicatePropertyNameOption.IsSet && formatTest.DuplicatePropertyName == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName), "Property is required for class FormatTest."); + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); @@ -942,6 +994,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.DoubleOption.IsSet) writer.WriteNumber("double", formatTest.DoubleOption.Value.Value); + if (formatTest.DuplicatePropertyName2Option.IsSet) + writer.WriteString("duplicate_property_name", formatTest.DuplicatePropertyName2); + + if (formatTest.DuplicatePropertyNameOption.IsSet) + writer.WriteString("@duplicate_property_name", formatTest.DuplicatePropertyName); + if (formatTest.FloatOption.IsSet) writer.WriteNumber("float", formatTest.FloatOption.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 3afd9359ab7d..816608604456 100644 --- a/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/FormModels/api/openapi.yaml @@ -1673,6 +1673,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date 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 8380bbcb5564..8ef56b994400 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 @@ -13,6 +13,8 @@ Name | Type | Description | Notes **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] **Double** | **double** | | [optional] +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] **Int32Range** | **int** | | [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 fe89f7090c4c..a144a3103489 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 @@ -134,6 +134,24 @@ public void DoubleTest() // TODO unit test for the property 'Double' } + /// + /// Test the property 'DuplicatePropertyName2' + /// + [Fact] + public void DuplicatePropertyName2Test() + { + // TODO unit test for the property 'DuplicatePropertyName2' + } + + /// + /// Test the property 'DuplicatePropertyName' + /// + [Fact] + public void DuplicatePropertyNameTest() + { + // TODO unit test for the property 'DuplicatePropertyName' + } + /// /// Test the property 'Float' /// 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 217cf10f2dda..847567dd4b69 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 @@ -41,6 +41,8 @@ public partial class FormatTest : IValidatableObject /// dateTime /// decimal /// double + /// duplicatePropertyName2 + /// duplicatePropertyName /// float /// int32 /// int32Range @@ -59,7 +61,7 @@ public partial class FormatTest : IValidatableObject /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option duplicatePropertyName2 = default, Option duplicatePropertyName = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; @@ -70,6 +72,8 @@ public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, DateTimeOption = dateTime; DecimalOption = @decimal; DoubleOption = @double; + DuplicatePropertyName2Option = duplicatePropertyName2; + DuplicatePropertyNameOption = duplicatePropertyName; FloatOption = @float; Int32Option = int32; Int32RangeOption = int32Range; @@ -176,6 +180,32 @@ public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, [JsonPropertyName("double")] public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new(value); } } + /// + /// Used to track the state of DuplicatePropertyName2 + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyName2Option { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [JsonPropertyName("duplicate_property_name")] + public string DuplicatePropertyName2 { get { return this.DuplicatePropertyName2Option; } set { this.DuplicatePropertyName2Option = new(value); } } + + /// + /// Used to track the state of DuplicatePropertyName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyNameOption { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [JsonPropertyName("@duplicate_property_name")] + public string DuplicatePropertyName { get { return this.DuplicatePropertyNameOption; } set { this.DuplicatePropertyNameOption = new(value); } } + /// /// Used to track the state of Float /// @@ -424,6 +454,8 @@ public override string ToString() sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); @@ -658,6 +690,8 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo Option dateTime = default; Option varDecimal = default; Option varDouble = default; + Option duplicatePropertyName2 = default; + Option duplicatePropertyName = default; Option varFloat = default; Option int32 = default; Option int32Range = default; @@ -718,6 +752,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo case "double": varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; + case "duplicate_property_name": + duplicatePropertyName2 = new Option(utf8JsonReader.GetString()); + break; + case "@duplicate_property_name": + duplicatePropertyName = new Option(utf8JsonReader.GetString()); + break; case "float": varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; @@ -817,6 +857,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (varDouble.IsSet && varDouble.Value == null) throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + if (duplicatePropertyName2.IsSet && duplicatePropertyName2.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName2), "Property is not nullable for class FormatTest."); + + if (duplicatePropertyName.IsSet && duplicatePropertyName.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName), "Property is not nullable for class FormatTest."); + if (varFloat.IsSet && varFloat.Value == null) throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); @@ -868,7 +914,7 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo 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, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, duplicatePropertyName2, duplicatePropertyName, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -904,6 +950,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + if (formatTest.DuplicatePropertyName2Option.IsSet && formatTest.DuplicatePropertyName2 == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName2), "Property is required for class FormatTest."); + + if (formatTest.DuplicatePropertyNameOption.IsSet && formatTest.DuplicatePropertyName == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName), "Property is required for class FormatTest."); + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); @@ -942,6 +994,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.DoubleOption.IsSet) writer.WriteNumber("double", formatTest.DoubleOption.Value.Value); + if (formatTest.DuplicatePropertyName2Option.IsSet) + writer.WriteString("duplicate_property_name", formatTest.DuplicatePropertyName2); + + if (formatTest.DuplicatePropertyNameOption.IsSet) + writer.WriteString("@duplicate_property_name", formatTest.DuplicatePropertyName); + if (formatTest.FloatOption.IsSet) writer.WriteNumber("float", formatTest.FloatOption.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 d86a1d2f6d87..1aa598117f1a 100644 --- a/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/NullReferenceTypes/api/openapi.yaml @@ -1714,6 +1714,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date 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 8380bbcb5564..8ef56b994400 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 @@ -13,6 +13,8 @@ Name | Type | Description | Notes **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] **Double** | **double** | | [optional] +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] **Int32Range** | **int** | | [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 fe89f7090c4c..a144a3103489 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 @@ -134,6 +134,24 @@ public void DoubleTest() // TODO unit test for the property 'Double' } + /// + /// Test the property 'DuplicatePropertyName2' + /// + [Fact] + public void DuplicatePropertyName2Test() + { + // TODO unit test for the property 'DuplicatePropertyName2' + } + + /// + /// Test the property 'DuplicatePropertyName' + /// + [Fact] + public void DuplicatePropertyNameTest() + { + // TODO unit test for the property 'DuplicatePropertyName' + } + /// /// Test the property 'Float' /// 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 a5dae71ad9d4..9e4b3c23fe8a 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 @@ -43,6 +43,8 @@ public partial class FormatTest : IValidatableObject /// dateTime /// decimal /// double + /// duplicatePropertyName2 + /// duplicatePropertyName /// float /// int32 /// int32Range @@ -61,7 +63,7 @@ public partial class FormatTest : IValidatableObject /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option duplicatePropertyName2 = default, Option duplicatePropertyName = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; @@ -72,6 +74,8 @@ public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, DateTimeOption = dateTime; DecimalOption = @decimal; DoubleOption = @double; + DuplicatePropertyName2Option = duplicatePropertyName2; + DuplicatePropertyNameOption = duplicatePropertyName; FloatOption = @float; Int32Option = int32; Int32RangeOption = int32Range; @@ -178,6 +182,32 @@ public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, [JsonPropertyName("double")] public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new(value); } } + /// + /// Used to track the state of DuplicatePropertyName2 + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyName2Option { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [JsonPropertyName("duplicate_property_name")] + public string? DuplicatePropertyName2 { get { return this.DuplicatePropertyName2Option; } set { this.DuplicatePropertyName2Option = new(value); } } + + /// + /// Used to track the state of DuplicatePropertyName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyNameOption { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [JsonPropertyName("@duplicate_property_name")] + public string? DuplicatePropertyName { get { return this.DuplicatePropertyNameOption; } set { this.DuplicatePropertyNameOption = new(value); } } + /// /// Used to track the state of Float /// @@ -426,6 +456,8 @@ public override string ToString() sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); @@ -660,6 +692,8 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo Option dateTime = default; Option varDecimal = default; Option varDouble = default; + Option duplicatePropertyName2 = default; + Option duplicatePropertyName = default; Option varFloat = default; Option int32 = default; Option int32Range = default; @@ -720,6 +754,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo case "double": varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; + case "duplicate_property_name": + duplicatePropertyName2 = new Option(utf8JsonReader.GetString()!); + break; + case "@duplicate_property_name": + duplicatePropertyName = new Option(utf8JsonReader.GetString()!); + break; case "float": varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; @@ -819,6 +859,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (varDouble.IsSet && varDouble.Value == null) throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + if (duplicatePropertyName2.IsSet && duplicatePropertyName2.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName2), "Property is not nullable for class FormatTest."); + + if (duplicatePropertyName.IsSet && duplicatePropertyName.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName), "Property is not nullable for class FormatTest."); + if (varFloat.IsSet && varFloat.Value == null) throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); @@ -870,7 +916,7 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo 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!, stringFormattedAsDecimalRequired.Value!.Value!, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value!, date.Value!.Value!, number.Value!.Value!, password.Value!, stringFormattedAsDecimalRequired.Value!.Value!, binary, dateTime, varDecimal, varDouble, duplicatePropertyName2, duplicatePropertyName, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -906,6 +952,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + if (formatTest.DuplicatePropertyName2Option.IsSet && formatTest.DuplicatePropertyName2 == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName2), "Property is required for class FormatTest."); + + if (formatTest.DuplicatePropertyNameOption.IsSet && formatTest.DuplicatePropertyName == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName), "Property is required for class FormatTest."); + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); @@ -944,6 +996,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.DoubleOption.IsSet) writer.WriteNumber("double", formatTest.DoubleOption.Value!.Value); + if (formatTest.DuplicatePropertyName2Option.IsSet) + writer.WriteString("duplicate_property_name", formatTest.DuplicatePropertyName2); + + if (formatTest.DuplicatePropertyNameOption.IsSet) + writer.WriteString("@duplicate_property_name", formatTest.DuplicatePropertyName); + if (formatTest.FloatOption.IsSet) writer.WriteNumber("float", formatTest.FloatOption.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 d86a1d2f6d87..1aa598117f1a 100644 --- a/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/Petstore/api/openapi.yaml @@ -1714,6 +1714,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date 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 8380bbcb5564..8ef56b994400 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 @@ -13,6 +13,8 @@ Name | Type | Description | Notes **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] **Double** | **double** | | [optional] +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] **Int32Range** | **int** | | [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 fe89f7090c4c..a144a3103489 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 @@ -134,6 +134,24 @@ public void DoubleTest() // TODO unit test for the property 'Double' } + /// + /// Test the property 'DuplicatePropertyName2' + /// + [Fact] + public void DuplicatePropertyName2Test() + { + // TODO unit test for the property 'DuplicatePropertyName2' + } + + /// + /// Test the property 'DuplicatePropertyName' + /// + [Fact] + public void DuplicatePropertyNameTest() + { + // TODO unit test for the property 'DuplicatePropertyName' + } + /// /// Test the property 'Float' /// 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 217cf10f2dda..847567dd4b69 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 @@ -41,6 +41,8 @@ public partial class FormatTest : IValidatableObject /// dateTime /// decimal /// double + /// duplicatePropertyName2 + /// duplicatePropertyName /// float /// int32 /// int32Range @@ -59,7 +61,7 @@ public partial class FormatTest : IValidatableObject /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option duplicatePropertyName2 = default, Option duplicatePropertyName = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; @@ -70,6 +72,8 @@ public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, DateTimeOption = dateTime; DecimalOption = @decimal; DoubleOption = @double; + DuplicatePropertyName2Option = duplicatePropertyName2; + DuplicatePropertyNameOption = duplicatePropertyName; FloatOption = @float; Int32Option = int32; Int32RangeOption = int32Range; @@ -176,6 +180,32 @@ public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, [JsonPropertyName("double")] public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new(value); } } + /// + /// Used to track the state of DuplicatePropertyName2 + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyName2Option { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [JsonPropertyName("duplicate_property_name")] + public string DuplicatePropertyName2 { get { return this.DuplicatePropertyName2Option; } set { this.DuplicatePropertyName2Option = new(value); } } + + /// + /// Used to track the state of DuplicatePropertyName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyNameOption { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [JsonPropertyName("@duplicate_property_name")] + public string DuplicatePropertyName { get { return this.DuplicatePropertyNameOption; } set { this.DuplicatePropertyNameOption = new(value); } } + /// /// Used to track the state of Float /// @@ -424,6 +454,8 @@ public override string ToString() sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); @@ -658,6 +690,8 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo Option dateTime = default; Option varDecimal = default; Option varDouble = default; + Option duplicatePropertyName2 = default; + Option duplicatePropertyName = default; Option varFloat = default; Option int32 = default; Option int32Range = default; @@ -718,6 +752,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo case "double": varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; + case "duplicate_property_name": + duplicatePropertyName2 = new Option(utf8JsonReader.GetString()); + break; + case "@duplicate_property_name": + duplicatePropertyName = new Option(utf8JsonReader.GetString()); + break; case "float": varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; @@ -817,6 +857,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (varDouble.IsSet && varDouble.Value == null) throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + if (duplicatePropertyName2.IsSet && duplicatePropertyName2.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName2), "Property is not nullable for class FormatTest."); + + if (duplicatePropertyName.IsSet && duplicatePropertyName.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName), "Property is not nullable for class FormatTest."); + if (varFloat.IsSet && varFloat.Value == null) throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); @@ -868,7 +914,7 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo 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, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, duplicatePropertyName2, duplicatePropertyName, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -904,6 +950,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + if (formatTest.DuplicatePropertyName2Option.IsSet && formatTest.DuplicatePropertyName2 == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName2), "Property is required for class FormatTest."); + + if (formatTest.DuplicatePropertyNameOption.IsSet && formatTest.DuplicatePropertyName == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName), "Property is required for class FormatTest."); + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); @@ -942,6 +994,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.DoubleOption.IsSet) writer.WriteNumber("double", formatTest.DoubleOption.Value.Value); + if (formatTest.DuplicatePropertyName2Option.IsSet) + writer.WriteString("duplicate_property_name", formatTest.DuplicatePropertyName2); + + if (formatTest.DuplicatePropertyNameOption.IsSet) + writer.WriteString("@duplicate_property_name", formatTest.DuplicatePropertyName); + if (formatTest.FloatOption.IsSet) writer.WriteNumber("float", formatTest.FloatOption.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 d86a1d2f6d87..1aa598117f1a 100644 --- a/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net8/SourceGeneration/api/openapi.yaml @@ -1714,6 +1714,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date 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 8380bbcb5564..8ef56b994400 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 @@ -13,6 +13,8 @@ Name | Type | Description | Notes **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] **Double** | **double** | | [optional] +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] **Int32Range** | **int** | | [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 fe89f7090c4c..a144a3103489 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 @@ -134,6 +134,24 @@ public void DoubleTest() // TODO unit test for the property 'Double' } + /// + /// Test the property 'DuplicatePropertyName2' + /// + [Fact] + public void DuplicatePropertyName2Test() + { + // TODO unit test for the property 'DuplicatePropertyName2' + } + + /// + /// Test the property 'DuplicatePropertyName' + /// + [Fact] + public void DuplicatePropertyNameTest() + { + // TODO unit test for the property 'DuplicatePropertyName' + } + /// /// Test the property 'Float' /// 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 894fa9a3fa82..3daacf80952d 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 @@ -44,6 +44,8 @@ public partial class FormatTest : IValidatableObject /// dateTime /// decimal /// double + /// duplicatePropertyName2 + /// duplicatePropertyName /// float /// int32 /// int32Range @@ -62,7 +64,7 @@ public partial class FormatTest : IValidatableObject /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option duplicatePropertyName2 = default, Option duplicatePropertyName = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; @@ -73,6 +75,8 @@ public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, DateTimeOption = dateTime; DecimalOption = @decimal; DoubleOption = @double; + DuplicatePropertyName2Option = duplicatePropertyName2; + DuplicatePropertyNameOption = duplicatePropertyName; FloatOption = @float; Int32Option = int32; Int32RangeOption = int32Range; @@ -179,6 +183,32 @@ public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, [JsonPropertyName("double")] public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new(value); } } + /// + /// Used to track the state of DuplicatePropertyName2 + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyName2Option { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [JsonPropertyName("duplicate_property_name")] + public string? DuplicatePropertyName2 { get { return this.DuplicatePropertyName2Option; } set { this.DuplicatePropertyName2Option = new(value); } } + + /// + /// Used to track the state of DuplicatePropertyName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyNameOption { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [JsonPropertyName("@duplicate_property_name")] + public string? DuplicatePropertyName { get { return this.DuplicatePropertyNameOption; } set { this.DuplicatePropertyNameOption = new(value); } } + /// /// Used to track the state of Float /// @@ -427,6 +457,8 @@ public override string ToString() sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); @@ -661,6 +693,8 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo Option dateTime = default; Option varDecimal = default; Option varDouble = default; + Option duplicatePropertyName2 = default; + Option duplicatePropertyName = default; Option varFloat = default; Option int32 = default; Option int32Range = default; @@ -721,6 +755,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo case "double": varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; + case "duplicate_property_name": + duplicatePropertyName2 = new Option(utf8JsonReader.GetString()!); + break; + case "@duplicate_property_name": + duplicatePropertyName = new Option(utf8JsonReader.GetString()!); + break; case "float": varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; @@ -820,6 +860,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (varDouble.IsSet && varDouble.Value == null) throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + if (duplicatePropertyName2.IsSet && duplicatePropertyName2.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName2), "Property is not nullable for class FormatTest."); + + if (duplicatePropertyName.IsSet && duplicatePropertyName.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName), "Property is not nullable for class FormatTest."); + if (varFloat.IsSet && varFloat.Value == null) throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); @@ -871,7 +917,7 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo 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!, stringFormattedAsDecimalRequired.Value!.Value!, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value!, date.Value!.Value!, number.Value!.Value!, password.Value!, stringFormattedAsDecimalRequired.Value!.Value!, binary, dateTime, varDecimal, varDouble, duplicatePropertyName2, duplicatePropertyName, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -907,6 +953,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + if (formatTest.DuplicatePropertyName2Option.IsSet && formatTest.DuplicatePropertyName2 == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName2), "Property is required for class FormatTest."); + + if (formatTest.DuplicatePropertyNameOption.IsSet && formatTest.DuplicatePropertyName == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName), "Property is required for class FormatTest."); + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); @@ -945,6 +997,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.DoubleOption.IsSet) writer.WriteNumber("double", formatTest.DoubleOption.Value!.Value); + if (formatTest.DuplicatePropertyName2Option.IsSet) + writer.WriteString("duplicate_property_name", formatTest.DuplicatePropertyName2); + + if (formatTest.DuplicatePropertyNameOption.IsSet) + writer.WriteString("@duplicate_property_name", formatTest.DuplicatePropertyName); + if (formatTest.FloatOption.IsSet) writer.WriteNumber("float", formatTest.FloatOption.Value!.Value); diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net9/FormModels/api/openapi.yaml index 3afd9359ab7d..816608604456 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/api/openapi.yaml @@ -1673,6 +1673,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net9/FormModels/docs/models/FormatTest.md index 8380bbcb5564..8ef56b994400 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/docs/models/FormatTest.md @@ -13,6 +13,8 @@ Name | Type | Description | Notes **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] **Double** | **double** | | [optional] +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] **Int32Range** | **int** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index fe89f7090c4c..a144a3103489 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -134,6 +134,24 @@ public void DoubleTest() // TODO unit test for the property 'Double' } + /// + /// Test the property 'DuplicatePropertyName2' + /// + [Fact] + public void DuplicatePropertyName2Test() + { + // TODO unit test for the property 'DuplicatePropertyName2' + } + + /// + /// Test the property 'DuplicatePropertyName' + /// + [Fact] + public void DuplicatePropertyNameTest() + { + // TODO unit test for the property 'DuplicatePropertyName' + } + /// /// Test the property 'Float' /// diff --git a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs index 217cf10f2dda..847567dd4b69 100644 --- a/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/FormModels/src/Org.OpenAPITools/Model/FormatTest.cs @@ -41,6 +41,8 @@ public partial class FormatTest : IValidatableObject /// dateTime /// decimal /// double + /// duplicatePropertyName2 + /// duplicatePropertyName /// float /// int32 /// int32Range @@ -59,7 +61,7 @@ public partial class FormatTest : IValidatableObject /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option duplicatePropertyName2 = default, Option duplicatePropertyName = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; @@ -70,6 +72,8 @@ public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, DateTimeOption = dateTime; DecimalOption = @decimal; DoubleOption = @double; + DuplicatePropertyName2Option = duplicatePropertyName2; + DuplicatePropertyNameOption = duplicatePropertyName; FloatOption = @float; Int32Option = int32; Int32RangeOption = int32Range; @@ -176,6 +180,32 @@ public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, [JsonPropertyName("double")] public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new(value); } } + /// + /// Used to track the state of DuplicatePropertyName2 + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyName2Option { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [JsonPropertyName("duplicate_property_name")] + public string DuplicatePropertyName2 { get { return this.DuplicatePropertyName2Option; } set { this.DuplicatePropertyName2Option = new(value); } } + + /// + /// Used to track the state of DuplicatePropertyName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyNameOption { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [JsonPropertyName("@duplicate_property_name")] + public string DuplicatePropertyName { get { return this.DuplicatePropertyNameOption; } set { this.DuplicatePropertyNameOption = new(value); } } + /// /// Used to track the state of Float /// @@ -424,6 +454,8 @@ public override string ToString() sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); @@ -658,6 +690,8 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo Option dateTime = default; Option varDecimal = default; Option varDouble = default; + Option duplicatePropertyName2 = default; + Option duplicatePropertyName = default; Option varFloat = default; Option int32 = default; Option int32Range = default; @@ -718,6 +752,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo case "double": varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; + case "duplicate_property_name": + duplicatePropertyName2 = new Option(utf8JsonReader.GetString()); + break; + case "@duplicate_property_name": + duplicatePropertyName = new Option(utf8JsonReader.GetString()); + break; case "float": varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; @@ -817,6 +857,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (varDouble.IsSet && varDouble.Value == null) throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + if (duplicatePropertyName2.IsSet && duplicatePropertyName2.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName2), "Property is not nullable for class FormatTest."); + + if (duplicatePropertyName.IsSet && duplicatePropertyName.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName), "Property is not nullable for class FormatTest."); + if (varFloat.IsSet && varFloat.Value == null) throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); @@ -868,7 +914,7 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo 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, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, duplicatePropertyName2, duplicatePropertyName, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -904,6 +950,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + if (formatTest.DuplicatePropertyName2Option.IsSet && formatTest.DuplicatePropertyName2 == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName2), "Property is required for class FormatTest."); + + if (formatTest.DuplicatePropertyNameOption.IsSet && formatTest.DuplicatePropertyName == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName), "Property is required for class FormatTest."); + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); @@ -942,6 +994,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.DoubleOption.IsSet) writer.WriteNumber("double", formatTest.DoubleOption.Value.Value); + if (formatTest.DuplicatePropertyName2Option.IsSet) + writer.WriteString("duplicate_property_name", formatTest.DuplicatePropertyName2); + + if (formatTest.DuplicatePropertyNameOption.IsSet) + writer.WriteString("@duplicate_property_name", formatTest.DuplicatePropertyName); + if (formatTest.FloatOption.IsSet) writer.WriteNumber("float", formatTest.FloatOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/api/openapi.yaml index d86a1d2f6d87..1aa598117f1a 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/api/openapi.yaml @@ -1714,6 +1714,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/docs/models/FormatTest.md index 8380bbcb5564..8ef56b994400 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/docs/models/FormatTest.md @@ -13,6 +13,8 @@ Name | Type | Description | Notes **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] **Double** | **double** | | [optional] +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] **Int32Range** | **int** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index fe89f7090c4c..a144a3103489 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -134,6 +134,24 @@ public void DoubleTest() // TODO unit test for the property 'Double' } + /// + /// Test the property 'DuplicatePropertyName2' + /// + [Fact] + public void DuplicatePropertyName2Test() + { + // TODO unit test for the property 'DuplicatePropertyName2' + } + + /// + /// Test the property 'DuplicatePropertyName' + /// + [Fact] + public void DuplicatePropertyNameTest() + { + // TODO unit test for the property 'DuplicatePropertyName' + } + /// /// Test the property 'Float' /// diff --git a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs index a5dae71ad9d4..9e4b3c23fe8a 100644 --- a/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/NullReferenceTypes/src/Org.OpenAPITools/Model/FormatTest.cs @@ -43,6 +43,8 @@ public partial class FormatTest : IValidatableObject /// dateTime /// decimal /// double + /// duplicatePropertyName2 + /// duplicatePropertyName /// float /// int32 /// int32Range @@ -61,7 +63,7 @@ public partial class FormatTest : IValidatableObject /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option duplicatePropertyName2 = default, Option duplicatePropertyName = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; @@ -72,6 +74,8 @@ public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, DateTimeOption = dateTime; DecimalOption = @decimal; DoubleOption = @double; + DuplicatePropertyName2Option = duplicatePropertyName2; + DuplicatePropertyNameOption = duplicatePropertyName; FloatOption = @float; Int32Option = int32; Int32RangeOption = int32Range; @@ -178,6 +182,32 @@ public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, [JsonPropertyName("double")] public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new(value); } } + /// + /// Used to track the state of DuplicatePropertyName2 + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyName2Option { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [JsonPropertyName("duplicate_property_name")] + public string? DuplicatePropertyName2 { get { return this.DuplicatePropertyName2Option; } set { this.DuplicatePropertyName2Option = new(value); } } + + /// + /// Used to track the state of DuplicatePropertyName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyNameOption { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [JsonPropertyName("@duplicate_property_name")] + public string? DuplicatePropertyName { get { return this.DuplicatePropertyNameOption; } set { this.DuplicatePropertyNameOption = new(value); } } + /// /// Used to track the state of Float /// @@ -426,6 +456,8 @@ public override string ToString() sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); @@ -660,6 +692,8 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo Option dateTime = default; Option varDecimal = default; Option varDouble = default; + Option duplicatePropertyName2 = default; + Option duplicatePropertyName = default; Option varFloat = default; Option int32 = default; Option int32Range = default; @@ -720,6 +754,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo case "double": varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; + case "duplicate_property_name": + duplicatePropertyName2 = new Option(utf8JsonReader.GetString()!); + break; + case "@duplicate_property_name": + duplicatePropertyName = new Option(utf8JsonReader.GetString()!); + break; case "float": varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; @@ -819,6 +859,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (varDouble.IsSet && varDouble.Value == null) throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + if (duplicatePropertyName2.IsSet && duplicatePropertyName2.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName2), "Property is not nullable for class FormatTest."); + + if (duplicatePropertyName.IsSet && duplicatePropertyName.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName), "Property is not nullable for class FormatTest."); + if (varFloat.IsSet && varFloat.Value == null) throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); @@ -870,7 +916,7 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo 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!, stringFormattedAsDecimalRequired.Value!.Value!, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value!, date.Value!.Value!, number.Value!.Value!, password.Value!, stringFormattedAsDecimalRequired.Value!.Value!, binary, dateTime, varDecimal, varDouble, duplicatePropertyName2, duplicatePropertyName, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -906,6 +952,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + if (formatTest.DuplicatePropertyName2Option.IsSet && formatTest.DuplicatePropertyName2 == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName2), "Property is required for class FormatTest."); + + if (formatTest.DuplicatePropertyNameOption.IsSet && formatTest.DuplicatePropertyName == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName), "Property is required for class FormatTest."); + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); @@ -944,6 +996,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.DoubleOption.IsSet) writer.WriteNumber("double", formatTest.DoubleOption.Value!.Value); + if (formatTest.DuplicatePropertyName2Option.IsSet) + writer.WriteString("duplicate_property_name", formatTest.DuplicatePropertyName2); + + if (formatTest.DuplicatePropertyNameOption.IsSet) + writer.WriteString("@duplicate_property_name", formatTest.DuplicatePropertyName); + if (formatTest.FloatOption.IsSet) writer.WriteNumber("float", formatTest.FloatOption.Value!.Value); diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net9/Petstore/api/openapi.yaml index d86a1d2f6d87..1aa598117f1a 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/api/openapi.yaml @@ -1714,6 +1714,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net9/Petstore/docs/models/FormatTest.md index 8380bbcb5564..8ef56b994400 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/docs/models/FormatTest.md @@ -13,6 +13,8 @@ Name | Type | Description | Notes **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] **Double** | **double** | | [optional] +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] **Int32Range** | **int** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index fe89f7090c4c..a144a3103489 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -134,6 +134,24 @@ public void DoubleTest() // TODO unit test for the property 'Double' } + /// + /// Test the property 'DuplicatePropertyName2' + /// + [Fact] + public void DuplicatePropertyName2Test() + { + // TODO unit test for the property 'DuplicatePropertyName2' + } + + /// + /// Test the property 'DuplicatePropertyName' + /// + [Fact] + public void DuplicatePropertyNameTest() + { + // TODO unit test for the property 'DuplicatePropertyName' + } + /// /// Test the property 'Float' /// diff --git a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 217cf10f2dda..847567dd4b69 100644 --- a/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -41,6 +41,8 @@ public partial class FormatTest : IValidatableObject /// dateTime /// decimal /// double + /// duplicatePropertyName2 + /// duplicatePropertyName /// float /// int32 /// int32Range @@ -59,7 +61,7 @@ public partial class FormatTest : IValidatableObject /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option duplicatePropertyName2 = default, Option duplicatePropertyName = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; @@ -70,6 +72,8 @@ public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, DateTimeOption = dateTime; DecimalOption = @decimal; DoubleOption = @double; + DuplicatePropertyName2Option = duplicatePropertyName2; + DuplicatePropertyNameOption = duplicatePropertyName; FloatOption = @float; Int32Option = int32; Int32RangeOption = int32Range; @@ -176,6 +180,32 @@ public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, [JsonPropertyName("double")] public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new(value); } } + /// + /// Used to track the state of DuplicatePropertyName2 + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyName2Option { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [JsonPropertyName("duplicate_property_name")] + public string DuplicatePropertyName2 { get { return this.DuplicatePropertyName2Option; } set { this.DuplicatePropertyName2Option = new(value); } } + + /// + /// Used to track the state of DuplicatePropertyName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyNameOption { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [JsonPropertyName("@duplicate_property_name")] + public string DuplicatePropertyName { get { return this.DuplicatePropertyNameOption; } set { this.DuplicatePropertyNameOption = new(value); } } + /// /// Used to track the state of Float /// @@ -424,6 +454,8 @@ public override string ToString() sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); @@ -658,6 +690,8 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo Option dateTime = default; Option varDecimal = default; Option varDouble = default; + Option duplicatePropertyName2 = default; + Option duplicatePropertyName = default; Option varFloat = default; Option int32 = default; Option int32Range = default; @@ -718,6 +752,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo case "double": varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; + case "duplicate_property_name": + duplicatePropertyName2 = new Option(utf8JsonReader.GetString()); + break; + case "@duplicate_property_name": + duplicatePropertyName = new Option(utf8JsonReader.GetString()); + break; case "float": varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; @@ -817,6 +857,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (varDouble.IsSet && varDouble.Value == null) throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + if (duplicatePropertyName2.IsSet && duplicatePropertyName2.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName2), "Property is not nullable for class FormatTest."); + + if (duplicatePropertyName.IsSet && duplicatePropertyName.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName), "Property is not nullable for class FormatTest."); + if (varFloat.IsSet && varFloat.Value == null) throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); @@ -868,7 +914,7 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo 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, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, duplicatePropertyName2, duplicatePropertyName, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -904,6 +950,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + if (formatTest.DuplicatePropertyName2Option.IsSet && formatTest.DuplicatePropertyName2 == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName2), "Property is required for class FormatTest."); + + if (formatTest.DuplicatePropertyNameOption.IsSet && formatTest.DuplicatePropertyName == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName), "Property is required for class FormatTest."); + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); @@ -942,6 +994,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.DoubleOption.IsSet) writer.WriteNumber("double", formatTest.DoubleOption.Value.Value); + if (formatTest.DuplicatePropertyName2Option.IsSet) + writer.WriteString("duplicate_property_name", formatTest.DuplicatePropertyName2); + + if (formatTest.DuplicatePropertyNameOption.IsSet) + writer.WriteString("@duplicate_property_name", formatTest.DuplicatePropertyName); + if (formatTest.FloatOption.IsSet) writer.WriteNumber("float", formatTest.FloatOption.Value.Value); diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/api/openapi.yaml b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/api/openapi.yaml index d86a1d2f6d87..1aa598117f1a 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/api/openapi.yaml +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/api/openapi.yaml @@ -1714,6 +1714,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/docs/models/FormatTest.md b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/docs/models/FormatTest.md index 8380bbcb5564..8ef56b994400 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/docs/models/FormatTest.md +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/docs/models/FormatTest.md @@ -13,6 +13,8 @@ Name | Type | Description | Notes **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] **Double** | **double** | | [optional] +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] **Int32Range** | **int** | | [optional] diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs index fe89f7090c4c..a144a3103489 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools.Test/Model/FormatTestTests.cs @@ -134,6 +134,24 @@ public void DoubleTest() // TODO unit test for the property 'Double' } + /// + /// Test the property 'DuplicatePropertyName2' + /// + [Fact] + public void DuplicatePropertyName2Test() + { + // TODO unit test for the property 'DuplicatePropertyName2' + } + + /// + /// Test the property 'DuplicatePropertyName' + /// + [Fact] + public void DuplicatePropertyNameTest() + { + // TODO unit test for the property 'DuplicatePropertyName' + } + /// /// Test the property 'Float' /// diff --git a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs index 894fa9a3fa82..3daacf80952d 100644 --- a/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/generichost/net9/SourceGeneration/src/Org.OpenAPITools/Model/FormatTest.cs @@ -44,6 +44,8 @@ public partial class FormatTest : IValidatableObject /// dateTime /// decimal /// double + /// duplicatePropertyName2 + /// duplicatePropertyName /// float /// int32 /// int32Range @@ -62,7 +64,7 @@ public partial class FormatTest : IValidatableObject /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option duplicatePropertyName2 = default, Option duplicatePropertyName = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; @@ -73,6 +75,8 @@ public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, DateTimeOption = dateTime; DecimalOption = @decimal; DoubleOption = @double; + DuplicatePropertyName2Option = duplicatePropertyName2; + DuplicatePropertyNameOption = duplicatePropertyName; FloatOption = @float; Int32Option = int32; Int32RangeOption = int32Range; @@ -179,6 +183,32 @@ public FormatTest(byte[] @byte, DateOnly date, decimal number, string password, [JsonPropertyName("double")] public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new(value); } } + /// + /// Used to track the state of DuplicatePropertyName2 + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyName2Option { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [JsonPropertyName("duplicate_property_name")] + public string? DuplicatePropertyName2 { get { return this.DuplicatePropertyName2Option; } set { this.DuplicatePropertyName2Option = new(value); } } + + /// + /// Used to track the state of DuplicatePropertyName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyNameOption { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [JsonPropertyName("@duplicate_property_name")] + public string? DuplicatePropertyName { get { return this.DuplicatePropertyNameOption; } set { this.DuplicatePropertyNameOption = new(value); } } + /// /// Used to track the state of Float /// @@ -427,6 +457,8 @@ public override string ToString() sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); @@ -661,6 +693,8 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo Option dateTime = default; Option varDecimal = default; Option varDouble = default; + Option duplicatePropertyName2 = default; + Option duplicatePropertyName = default; Option varFloat = default; Option int32 = default; Option int32Range = default; @@ -721,6 +755,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo case "double": varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; + case "duplicate_property_name": + duplicatePropertyName2 = new Option(utf8JsonReader.GetString()!); + break; + case "@duplicate_property_name": + duplicatePropertyName = new Option(utf8JsonReader.GetString()!); + break; case "float": varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; @@ -820,6 +860,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (varDouble.IsSet && varDouble.Value == null) throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + if (duplicatePropertyName2.IsSet && duplicatePropertyName2.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName2), "Property is not nullable for class FormatTest."); + + if (duplicatePropertyName.IsSet && duplicatePropertyName.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName), "Property is not nullable for class FormatTest."); + if (varFloat.IsSet && varFloat.Value == null) throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); @@ -871,7 +917,7 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo 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!, stringFormattedAsDecimalRequired.Value!.Value!, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value!, date.Value!.Value!, number.Value!.Value!, password.Value!, stringFormattedAsDecimalRequired.Value!.Value!, binary, dateTime, varDecimal, varDouble, duplicatePropertyName2, duplicatePropertyName, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -907,6 +953,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + if (formatTest.DuplicatePropertyName2Option.IsSet && formatTest.DuplicatePropertyName2 == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName2), "Property is required for class FormatTest."); + + if (formatTest.DuplicatePropertyNameOption.IsSet && formatTest.DuplicatePropertyName == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName), "Property is required for class FormatTest."); + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); @@ -945,6 +997,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.DoubleOption.IsSet) writer.WriteNumber("double", formatTest.DoubleOption.Value!.Value); + if (formatTest.DuplicatePropertyName2Option.IsSet) + writer.WriteString("duplicate_property_name", formatTest.DuplicatePropertyName2); + + if (formatTest.DuplicatePropertyNameOption.IsSet) + writer.WriteString("@duplicate_property_name", formatTest.DuplicatePropertyName); + if (formatTest.FloatOption.IsSet) writer.WriteNumber("float", formatTest.FloatOption.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 d86a1d2f6d87..1aa598117f1a 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 @@ -1714,6 +1714,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date 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 950546c1812f..8ba789fb729e 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 @@ -13,6 +13,8 @@ Name | Type | Description | Notes **DateTime** | **DateTime** | | [optional] **Decimal** | **decimal** | | [optional] **Double** | **double** | | [optional] +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] **Float** | **float** | | [optional] **Int32** | **int** | | [optional] **Int32Range** | **int** | | [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 fe89f7090c4c..a144a3103489 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 @@ -134,6 +134,24 @@ public void DoubleTest() // TODO unit test for the property 'Double' } + /// + /// Test the property 'DuplicatePropertyName2' + /// + [Fact] + public void DuplicatePropertyName2Test() + { + // TODO unit test for the property 'DuplicatePropertyName2' + } + + /// + /// Test the property 'DuplicatePropertyName' + /// + [Fact] + public void DuplicatePropertyNameTest() + { + // TODO unit test for the property 'DuplicatePropertyName' + } + /// /// Test the property 'Float' /// 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 1887346c88b6..ae0854b6be45 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 @@ -41,6 +41,8 @@ public partial class FormatTest : IValidatableObject /// dateTime /// decimal /// double + /// duplicatePropertyName2 + /// duplicatePropertyName /// float /// int32 /// int32Range @@ -59,7 +61,7 @@ public partial class FormatTest : IValidatableObject /// unsignedLong /// uuid [JsonConstructor] - public FormatTest(byte[] @byte, DateTime date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) + public FormatTest(byte[] @byte, DateTime date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option binary = default, Option dateTime = default, Option @decimal = default, Option @double = default, Option duplicatePropertyName2 = default, Option duplicatePropertyName = default, Option @float = default, Option int32 = default, Option int32Range = default, Option int64 = default, Option int64Negative = default, Option int64NegativeExclusive = default, Option int64Positive = default, Option int64PositiveExclusive = default, Option integer = default, Option patternWithBackslash = default, Option patternWithDigits = default, Option patternWithDigitsAndDelimiter = default, Option @string = default, Option stringFormattedAsDecimal = default, Option unsignedInteger = default, Option unsignedLong = default, Option uuid = default) { Byte = @byte; Date = date; @@ -70,6 +72,8 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password, DateTimeOption = dateTime; DecimalOption = @decimal; DoubleOption = @double; + DuplicatePropertyName2Option = duplicatePropertyName2; + DuplicatePropertyNameOption = duplicatePropertyName; FloatOption = @float; Int32Option = int32; Int32RangeOption = int32Range; @@ -176,6 +180,32 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password, [JsonPropertyName("double")] public double? Double { get { return this.DoubleOption; } set { this.DoubleOption = new Option(value); } } + /// + /// Used to track the state of DuplicatePropertyName2 + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyName2Option { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [JsonPropertyName("duplicate_property_name")] + public string DuplicatePropertyName2 { get { return this.DuplicatePropertyName2Option; } set { this.DuplicatePropertyName2Option = new Option(value); } } + + /// + /// Used to track the state of DuplicatePropertyName + /// + [JsonIgnore] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public Option DuplicatePropertyNameOption { get; private set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [JsonPropertyName("@duplicate_property_name")] + public string DuplicatePropertyName { get { return this.DuplicatePropertyNameOption; } set { this.DuplicatePropertyNameOption = new Option(value); } } + /// /// Used to track the state of Float /// @@ -424,6 +454,8 @@ public override string ToString() sb.Append(" DateTime: ").Append(DateTime).Append("\n"); sb.Append(" Decimal: ").Append(Decimal).Append("\n"); sb.Append(" Double: ").Append(Double).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append(" Float: ").Append(Float).Append("\n"); sb.Append(" Int32: ").Append(Int32).Append("\n"); sb.Append(" Int32Range: ").Append(Int32Range).Append("\n"); @@ -658,6 +690,8 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo Option dateTime = default; Option varDecimal = default; Option varDouble = default; + Option duplicatePropertyName2 = default; + Option duplicatePropertyName = default; Option varFloat = default; Option int32 = default; Option int32Range = default; @@ -718,6 +752,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo case "double": varDouble = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (double?)null : utf8JsonReader.GetDouble()); break; + case "duplicate_property_name": + duplicatePropertyName2 = new Option(utf8JsonReader.GetString()); + break; + case "@duplicate_property_name": + duplicatePropertyName = new Option(utf8JsonReader.GetString()); + break; case "float": varFloat = new Option(utf8JsonReader.TokenType == JsonTokenType.Null ? (float?)null : (float)utf8JsonReader.GetDouble()); break; @@ -817,6 +857,12 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo if (varDouble.IsSet && varDouble.Value == null) throw new ArgumentNullException(nameof(varDouble), "Property is not nullable for class FormatTest."); + if (duplicatePropertyName2.IsSet && duplicatePropertyName2.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName2), "Property is not nullable for class FormatTest."); + + if (duplicatePropertyName.IsSet && duplicatePropertyName.Value == null) + throw new ArgumentNullException(nameof(duplicatePropertyName), "Property is not nullable for class FormatTest."); + if (varFloat.IsSet && varFloat.Value == null) throw new ArgumentNullException(nameof(varFloat), "Property is not nullable for class FormatTest."); @@ -868,7 +914,7 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo 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, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); + return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, duplicatePropertyName2, duplicatePropertyName, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid); } /// @@ -904,6 +950,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.BinaryOption.IsSet && formatTest.Binary == null) throw new ArgumentNullException(nameof(formatTest.Binary), "Property is required for class FormatTest."); + if (formatTest.DuplicatePropertyName2Option.IsSet && formatTest.DuplicatePropertyName2 == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName2), "Property is required for class FormatTest."); + + if (formatTest.DuplicatePropertyNameOption.IsSet && formatTest.DuplicatePropertyName == null) + throw new ArgumentNullException(nameof(formatTest.DuplicatePropertyName), "Property is required for class FormatTest."); + if (formatTest.PatternWithBackslashOption.IsSet && formatTest.PatternWithBackslash == null) throw new ArgumentNullException(nameof(formatTest.PatternWithBackslash), "Property is required for class FormatTest."); @@ -942,6 +994,12 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe if (formatTest.DoubleOption.IsSet) writer.WriteNumber("double", formatTest.DoubleOption.Value.Value); + if (formatTest.DuplicatePropertyName2Option.IsSet) + writer.WriteString("duplicate_property_name", formatTest.DuplicatePropertyName2); + + if (formatTest.DuplicatePropertyNameOption.IsSet) + writer.WriteString("@duplicate_property_name", formatTest.DuplicatePropertyName); + if (formatTest.FloatOption.IsSet) writer.WriteNumber("float", formatTest.FloatOption.Value.Value); diff --git a/samples/client/petstore/csharp/httpclient/net9/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/httpclient/net9/Petstore/api/openapi.yaml index d86a1d2f6d87..1aa598117f1a 100644 --- a/samples/client/petstore/csharp/httpclient/net9/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/httpclient/net9/Petstore/api/openapi.yaml @@ -1714,6 +1714,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date diff --git a/samples/client/petstore/csharp/httpclient/net9/Petstore/docs/FormatTest.md b/samples/client/petstore/csharp/httpclient/net9/Petstore/docs/FormatTest.md index 25a96509f1d5..3d9c0c9d5d30 100644 --- a/samples/client/petstore/csharp/httpclient/net9/Petstore/docs/FormatTest.md +++ b/samples/client/petstore/csharp/httpclient/net9/Petstore/docs/FormatTest.md @@ -30,6 +30,8 @@ Name | Type | Description | Notes **PatternWithBackslash** | **string** | None | [optional] **StringFormattedAsDecimal** | **decimal** | | [optional] **StringFormattedAsDecimalRequired** | **decimal** | | +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/httpclient/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/httpclient/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 70e020f818c6..31cc93ec432b 100644 --- a/samples/client/petstore/csharp/httpclient/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/httpclient/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -70,7 +70,9 @@ protected FormatTest() /// None. /// stringFormattedAsDecimal. /// stringFormattedAsDecimalRequired (required). - public FormatTest(int integer = default, int int32 = default, int int32Range = default, int int64Positive = default, int int64Negative = default, int int64PositiveExclusive = default, int int64NegativeExclusive = default, uint unsignedInteger = default, long int64 = default, ulong unsignedLong = default, decimal number = default, float varFloat = default, double varDouble = default, decimal varDecimal = default, string varString = default, byte[] varByte = default, FileParameter binary = default, DateOnly date = default, DateTime dateTime = default, Guid uuid = default, string password = default, string patternWithDigits = default, string patternWithDigitsAndDelimiter = default, string patternWithBackslash = default, decimal stringFormattedAsDecimal = default, decimal stringFormattedAsDecimalRequired = default) + /// duplicatePropertyName2. + /// duplicatePropertyName. + public FormatTest(int integer = default, int int32 = default, int int32Range = default, int int64Positive = default, int int64Negative = default, int int64PositiveExclusive = default, int int64NegativeExclusive = default, uint unsignedInteger = default, long int64 = default, ulong unsignedLong = default, decimal number = default, float varFloat = default, double varDouble = default, decimal varDecimal = default, string varString = default, byte[] varByte = default, FileParameter binary = default, DateOnly date = default, DateTime dateTime = default, Guid uuid = default, string password = default, string patternWithDigits = default, string patternWithDigitsAndDelimiter = default, string patternWithBackslash = default, decimal stringFormattedAsDecimal = default, decimal stringFormattedAsDecimalRequired = default, string duplicatePropertyName2 = default, string duplicatePropertyName = default) { this.Number = number; // to ensure "varByte" is required (not null) @@ -108,6 +110,8 @@ public FormatTest(int integer = default, int int32 = default, int int32Range = d this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; this.PatternWithBackslash = patternWithBackslash; this.StringFormattedAsDecimal = stringFormattedAsDecimal; + this.DuplicatePropertyName2 = duplicatePropertyName2; + this.DuplicatePropertyName = duplicatePropertyName; this.AdditionalProperties = new Dictionary(); } @@ -279,6 +283,18 @@ public FormatTest(int integer = default, int int32 = default, int int32Range = d [DataMember(Name = "string_formatted_as_decimal_required", IsRequired = true, EmitDefaultValue = true)] public decimal StringFormattedAsDecimalRequired { get; set; } + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [DataMember(Name = "duplicate_property_name", EmitDefaultValue = false)] + public string DuplicatePropertyName2 { get; set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [DataMember(Name = "@duplicate_property_name", EmitDefaultValue = false)] + public string DuplicatePropertyName { get; set; } + /// /// Gets or Sets additional properties /// @@ -319,6 +335,8 @@ public override string ToString() sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -418,6 +436,14 @@ public override int GetHashCode() } hashCode = (hashCode * 59) + this.StringFormattedAsDecimal.GetHashCode(); hashCode = (hashCode * 59) + this.StringFormattedAsDecimalRequired.GetHashCode(); + if (this.DuplicatePropertyName2 != null) + { + hashCode = (hashCode * 59) + this.DuplicatePropertyName2.GetHashCode(); + } + if (this.DuplicatePropertyName != null) + { + hashCode = (hashCode * 59) + this.DuplicatePropertyName.GetHashCode(); + } if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/api/openapi.yaml index d86a1d2f6d87..1aa598117f1a 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 @@ -1714,6 +1714,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date 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 e6ba5f68b3fe..d8093d01992c 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 @@ -30,6 +30,8 @@ Name | Type | Description | Notes **PatternWithBackslash** | **string** | None | [optional] **StringFormattedAsDecimal** | **decimal** | | [optional] **StringFormattedAsDecimalRequired** | **decimal** | | +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/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 0730a2282086..01d0c792593b 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 @@ -70,7 +70,9 @@ protected FormatTest() /// None. /// stringFormattedAsDecimal. /// stringFormattedAsDecimalRequired (required). - public FormatTest(int integer = default, int int32 = default, int int32Range = default, int int64Positive = default, int int64Negative = default, int int64PositiveExclusive = default, int int64NegativeExclusive = default, uint unsignedInteger = default, long int64 = default, ulong unsignedLong = default, decimal number = default, float varFloat = default, double varDouble = default, decimal varDecimal = default, string varString = default, byte[] varByte = default, FileParameter binary = default, DateTime date = default, DateTime dateTime = default, Guid uuid = default, string password = default, string patternWithDigits = default, string patternWithDigitsAndDelimiter = default, string patternWithBackslash = default, decimal stringFormattedAsDecimal = default, decimal stringFormattedAsDecimalRequired = default) + /// duplicatePropertyName2. + /// duplicatePropertyName. + public FormatTest(int integer = default, int int32 = default, int int32Range = default, int int64Positive = default, int int64Negative = default, int int64PositiveExclusive = default, int int64NegativeExclusive = default, uint unsignedInteger = default, long int64 = default, ulong unsignedLong = default, decimal number = default, float varFloat = default, double varDouble = default, decimal varDecimal = default, string varString = default, byte[] varByte = default, FileParameter binary = default, DateTime date = default, DateTime dateTime = default, Guid uuid = default, string password = default, string patternWithDigits = default, string patternWithDigitsAndDelimiter = default, string patternWithBackslash = default, decimal stringFormattedAsDecimal = default, decimal stringFormattedAsDecimalRequired = default, string duplicatePropertyName2 = default, string duplicatePropertyName = default) { this.Number = number; // to ensure "varByte" is required (not null) @@ -108,6 +110,8 @@ public FormatTest(int integer = default, int int32 = default, int int32Range = d this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; this.PatternWithBackslash = patternWithBackslash; this.StringFormattedAsDecimal = stringFormattedAsDecimal; + this.DuplicatePropertyName2 = duplicatePropertyName2; + this.DuplicatePropertyName = duplicatePropertyName; this.AdditionalProperties = new Dictionary(); } @@ -280,6 +284,18 @@ public FormatTest(int integer = default, int int32 = default, int int32Range = d [DataMember(Name = "string_formatted_as_decimal_required", IsRequired = true, EmitDefaultValue = true)] public decimal StringFormattedAsDecimalRequired { get; set; } + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [DataMember(Name = "duplicate_property_name", EmitDefaultValue = false)] + public string DuplicatePropertyName2 { get; set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [DataMember(Name = "@duplicate_property_name", EmitDefaultValue = false)] + public string DuplicatePropertyName { get; set; } + /// /// Gets or Sets additional properties /// @@ -320,6 +336,8 @@ public override string ToString() sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -419,6 +437,14 @@ public override int GetHashCode() } hashCode = (hashCode * 59) + this.StringFormattedAsDecimal.GetHashCode(); hashCode = (hashCode * 59) + this.StringFormattedAsDecimalRequired.GetHashCode(); + if (this.DuplicatePropertyName2 != null) + { + hashCode = (hashCode * 59) + this.DuplicatePropertyName2.GetHashCode(); + } + if (this.DuplicatePropertyName != null) + { + hashCode = (hashCode * 59) + this.DuplicatePropertyName.GetHashCode(); + } if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp/restsharp/net8/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/net8/Petstore/api/openapi.yaml index d86a1d2f6d87..1aa598117f1a 100644 --- a/samples/client/petstore/csharp/restsharp/net8/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/net8/Petstore/api/openapi.yaml @@ -1714,6 +1714,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date diff --git a/samples/client/petstore/csharp/restsharp/net8/Petstore/docs/FormatTest.md b/samples/client/petstore/csharp/restsharp/net8/Petstore/docs/FormatTest.md index 5c185c58a738..4a6a9bee84d5 100644 --- a/samples/client/petstore/csharp/restsharp/net8/Petstore/docs/FormatTest.md +++ b/samples/client/petstore/csharp/restsharp/net8/Petstore/docs/FormatTest.md @@ -30,6 +30,8 @@ Name | Type | Description | Notes **PatternWithBackslash** | **string** | None | [optional] **StringFormattedAsDecimal** | **decimal** | | [optional] **StringFormattedAsDecimalRequired** | **decimal** | | +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/restsharp/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/restsharp/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 408766a19d16..7f8d2409a609 100644 --- a/samples/client/petstore/csharp/restsharp/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/restsharp/net8/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -66,7 +66,9 @@ protected FormatTest() { } /// None. /// stringFormattedAsDecimal. /// stringFormattedAsDecimalRequired (required). - public FormatTest(int integer = default, int int32 = default, int int32Range = default, int int64Positive = default, int int64Negative = default, int int64PositiveExclusive = default, int int64NegativeExclusive = default, uint unsignedInteger = default, long int64 = default, ulong unsignedLong = default, decimal number = default, float varFloat = default, double varDouble = default, decimal varDecimal = default, string varString = default, byte[] varByte = default, System.IO.Stream binary = default, DateOnly date = default, DateTime dateTime = default, Guid uuid = default, string password = default, string patternWithDigits = default, string patternWithDigitsAndDelimiter = default, string patternWithBackslash = default, decimal stringFormattedAsDecimal = default, decimal stringFormattedAsDecimalRequired = default) + /// duplicatePropertyName2. + /// duplicatePropertyName. + public FormatTest(int integer = default, int int32 = default, int int32Range = default, int int64Positive = default, int int64Negative = default, int int64PositiveExclusive = default, int int64NegativeExclusive = default, uint unsignedInteger = default, long int64 = default, ulong unsignedLong = default, decimal number = default, float varFloat = default, double varDouble = default, decimal varDecimal = default, string varString = default, byte[] varByte = default, System.IO.Stream binary = default, DateOnly date = default, DateTime dateTime = default, Guid uuid = default, string password = default, string patternWithDigits = default, string patternWithDigitsAndDelimiter = default, string patternWithBackslash = default, decimal stringFormattedAsDecimal = default, decimal stringFormattedAsDecimalRequired = default, string duplicatePropertyName2 = default, string duplicatePropertyName = default) { this.Number = number; // to ensure "varByte" is required (not null) @@ -104,6 +106,8 @@ public FormatTest(int integer = default, int int32 = default, int int32Range = d this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; this.PatternWithBackslash = patternWithBackslash; this.StringFormattedAsDecimal = stringFormattedAsDecimal; + this.DuplicatePropertyName2 = duplicatePropertyName2; + this.DuplicatePropertyName = duplicatePropertyName; } /// @@ -274,6 +278,18 @@ public FormatTest(int integer = default, int int32 = default, int int32Range = d [DataMember(Name = "string_formatted_as_decimal_required", IsRequired = true, EmitDefaultValue = true)] public decimal StringFormattedAsDecimalRequired { get; set; } + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [DataMember(Name = "duplicate_property_name", EmitDefaultValue = false)] + public string DuplicatePropertyName2 { get; set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [DataMember(Name = "@duplicate_property_name", EmitDefaultValue = false)] + public string DuplicatePropertyName { get; set; } + /// /// Returns the string presentation of the object /// @@ -308,6 +324,8 @@ public override string ToString() sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -406,6 +424,14 @@ public override int GetHashCode() } hashCode = (hashCode * 59) + this.StringFormattedAsDecimal.GetHashCode(); hashCode = (hashCode * 59) + this.StringFormattedAsDecimalRequired.GetHashCode(); + if (this.DuplicatePropertyName2 != null) + { + hashCode = (hashCode * 59) + this.DuplicatePropertyName2.GetHashCode(); + } + if (this.DuplicatePropertyName != null) + { + hashCode = (hashCode * 59) + this.DuplicatePropertyName.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/api/openapi.yaml index d86a1d2f6d87..1aa598117f1a 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 @@ -1714,6 +1714,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date 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 2c414708d688..c6080dc129b5 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 @@ -30,6 +30,8 @@ Name | Type | Description | Notes **PatternWithBackslash** | **string** | None | [optional] **StringFormattedAsDecimal** | **decimal** | | [optional] **StringFormattedAsDecimalRequired** | **decimal** | | +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/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 c1d79614e1ef..cb78ccd5bd53 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 @@ -69,7 +69,9 @@ protected FormatTest() /// None. /// stringFormattedAsDecimal. /// stringFormattedAsDecimalRequired (required). - public FormatTest(int integer = default, int int32 = default, int int32Range = default, int int64Positive = default, int int64Negative = default, int int64PositiveExclusive = default, int int64NegativeExclusive = default, uint unsignedInteger = default, long int64 = default, ulong unsignedLong = default, decimal number = default, float varFloat = default, double varDouble = default, decimal varDecimal = default, string varString = default, byte[] varByte = default, System.IO.Stream binary = default, DateTime date = default, DateTime dateTime = default, Guid uuid = default, string password = default, string patternWithDigits = default, string patternWithDigitsAndDelimiter = default, string patternWithBackslash = default, decimal stringFormattedAsDecimal = default, decimal stringFormattedAsDecimalRequired = default) + /// duplicatePropertyName2. + /// duplicatePropertyName. + public FormatTest(int integer = default, int int32 = default, int int32Range = default, int int64Positive = default, int int64Negative = default, int int64PositiveExclusive = default, int int64NegativeExclusive = default, uint unsignedInteger = default, long int64 = default, ulong unsignedLong = default, decimal number = default, float varFloat = default, double varDouble = default, decimal varDecimal = default, string varString = default, byte[] varByte = default, System.IO.Stream binary = default, DateTime date = default, DateTime dateTime = default, Guid uuid = default, string password = default, string patternWithDigits = default, string patternWithDigitsAndDelimiter = default, string patternWithBackslash = default, decimal stringFormattedAsDecimal = default, decimal stringFormattedAsDecimalRequired = default, string duplicatePropertyName2 = default, string duplicatePropertyName = default) { this._Number = number; // to ensure "varByte" is required (not null) @@ -191,6 +193,16 @@ public FormatTest(int integer = default, int int32 = default, int int32Range = d { this._flagStringFormattedAsDecimal = true; } + this._DuplicatePropertyName2 = duplicatePropertyName2; + if (this.DuplicatePropertyName2 != null) + { + this._flagDuplicatePropertyName2 = true; + } + this._DuplicatePropertyName = duplicatePropertyName; + if (this.DuplicatePropertyName != null) + { + this._flagDuplicatePropertyName = true; + } this.AdditionalProperties = new Dictionary(); } @@ -832,6 +844,54 @@ public bool ShouldSerializeStringFormattedAsDecimalRequired() return _flagStringFormattedAsDecimalRequired; } /// + /// Gets or Sets DuplicatePropertyName2 + /// + [DataMember(Name = "duplicate_property_name", EmitDefaultValue = false)] + public string DuplicatePropertyName2 + { + get{ return _DuplicatePropertyName2;} + set + { + _DuplicatePropertyName2 = value; + _flagDuplicatePropertyName2 = true; + } + } + private string _DuplicatePropertyName2; + private bool _flagDuplicatePropertyName2; + + /// + /// Returns false as DuplicatePropertyName2 should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeDuplicatePropertyName2() + { + return _flagDuplicatePropertyName2; + } + /// + /// Gets or Sets DuplicatePropertyName + /// + [DataMember(Name = "@duplicate_property_name", EmitDefaultValue = false)] + public string DuplicatePropertyName + { + get{ return _DuplicatePropertyName;} + set + { + _DuplicatePropertyName = value; + _flagDuplicatePropertyName = true; + } + } + private string _DuplicatePropertyName; + private bool _flagDuplicatePropertyName; + + /// + /// Returns false as DuplicatePropertyName should not be serialized given that it's read-only. + /// + /// false (boolean) + public bool ShouldSerializeDuplicatePropertyName() + { + return _flagDuplicatePropertyName; + } + /// /// Gets or Sets additional properties /// [JsonExtensionData] @@ -871,6 +931,8 @@ public override string ToString() sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n"); sb.Append("}\n"); return sb.ToString(); @@ -970,6 +1032,14 @@ public override int GetHashCode() } hashCode = (hashCode * 59) + this.StringFormattedAsDecimal.GetHashCode(); hashCode = (hashCode * 59) + this.StringFormattedAsDecimalRequired.GetHashCode(); + if (this.DuplicatePropertyName2 != null) + { + hashCode = (hashCode * 59) + this.DuplicatePropertyName2.GetHashCode(); + } + if (this.DuplicatePropertyName != null) + { + hashCode = (hashCode * 59) + this.DuplicatePropertyName.GetHashCode(); + } if (this.AdditionalProperties != null) { hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode(); diff --git a/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/api/openapi.yaml index d86a1d2f6d87..1aa598117f1a 100644 --- a/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/api/openapi.yaml @@ -1714,6 +1714,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date diff --git a/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/docs/FormatTest.md b/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/docs/FormatTest.md index 5c185c58a738..4a6a9bee84d5 100644 --- a/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/docs/FormatTest.md +++ b/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/docs/FormatTest.md @@ -30,6 +30,8 @@ Name | Type | Description | Notes **PatternWithBackslash** | **string** | None | [optional] **StringFormattedAsDecimal** | **decimal** | | [optional] **StringFormattedAsDecimalRequired** | **decimal** | | +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs b/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs index 1affba019b01..def0153c3f5b 100644 --- a/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs +++ b/samples/client/petstore/csharp/unityWebRequest/net9/Petstore/src/Org.OpenAPITools/Model/FormatTest.cs @@ -64,7 +64,9 @@ protected FormatTest() { } /// None. /// stringFormattedAsDecimal. /// stringFormattedAsDecimalRequired (required). - public FormatTest(int integer = default, int int32 = default, int int32Range = default, int int64Positive = default, int int64Negative = default, int int64PositiveExclusive = default, int int64NegativeExclusive = default, uint unsignedInteger = default, long int64 = default, ulong unsignedLong = default, decimal number = default, float varFloat = default, double varDouble = default, decimal varDecimal = default, string varString = default, byte[] varByte = default, System.IO.Stream binary = default, DateOnly date = default, DateTime dateTime = default, Guid uuid = default, string password = default, string patternWithDigits = default, string patternWithDigitsAndDelimiter = default, string patternWithBackslash = default, decimal stringFormattedAsDecimal = default, decimal stringFormattedAsDecimalRequired = default) + /// duplicatePropertyName2. + /// duplicatePropertyName. + public FormatTest(int integer = default, int int32 = default, int int32Range = default, int int64Positive = default, int int64Negative = default, int int64PositiveExclusive = default, int int64NegativeExclusive = default, uint unsignedInteger = default, long int64 = default, ulong unsignedLong = default, decimal number = default, float varFloat = default, double varDouble = default, decimal varDecimal = default, string varString = default, byte[] varByte = default, System.IO.Stream binary = default, DateOnly date = default, DateTime dateTime = default, Guid uuid = default, string password = default, string patternWithDigits = default, string patternWithDigitsAndDelimiter = default, string patternWithBackslash = default, decimal stringFormattedAsDecimal = default, decimal stringFormattedAsDecimalRequired = default, string duplicatePropertyName2 = default, string duplicatePropertyName = default) { this.Number = number; // to ensure "varByte" is required (not null) @@ -102,6 +104,8 @@ public FormatTest(int integer = default, int int32 = default, int int32Range = d this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; this.PatternWithBackslash = patternWithBackslash; this.StringFormattedAsDecimal = stringFormattedAsDecimal; + this.DuplicatePropertyName2 = duplicatePropertyName2; + this.DuplicatePropertyName = duplicatePropertyName; } /// @@ -272,6 +276,18 @@ public FormatTest(int integer = default, int int32 = default, int int32Range = d [DataMember(Name = "string_formatted_as_decimal_required", IsRequired = true, EmitDefaultValue = true)] public decimal StringFormattedAsDecimalRequired { get; set; } + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [DataMember(Name = "duplicate_property_name", EmitDefaultValue = false)] + public string DuplicatePropertyName2 { get; set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [DataMember(Name = "@duplicate_property_name", EmitDefaultValue = false)] + public string DuplicatePropertyName { get; set; } + /// /// Returns the string presentation of the object /// @@ -306,6 +322,8 @@ public override string ToString() sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -454,6 +472,16 @@ public bool Equals(FormatTest input) ( this.StringFormattedAsDecimalRequired == input.StringFormattedAsDecimalRequired || this.StringFormattedAsDecimalRequired.Equals(input.StringFormattedAsDecimalRequired) + ) && + ( + this.DuplicatePropertyName2 == input.DuplicatePropertyName2 || + (this.DuplicatePropertyName2 != null && + this.DuplicatePropertyName2.Equals(input.DuplicatePropertyName2)) + ) && + ( + this.DuplicatePropertyName == input.DuplicatePropertyName || + (this.DuplicatePropertyName != null && + this.DuplicatePropertyName.Equals(input.DuplicatePropertyName)) ); } @@ -522,6 +550,14 @@ public override int GetHashCode() } hashCode = (hashCode * 59) + this.StringFormattedAsDecimal.GetHashCode(); hashCode = (hashCode * 59) + this.StringFormattedAsDecimalRequired.GetHashCode(); + if (this.DuplicatePropertyName2 != null) + { + hashCode = (hashCode * 59) + this.DuplicatePropertyName2.GetHashCode(); + } + if (this.DuplicatePropertyName != null) + { + hashCode = (hashCode * 59) + this.DuplicatePropertyName.GetHashCode(); + } return hashCode; } } diff --git a/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/unityWebRequest/standard2.0/Petstore/api/openapi.yaml index d86a1d2f6d87..1aa598117f1a 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 @@ -1714,6 +1714,10 @@ components: string_formatted_as_decimal_required: format: decimal type: string + duplicate_property_name: + type: string + '@duplicate_property_name': + type: string required: - byte - date 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 2c414708d688..c6080dc129b5 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 @@ -30,6 +30,8 @@ Name | Type | Description | Notes **PatternWithBackslash** | **string** | None | [optional] **StringFormattedAsDecimal** | **decimal** | | [optional] **StringFormattedAsDecimalRequired** | **decimal** | | +**DuplicatePropertyName2** | **string** | | [optional] +**DuplicatePropertyName** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/csharp/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 72cc4eb653f5..087552f5aa82 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 @@ -64,7 +64,9 @@ protected FormatTest() { } /// None. /// stringFormattedAsDecimal. /// stringFormattedAsDecimalRequired (required). - public FormatTest(int integer = default, int int32 = default, int int32Range = default, int int64Positive = default, int int64Negative = default, int int64PositiveExclusive = default, int int64NegativeExclusive = default, uint unsignedInteger = default, long int64 = default, ulong unsignedLong = default, decimal number = default, float varFloat = default, double varDouble = default, decimal varDecimal = default, string varString = default, byte[] varByte = default, System.IO.Stream binary = default, DateTime date = default, DateTime dateTime = default, Guid uuid = default, string password = default, string patternWithDigits = default, string patternWithDigitsAndDelimiter = default, string patternWithBackslash = default, decimal stringFormattedAsDecimal = default, decimal stringFormattedAsDecimalRequired = default) + /// duplicatePropertyName2. + /// duplicatePropertyName. + public FormatTest(int integer = default, int int32 = default, int int32Range = default, int int64Positive = default, int int64Negative = default, int int64PositiveExclusive = default, int int64NegativeExclusive = default, uint unsignedInteger = default, long int64 = default, ulong unsignedLong = default, decimal number = default, float varFloat = default, double varDouble = default, decimal varDecimal = default, string varString = default, byte[] varByte = default, System.IO.Stream binary = default, DateTime date = default, DateTime dateTime = default, Guid uuid = default, string password = default, string patternWithDigits = default, string patternWithDigitsAndDelimiter = default, string patternWithBackslash = default, decimal stringFormattedAsDecimal = default, decimal stringFormattedAsDecimalRequired = default, string duplicatePropertyName2 = default, string duplicatePropertyName = default) { this.Number = number; // to ensure "varByte" is required (not null) @@ -102,6 +104,8 @@ public FormatTest(int integer = default, int int32 = default, int int32Range = d this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; this.PatternWithBackslash = patternWithBackslash; this.StringFormattedAsDecimal = stringFormattedAsDecimal; + this.DuplicatePropertyName2 = duplicatePropertyName2; + this.DuplicatePropertyName = duplicatePropertyName; } /// @@ -273,6 +277,18 @@ public FormatTest(int integer = default, int int32 = default, int int32Range = d [DataMember(Name = "string_formatted_as_decimal_required", IsRequired = true, EmitDefaultValue = true)] public decimal StringFormattedAsDecimalRequired { get; set; } + /// + /// Gets or Sets DuplicatePropertyName2 + /// + [DataMember(Name = "duplicate_property_name", EmitDefaultValue = false)] + public string DuplicatePropertyName2 { get; set; } + + /// + /// Gets or Sets DuplicatePropertyName + /// + [DataMember(Name = "@duplicate_property_name", EmitDefaultValue = false)] + public string DuplicatePropertyName { get; set; } + /// /// Returns the string presentation of the object /// @@ -307,6 +323,8 @@ public override string ToString() sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n"); sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n"); sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n"); + sb.Append(" DuplicatePropertyName2: ").Append(DuplicatePropertyName2).Append("\n"); + sb.Append(" DuplicatePropertyName: ").Append(DuplicatePropertyName).Append("\n"); sb.Append("}\n"); return sb.ToString(); } @@ -455,6 +473,16 @@ public bool Equals(FormatTest input) ( this.StringFormattedAsDecimalRequired == input.StringFormattedAsDecimalRequired || this.StringFormattedAsDecimalRequired.Equals(input.StringFormattedAsDecimalRequired) + ) && + ( + this.DuplicatePropertyName2 == input.DuplicatePropertyName2 || + (this.DuplicatePropertyName2 != null && + this.DuplicatePropertyName2.Equals(input.DuplicatePropertyName2)) + ) && + ( + this.DuplicatePropertyName == input.DuplicatePropertyName || + (this.DuplicatePropertyName != null && + this.DuplicatePropertyName.Equals(input.DuplicatePropertyName)) ); } @@ -523,6 +551,14 @@ public override int GetHashCode() } hashCode = (hashCode * 59) + this.StringFormattedAsDecimal.GetHashCode(); hashCode = (hashCode * 59) + this.StringFormattedAsDecimalRequired.GetHashCode(); + if (this.DuplicatePropertyName2 != null) + { + hashCode = (hashCode * 59) + this.DuplicatePropertyName2.GetHashCode(); + } + if (this.DuplicatePropertyName != null) + { + hashCode = (hashCode * 59) + this.DuplicatePropertyName.GetHashCode(); + } return hashCode; } }