From 0de216ffed67b68219c965ab35024e85a121836f Mon Sep 17 00:00:00 2001 From: devhl Date: Mon, 21 Jul 2025 19:10:40 -0400 Subject: [PATCH 1/8] started fixing multiple issues --- .../languages/AbstractCSharpCodegen.java | 100 +++++++++++++++--- .../generichost/JsonConverter.mustache | 15 +-- .../generichost/modelGeneric.mustache | 10 +- 3 files changed, 97 insertions(+), 28 deletions(-) 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 84c47521f1d0..db5262ee22fd 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,10 +649,18 @@ 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)); + + if (!property.isEnum) { + CodegenModel composedOf = ModelUtils.getModelByName(property.name, processed); + if (composedOf != null) { + property.isEnum = composedOf.isEnum; + patchPropertyVendorExtensions(property); + } + } } } } @@ -716,7 +724,47 @@ 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; + } + + 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)) { @@ -768,26 +816,44 @@ 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); + + // HOTFIX: https://github.com/OpenAPITools/openapi-generator/issues/14944 + if (property.datatypeWithEnum.equals("decimal")) { + property.isDecimal = true; + } + } + + private void patchNestedMaps(CodegenProperty property) { + // Process nested types before making any replacements to ensure we have the correct inner type + if (property.items != null) { + patchNestedMaps(property.items); + } String[] nestedTypes = {"List", "Collection", "ICollection", "Dictionary"}; + + if (property.datatypeWithEnum != null) { + String originalType = property.datatypeWithEnum; + + for (String nestedType : nestedTypes) { + // fix incorrect data types for maps of maps + if (property.items != null) { + if (property.datatypeWithEnum.contains(", " + nestedType + ">")) { + property.datatypeWithEnum = property.datatypeWithEnum.replace(", " + nestedType + ">", ", " + property.items.datatypeWithEnum + ">"); + } - Arrays.stream(nestedTypes).forEach(nestedType -> { - // fix incorrect data types for maps of maps - if (property.datatypeWithEnum.contains(", " + nestedType + ">") && property.items != null) { - property.datatypeWithEnum = property.datatypeWithEnum.replace(", " + nestedType + ">", ", " + property.items.datatypeWithEnum + ">"); - property.dataType = property.datatypeWithEnum; + if (property.datatypeWithEnum.contains("<" + nestedType + ">")) { + property.datatypeWithEnum = property.datatypeWithEnum.replace("<" + nestedType + ">", "<" + property.items.datatypeWithEnum + ">"); + } + } } - if (property.datatypeWithEnum.contains("<" + nestedType + ">") && property.items != null) { - property.datatypeWithEnum = property.datatypeWithEnum.replace("<" + nestedType + ">", "<" + property.items.datatypeWithEnum + ">"); + // Only update dataType if we actually made changes + if (!originalType.equals(property.datatypeWithEnum)) { property.dataType = property.datatypeWithEnum; } - }); - - // HOTFIX: https://github.com/OpenAPITools/openapi-generator/issues/14944 - if (property.datatypeWithEnum.equals("decimal")) { - property.isDecimal = true; } } diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache index a416373c9dea..ae4eb632a5e9 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache @@ -287,7 +287,7 @@ {{^model.composedSchemas.anyOf}} {{#mappedModels}} if ({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}} != null) - return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); + return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); // a {{#-last}} throw new JsonException(); @@ -299,22 +299,22 @@ {{^composedSchemas.oneOf}} {{^required}} {{#model.composedSchemas.anyOf}} - Option<{{baseType}}{{>NullConditionalProperty}}> {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null + Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null ? default - : new Option<{{baseType}}{{>NullConditionalProperty}}>({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); + : new Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); {{/model.composedSchemas.anyOf}} {{#-last}} {{/-last}} {{/required}} - return new {{classname}}({{#lambda.joinWithComma}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue{{#required}}.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/required}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); + return new {{classname}}({{#lambda.joinWithComma}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue{{#required}}.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/required}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); // b {{/composedSchemas.oneOf}} {{^model.discriminator}} {{#composedSchemas}} {{#oneOf}} {{^vendorExtensions.x-duplicated-data-type}} if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} != null) - return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}ParsedValue{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); + return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}/**{{isEnum}}**/ {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}ParsedValue{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); // c {{/vendorExtensions.x-duplicated-data-type}} {{#-last}} @@ -337,6 +337,7 @@ /// public override void Write(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions jsonSerializerOptions) { + // b {{#lambda.trimLineBreaks}} {{#lambda.copyText}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}} @@ -397,7 +398,7 @@ {{^isPrimitiveType}} { {{datatypeWithEnum}}JsonConverter {{datatypeWithEnum}}JsonConverter = ({{datatypeWithEnum}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}.GetType())); - {{datatypeWithEnum}}JsonConverter.WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}, jsonSerializerOptions); + {{datatypeWithEnum}}JsonConverter.WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}, jsonSerializerOptions); //here {{isEnum}} } {{/isPrimitiveType}} @@ -407,8 +408,10 @@ WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, jsonSerializerOptions); writer.WriteEndObject(); {{/lambda.trimLineBreaks}} + // hi } +// a /// /// Serializes the properties of /// diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/modelGeneric.mustache index 587057cddd32..c6be37ba756e 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/modelGeneric.mustache @@ -17,20 +17,20 @@ /// {{description}}{{^description}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/description}}{{#defaultValue}} (default to {{.}}){{/defaultValue}} {{/isDiscriminator}} {{/allVars}} - {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}({{#lambda.joinWithComma}}{{{dataType}}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{#model.composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{baseType}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/model.composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{parent}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}.{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} + {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}(/**a**/{{#lambda.joinWithComma}}{{{dataType}}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{#model.composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{baseType}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/model.composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{parent}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}.{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} { {{#composedSchemas.anyOf}} - {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; // a1 {{dataType}} {{/composedSchemas.anyOf}} {{name}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{#allVars}} {{^isDiscriminator}} {{^isInherited}} - {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; // a2 {{dataType}} {{/isInherited}} {{#isInherited}} {{#isNew}} - {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; + {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; // a3 {{dataType}} {{/isNew}} {{/isInherited}} {{/isDiscriminator}} @@ -62,7 +62,7 @@ {{^composedSchemas.anyOf}} [JsonConstructor] {{/composedSchemas.anyOf}} - {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}({{#lambda.joinWithComma}}{{#composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{baseType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} + {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}(/**b**/{{#lambda.joinWithComma}}{{#composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{datatypeWithEnum}}}/**{{dataType}}**/{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} { {{#composedSchemas.anyOf}} {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; From be1a19504cdc5824f14ae59837addf3f8229fba9 Mon Sep 17 00:00:00 2001 From: devhl Date: Sat, 26 Jul 2025 15:48:35 -0400 Subject: [PATCH 2/8] weather api builds --- .../csharp/libraries/generichost/JsonConverter.mustache | 3 ++- .../resources/csharp/libraries/generichost/api_test.mustache | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache index ae4eb632a5e9..71407be2b7c6 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache @@ -398,7 +398,8 @@ {{^isPrimitiveType}} { {{datatypeWithEnum}}JsonConverter {{datatypeWithEnum}}JsonConverter = ({{datatypeWithEnum}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}.GetType())); - {{datatypeWithEnum}}JsonConverter.WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}, jsonSerializerOptions); //here {{isEnum}} + {{datatypeWithEnum}}JsonConverter.Write{{^isEnumRef}}Properties{{/isEnumRef}}(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#isNullable}}.Value{{/isNullable}}{{/required}}, jsonSerializerOptions); // isEnumRef: {{isEnumRef}} x-is-reference-type: {{vendorExtensions.x-is-reference-type}} isNullable: {{isNullable}} + {{! what if it is an inner enum? }} } {{/isPrimitiveType}} diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api_test.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api_test.mustache index 330b4cc8f800..c1e417bf231e 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api_test.mustache @@ -39,7 +39,7 @@ namespace {{packageName}}.Test.{{apiPackage}} {{/allParams}} {{#returnType}} var response = await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - var model = response.{{#lambda.first}}{{#responses}}{{vendorExtensions.x-http-status}} {{/responses}}{{/lambda.first}}(); + var model = response.{{#lambda.first}}{{#responses}}{{#dataType}}{{vendorExtensions.x-http-status}} {{/dataType}}{{/responses}}{{/lambda.first}}(); Assert.IsType<{{{.}}}>(model); {{/returnType}} {{^returnType}} From f94d8ce8d847552ab76c9361bbbed463b3cef1a3 Mon Sep 17 00:00:00 2001 From: devhl Date: Mon, 28 Jul 2025 21:58:05 -0400 Subject: [PATCH 3/8] added docstring --- .../languages/AbstractCSharpCodegen.java | 35 +++---------------- 1 file changed, 4 insertions(+), 31 deletions(-) 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 adeab769e85a..19dfd1bb120d 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 @@ -762,6 +762,10 @@ private String setUniquePropertyName(CodegenModel model, CodegenProperty propert 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); @@ -857,37 +861,6 @@ protected void patchProperty(Map enumRefs, CodegenModel mo } } - private void patchNestedMaps(CodegenProperty property) { - // Process nested types before making any replacements to ensure we have the correct inner type - if (property.items != null) { - patchNestedMaps(property.items); - } - - String[] nestedTypes = {"List", "Collection", "ICollection", "Dictionary"}; - - if (property.datatypeWithEnum != null) { - String originalType = property.datatypeWithEnum; - - for (String nestedType : nestedTypes) { - // fix incorrect data types for maps of maps - if (property.items != null) { - if (property.datatypeWithEnum.contains(", " + nestedType + ">")) { - property.datatypeWithEnum = property.datatypeWithEnum.replace(", " + nestedType + ">", ", " + property.items.datatypeWithEnum + ">"); - } - - if (property.datatypeWithEnum.contains("<" + nestedType + ">")) { - property.datatypeWithEnum = property.datatypeWithEnum.replace("<" + nestedType + ">", "<" + property.items.datatypeWithEnum + ">"); - } - } - } - - // Only update dataType if we actually made changes - if (!originalType.equals(property.datatypeWithEnum)) { - property.dataType = property.datatypeWithEnum; - } - } - } - @Override protected List> buildEnumVars(List values, String dataType) { List> enumVars = super.buildEnumVars(values, dataType); From e44fc91dc582dbc25e8070a081c26a185062963d Mon Sep 17 00:00:00 2001 From: devhl Date: Mon, 28 Jul 2025 22:18:26 -0400 Subject: [PATCH 4/8] ensure property names are unique --- .../languages/AbstractCSharpCodegen.java | 8 --- .../generichost/JsonConverter.mustache | 16 ++--- .../libraries/generichost/api_test.mustache | 2 +- .../generichost/modelGeneric.mustache | 10 +-- ...odels-for-testing-with-http-signature.yaml | 4 ++ .../net4.7/FormModels/api/openapi.yaml | 4 ++ .../FormModels/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 +++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 62 +++++++++++++++- .../net4.7/Petstore/api/openapi.yaml | 4 ++ .../net4.7/Petstore/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 +++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 62 +++++++++++++++- .../net4.8/FormModels/api/openapi.yaml | 4 ++ .../FormModels/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 +++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 62 +++++++++++++++- .../net4.8/Petstore/api/openapi.yaml | 4 ++ .../net4.8/Petstore/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 +++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 62 +++++++++++++++- .../net8/FormModels/api/openapi.yaml | 4 ++ .../net8/FormModels/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 +++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 62 +++++++++++++++- .../net8/NullReferenceTypes/api/openapi.yaml | 4 ++ .../docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 +++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 62 +++++++++++++++- .../net8/Petstore/api/openapi.yaml | 4 ++ .../net8/Petstore/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 +++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 62 +++++++++++++++- .../net8/SourceGeneration/api/openapi.yaml | 4 ++ .../docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 +++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 62 +++++++++++++++- .../net9/FormModels/api/openapi.yaml | 4 ++ .../net9/FormModels/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 +++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 62 +++++++++++++++- .../net9/NullReferenceTypes/api/openapi.yaml | 4 ++ .../docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 +++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 62 +++++++++++++++- .../net9/Petstore/api/openapi.yaml | 4 ++ .../net9/Petstore/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 +++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 62 +++++++++++++++- .../net9/SourceGeneration/api/openapi.yaml | 4 ++ .../docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 +++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 62 +++++++++++++++- .../standard2.0/Petstore/api/openapi.yaml | 4 ++ .../Petstore/docs/models/FormatTest.md | 2 + .../Model/FormatTestTests.cs | 18 +++++ .../src/Org.OpenAPITools/Model/FormatTest.cs | 62 +++++++++++++++- .../httpclient/net9/Petstore/api/openapi.yaml | 4 ++ .../net9/Petstore/docs/FormatTest.md | 2 + .../src/Org.OpenAPITools/Model/FormatTest.cs | 28 +++++++- .../standard2.0/Petstore/api/openapi.yaml | 4 ++ .../standard2.0/Petstore/docs/FormatTest.md | 2 + .../src/Org.OpenAPITools/Model/FormatTest.cs | 28 +++++++- .../restsharp/net8/Petstore/api/openapi.yaml | 4 ++ .../net8/Petstore/docs/FormatTest.md | 2 + .../src/Org.OpenAPITools/Model/FormatTest.cs | 28 +++++++- .../ConditionalSerialization/api/openapi.yaml | 4 ++ .../docs/FormatTest.md | 2 + .../src/Org.OpenAPITools/Model/FormatTest.cs | 72 ++++++++++++++++++- .../net9/Petstore/api/openapi.yaml | 4 ++ .../net9/Petstore/docs/FormatTest.md | 2 + .../src/Org.OpenAPITools/Model/FormatTest.cs | 38 +++++++++- .../standard2.0/Petstore/api/openapi.yaml | 4 ++ .../standard2.0/Petstore/docs/FormatTest.md | 2 + .../src/Org.OpenAPITools/Model/FormatTest.cs | 38 +++++++++- 75 files changed, 1370 insertions(+), 56 deletions(-) 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 19dfd1bb120d..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 @@ -653,14 +653,6 @@ public Map postProcessAllModels(Map objs) property.isNullable = true; patchPropertyVendorExtensions(property); property.vendorExtensions.put("x-base-name", model.name.substring(model.name.lastIndexOf('_') + 1)); - - if (!property.isEnum) { - CodegenModel composedOf = ModelUtils.getModelByName(property.name, processed); - if (composedOf != null) { - property.isEnum = composedOf.isEnum; - patchPropertyVendorExtensions(property); - } - } } } } diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache index 71407be2b7c6..a416373c9dea 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/JsonConverter.mustache @@ -287,7 +287,7 @@ {{^model.composedSchemas.anyOf}} {{#mappedModels}} if ({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}} != null) - return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); // a + return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); {{#-last}} throw new JsonException(); @@ -299,22 +299,22 @@ {{^composedSchemas.oneOf}} {{^required}} {{#model.composedSchemas.anyOf}} - Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}> {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null + Option<{{baseType}}{{>NullConditionalProperty}}> {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue = {{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} == null ? default - : new Option<{{{datatypeWithEnum}}}{{>NullConditionalProperty}}>({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); + : new Option<{{baseType}}{{>NullConditionalProperty}}>({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}); {{/model.composedSchemas.anyOf}} {{#-last}} {{/-last}} {{/required}} - return new {{classname}}({{#lambda.joinWithComma}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue{{#required}}.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/required}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); // b + return new {{classname}}({{#lambda.joinWithComma}}{{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}ParsedValue{{#required}}.Value{{#vendorExtensions.x-is-value-type}}{{nrt!}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/required}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}.Value{{nrt!}}{{^isNullable}}{{#vendorExtensions.x-is-value-type}}.Value{{nrt!}}{{/vendorExtensions.x-is-value-type}}{{/isNullable}}{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); {{/composedSchemas.oneOf}} {{^model.discriminator}} {{#composedSchemas}} {{#oneOf}} {{^vendorExtensions.x-duplicated-data-type}} if ({{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} != null) - return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}}/**{{isEnum}}**/ {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}ParsedValue{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); // c + return new {{classname}}({{#lambda.joinWithComma}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}.Value{{/vendorExtensions.x-is-value-type}} {{#model.composedSchemas.anyOf}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#vendorExtensions.x-is-value-type}}{{^isNullable}}.Value{{/isNullable}}{{/vendorExtensions.x-is-value-type}} {{/model.composedSchemas.anyOf}}{{#allVars}}{{^isDiscriminator}}{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}}{{#required}}ParsedValue{{/required}} {{/isDiscriminator}}{{/allVars}}{{/lambda.joinWithComma}}); {{/vendorExtensions.x-duplicated-data-type}} {{#-last}} @@ -337,7 +337,6 @@ /// public override void Write(Utf8JsonWriter writer, {{classname}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, JsonSerializerOptions jsonSerializerOptions) { - // b {{#lambda.trimLineBreaks}} {{#lambda.copyText}} {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}} @@ -398,8 +397,7 @@ {{^isPrimitiveType}} { {{datatypeWithEnum}}JsonConverter {{datatypeWithEnum}}JsonConverter = ({{datatypeWithEnum}}JsonConverter) jsonSerializerOptions.Converters.First(c => c.CanConvert({{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}.GetType())); - {{datatypeWithEnum}}JsonConverter.Write{{^isEnumRef}}Properties{{/isEnumRef}}(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{#isNullable}}.Value{{/isNullable}}{{/required}}, jsonSerializerOptions); // isEnumRef: {{isEnumRef}} x-is-reference-type: {{vendorExtensions.x-is-reference-type}} isNullable: {{isNullable}} - {{! what if it is an inner enum? }} + {{datatypeWithEnum}}JsonConverter.WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{model.classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}{{^required}}Option.Value{{/required}}, jsonSerializerOptions); } {{/isPrimitiveType}} @@ -409,10 +407,8 @@ WriteProperties(writer, {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}, jsonSerializerOptions); writer.WriteEndObject(); {{/lambda.trimLineBreaks}} - // hi } -// a /// /// Serializes the properties of /// diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api_test.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api_test.mustache index c1e417bf231e..330b4cc8f800 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/api_test.mustache @@ -39,7 +39,7 @@ namespace {{packageName}}.Test.{{apiPackage}} {{/allParams}} {{#returnType}} var response = await _instance.{{operationId}}Async({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - var model = response.{{#lambda.first}}{{#responses}}{{#dataType}}{{vendorExtensions.x-http-status}} {{/dataType}}{{/responses}}{{/lambda.first}}(); + var model = response.{{#lambda.first}}{{#responses}}{{vendorExtensions.x-http-status}} {{/responses}}{{/lambda.first}}(); Assert.IsType<{{{.}}}>(model); {{/returnType}} {{^returnType}} diff --git a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/modelGeneric.mustache index c6be37ba756e..587057cddd32 100644 --- a/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/libraries/generichost/modelGeneric.mustache @@ -17,20 +17,20 @@ /// {{description}}{{^description}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/description}}{{#defaultValue}} (default to {{.}}){{/defaultValue}} {{/isDiscriminator}} {{/allVars}} - {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}(/**a**/{{#lambda.joinWithComma}}{{{dataType}}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{#model.composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{baseType}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/model.composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{parent}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}.{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} + {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}({{#lambda.joinWithComma}}{{{dataType}}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{#model.composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{baseType}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/model.composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{#parentModel.composedSchemas.oneOf}}{{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{parent}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}.{{#lambda.titlecase}}{{baseType}}{{/lambda.titlecase}} {{/parentModel.composedSchemas.oneOf}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} { {{#composedSchemas.anyOf}} - {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; // a1 {{dataType}} + {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{/composedSchemas.anyOf}} {{name}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{#allVars}} {{^isDiscriminator}} {{^isInherited}} - {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; // a2 {{dataType}} + {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{/isInherited}} {{#isInherited}} {{#isNew}} - {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; // a3 {{dataType}} + {{name}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; {{/isNew}} {{/isInherited}} {{/isDiscriminator}} @@ -62,7 +62,7 @@ {{^composedSchemas.anyOf}} [JsonConstructor] {{/composedSchemas.anyOf}} - {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}(/**b**/{{#lambda.joinWithComma}}{{#composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{datatypeWithEnum}}}/**{{dataType}}**/{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} + {{#model.vendorExtensions.x-model-is-mutable}}{{>visibility}}{{/model.vendorExtensions.x-model-is-mutable}}{{^model.vendorExtensions.x-model-is-mutable}}internal{{/model.vendorExtensions.x-model-is-mutable}} {{classname}}({{#lambda.joinWithComma}}{{#composedSchemas.anyOf}}{{^required}}Option<{{/required}}{{{baseType}}}{{>NullConditionalProperty}}{{^required}}>{{/required}} {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}} {{/composedSchemas.anyOf}}{{>ModelSignature}}{{/lambda.joinWithComma}}){{#parent}} : base({{#lambda.joinWithComma}}{{>ModelBaseSignature}}{{/lambda.joinWithComma}}){{/parent}} { {{#composedSchemas.anyOf}} {{#lambda.titlecase}}{{name}}{{/lambda.titlecase}}{{^required}}Option{{/required}} = {{#lambda.escape_reserved_word}}{{#lambda.camel_case}}{{name}}{{/lambda.camel_case}}{{/lambda.escape_reserved_word}}; 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; } } From 4575ab7278e1b154298886b8040d15970402d047 Mon Sep 17 00:00:00 2001 From: devhl Date: Fri, 1 Aug 2025 19:34:08 -0400 Subject: [PATCH 5/8] force pr gates to restart --- ...th-fake-endpoints-models-for-testing-with-http-signature.yaml | 1 + 1 file changed, 1 insertion(+) 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 53a2e45a7817..903799ca2c30 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 @@ -1754,6 +1754,7 @@ components: format: date-time example: '2007-12-03T10:15:30+01:00' uuid: + type: string format: uuid example: 72f98069-206d-4f12-9f12-3d1e525a8e84 From 6cb1c8a07ba76e97db9ca960fdd7446fc1c9c3d0 Mon Sep 17 00:00:00 2001 From: devhl Date: Fri, 1 Aug 2025 19:34:26 -0400 Subject: [PATCH 6/8] force pr gates to restart --- ...th-fake-endpoints-models-for-testing-with-http-signature.yaml | 1 - 1 file changed, 1 deletion(-) 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 903799ca2c30..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 @@ -1754,7 +1754,6 @@ components: format: date-time example: '2007-12-03T10:15:30+01:00' uuid: - type: string format: uuid example: 72f98069-206d-4f12-9f12-3d1e525a8e84 From 2071be2109ef119a05eff31d073d0b8342fac893 Mon Sep 17 00:00:00 2001 From: devhl Date: Sat, 2 Aug 2025 00:26:37 -0400 Subject: [PATCH 7/8] force pr gates to restart --- .../generichost/latest/HelloWorld/.openapi-generator/FILES | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/client/petstore/csharp/generichost/latest/HelloWorld/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/latest/HelloWorld/.openapi-generator/FILES index 479e2c02cc5c..b6b7b12372e4 100644 --- a/samples/client/petstore/csharp/generichost/latest/HelloWorld/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/generichost/latest/HelloWorld/.openapi-generator/FILES @@ -7,6 +7,7 @@ docs/apis/DefaultApi.md docs/models/HelloWorldPostRequest.md docs/scripts/git_push.ps1 docs/scripts/git_push.sh + src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj src/Org.OpenAPITools.Test/README.md From d7b689f3a7e7352ab47b1acfa5baace1ded474a7 Mon Sep 17 00:00:00 2001 From: devhl Date: Sat, 2 Aug 2025 00:26:54 -0400 Subject: [PATCH 8/8] force pr gates to restart --- .../generichost/latest/HelloWorld/.openapi-generator/FILES | 1 - 1 file changed, 1 deletion(-) diff --git a/samples/client/petstore/csharp/generichost/latest/HelloWorld/.openapi-generator/FILES b/samples/client/petstore/csharp/generichost/latest/HelloWorld/.openapi-generator/FILES index b6b7b12372e4..479e2c02cc5c 100644 --- a/samples/client/petstore/csharp/generichost/latest/HelloWorld/.openapi-generator/FILES +++ b/samples/client/petstore/csharp/generichost/latest/HelloWorld/.openapi-generator/FILES @@ -7,7 +7,6 @@ docs/apis/DefaultApi.md docs/models/HelloWorldPostRequest.md docs/scripts/git_push.ps1 docs/scripts/git_push.sh - src/Org.OpenAPITools.Test/Api/DependencyInjectionTests.cs src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj src/Org.OpenAPITools.Test/README.md