From 829b9534d501c55a030b745bb93099dbab093427 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 19 Mar 2024 09:27:02 +0800 Subject: [PATCH] Add name in various cases in property, parameter names (#18139) * create nameInPascalCase * add back name in camel case * update abstract cpp codegen * update erlang templates, update samples * update tests * add param names in various cases * clean up * fix --- .../codegen/CodegenParameter.java | 25 ++++++++++++++++- .../openapitools/codegen/CodegenProperty.java | 16 +++++++++-- .../openapitools/codegen/DefaultCodegen.java | 22 +++++++++++++-- .../codegen/languages/AbstractAdaCodegen.java | 14 +++------- .../codegen/languages/AbstractCppCodegen.java | 2 +- .../languages/AbstractKotlinCodegen.java | 2 +- .../languages/AbstractPythonCodegen.java | 2 +- .../AbstractPythonPydanticV1Codegen.java | 2 +- .../codegen/languages/GoClientCodegen.java | 2 +- .../languages/RustAxumServerCodegen.java | 23 ---------------- .../codegen/languages/RustServerCodegen.java | 6 ++--- .../TypeScriptFetchClientCodegen.java | 2 +- .../Java/libraries/feign/pojo.mustache | 4 +-- .../Java/libraries/jersey2/pojo.mustache | 4 +-- .../Java/libraries/jersey3/pojo.mustache | 4 +-- .../Java/libraries/microprofile/pojo.mustache | 4 +-- .../Java/libraries/native/pojo.mustache | 4 +-- .../Java/libraries/okhttp-gson/pojo.mustache | 4 +-- .../src/main/resources/Java/pojo.mustache | 4 +-- .../resources/JavaJaxRS/cxf-cdi/pojo.mustache | 4 +-- .../resources/JavaJaxRS/cxf-ext/pojo.mustache | 4 +-- .../resources/JavaJaxRS/cxf/pojo.mustache | 4 +-- .../JavaJaxRS/libraries/jersey3/pojo.mustache | 4 +-- .../main/resources/JavaJaxRS/pojo.mustache | 4 +-- .../resources/JavaJaxRS/spec/pojo.mustache | 8 +++--- .../resources/JavaPlayFramework/pojo.mustache | 4 +-- .../main/resources/JavaSpring/pojo.mustache | 12 ++++----- .../generichost/JsonConverter.mustache | 4 +-- .../resources/elm/customTypeDecoder.mustache | 2 +- .../src/main/resources/elm/model.mustache | 2 +- .../src/main/resources/elm/record.mustache | 8 +++--- .../resources/elm/recordFieldDecoder.mustache | 2 +- .../resources/elm/recordFieldEncoder.mustache | 2 +- .../resources/erlang-client/model.mustache | 4 +-- .../client/libraries/mp/pojo.mustache | 4 +-- .../client/libraries/se/pojo.mustache | 4 +-- .../server/libraries/mp/pojo.mustache | 4 +-- .../java-micronaut/common/model/pojo.mustache | 4 +-- .../resources/java-msf4j-server/pojo.mustache | 4 +-- .../main/resources/java-pkmst/pojo.mustache | 4 +-- .../kotlin-client/data_class.mustache | 14 +++++----- .../kotlin-client/data_class_opt_var.mustache | 2 +- .../kotlin-client/data_class_req_var.mustache | 2 +- .../kotlin-client/interface_opt_var.mustache | 2 +- .../kotlin-client/interface_req_var.mustache | 2 +- .../SerializerHelper.kt.mustache | 4 +-- .../kotlin-client/model_room.mustache | 6 ++--- .../data_class.mustache | 2 +- .../data_class_opt_var.mustache | 2 +- .../data_class_req_var.mustache | 2 +- .../kotlin-server/data_class.mustache | 2 +- .../kotlin-server/data_class_opt_var.mustache | 2 +- .../kotlin-server/data_class_req_var.mustache | 2 +- .../libraries/jaxrs-spec/data_class.mustache | 2 +- .../jaxrs-spec/data_class_opt_var.mustache | 2 +- .../jaxrs-spec/data_class_req_var.mustache | 2 +- .../kotlin-spring/dataClass.mustache | 2 +- .../kotlin-spring/dataClassOptVar.mustache | 2 +- .../kotlin-spring/dataClassReqVar.mustache | 2 +- .../kotlin-spring/interfaceOptVar.mustache | 2 +- .../kotlin-spring/interfaceReqVar.mustache | 2 +- .../kotlin-vertx-server/data_class.mustache | 2 +- .../data_class_opt_var.mustache | 2 +- .../data_class_req_var.mustache | 2 +- .../data_class_bind_field_req.mustache | 2 +- .../ktorm-schema/data_class_enum_opt.mustache | 2 +- .../ktorm-schema/data_class_enum_req.mustache | 2 +- .../resources/php-nextgen/model_test.mustache | 2 +- .../php-slim4-server/model_test.mustache | 2 +- .../php-symfony/model_generic.mustache | 4 +-- .../php-symfony/model_variables.mustache | 4 +-- .../php-symfony/testing/model_test.mustache | 2 +- .../main/resources/php/model_test.mustache | 2 +- .../codegen/DefaultCodegenTest.java | 24 +++++++++++++++++ .../codegen/java/JavaModelTest.java | 27 ++++++++++++------- .../handler/PathHandlerInterface.java | 6 ++--- 76 files changed, 219 insertions(+), 164 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java index 70da32747676..f90cd3d35d71 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenParameter.java @@ -39,6 +39,9 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { collectionFormat, description, unescapedDescription, baseType, defaultValue, enumDefaultValue, enumName, style; public String nameInLowerCase; // property name in lower case + public String nameInCamelCase; // property name in camel case (e.g. modifiedDate) + public String nameInPascalCase; // property name in pascal case (e.g. ModifiedDate) + public String nameInSnakeCase; // property name in upper snake case public String example; // example value (x-example) public Map examples; public String jsonSchema; @@ -184,6 +187,11 @@ public CodegenParameter copy() { output.additionalProperties = this.additionalProperties; output.isNull = this.isNull; output.isVoid = this.isVoid; + output.nameInPascalCase = this.nameInPascalCase; + output.nameInCamelCase = this.nameInCamelCase; + output.nameInLowerCase = this.nameInLowerCase; + output.nameInSnakeCase = this.nameInSnakeCase; + output.setAdditionalPropertiesIsAnyType(this.getAdditionalPropertiesIsAnyType()); output.setHasVars(this.hasVars); output.setHasRequired(this.hasRequired); @@ -265,7 +273,22 @@ public CodegenParameter copy() { @Override public int hashCode() { - return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, containerType, containerTypeMapped, defaultValue, enumDefaultValue, enumName, style, isDeepObject, isMatrix, isAllowEmptyValue, example, examples, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, isEnumRef, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, isVoid, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content, requiredVarsMap, ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties); + return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, + isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, + paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, + unescapedDescription, baseType, containerType, containerTypeMapped, defaultValue, + enumDefaultValue, enumName, style, isDeepObject, isMatrix, isAllowEmptyValue, example, examples, + jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, + isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isPassword, + isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, isEnumRef, _enum, allowableValues, + items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, + getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), + getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), + getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull,isVoid, + additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, + hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content, + requiredVarsMap, ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties, + nameInPascalCase, nameInCamelCase, nameInLowerCase, nameInSnakeCase); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java index eb5e7044f8f3..fa1748344803 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java @@ -182,8 +182,10 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti public boolean hasValidation; // true if pattern, maximum, etc are set (only used in the mustache template) public boolean isInherited; public String discriminatorValue; + public String nameInLowerCase; // property name in lower case - public String nameInCamelCase; // property name in camel case + public String nameInCamelCase; // property name in camel case (e.g. modifiedDate) + public String nameInPascalCase; // property name in pascal case (e.g. ModifiedDate) public String nameInSnakeCase; // property name in upper snake case // enum name based on the property name, usually use as a prefix (e.g. VAR_NAME) for enum name (e.g. VAR_NAME_VALUE1) public String enumName; @@ -697,6 +699,14 @@ public void setNameInCamelCase(String nameInCamelCase) { this.nameInCamelCase = nameInCamelCase; } + public String getNameInPascalCase() { + return nameInPascalCase; + } + + public void setNameInPascalCase(String nameInPascalCase) { + this.nameInPascalCase = nameInPascalCase; + } + public String getNameInSnakeCase() { return nameInSnakeCase; } @@ -1213,6 +1223,7 @@ public String toString() { sb.append(", isInherited=").append(isInherited); sb.append(", discriminatorValue='").append(discriminatorValue).append('\''); sb.append(", nameInCamelCase='").append(nameInCamelCase).append('\''); + sb.append(", nameInPascalCase='").append(nameInPascalCase).append('\''); sb.append(", nameInSnakeCase='").append(nameInSnakeCase).append('\''); sb.append(", enumName='").append(enumName).append('\''); sb.append(", maxItems=").append(maxItems); @@ -1352,6 +1363,7 @@ public boolean equals(Object o) { Objects.equals(vendorExtensions, that.vendorExtensions) && Objects.equals(discriminatorValue, that.discriminatorValue) && Objects.equals(nameInCamelCase, that.nameInCamelCase) && + Objects.equals(nameInPascalCase, that.nameInPascalCase) && Objects.equals(nameInSnakeCase, that.nameInSnakeCase) && Objects.equals(enumName, that.enumName) && Objects.equals(maxItems, that.maxItems) && @@ -1376,7 +1388,7 @@ public int hashCode() { isArray, isMap, isEnum, isInnerEnum, isEnumRef, isAnyType, isReadOnly, isWriteOnly, isNullable, isShort, isUnboundedInteger, isSelfReference, isCircularReference, isDiscriminator, isNew, isOverridden, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, - vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInCamelCase, + vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInPascalCase, nameInCamelCase, nameInSnakeCase, enumName, maxItems, minItems, isXmlAttribute, xmlPrefix, xmlName, xmlNamespace, isXmlWrapped, isNull, isVoid, additionalPropertiesIsAnyType, hasVars, hasRequired, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, requiredVarsMap, diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index c06b4172e6bf..fb319ba70e44 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -65,6 +65,7 @@ import org.openapitools.codegen.serializer.SerializerUtils; import org.openapitools.codegen.templating.MustacheEngineAdapter; import org.openapitools.codegen.templating.mustache.*; +import org.openapitools.codegen.utils.CamelizeOption; import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.OneOfImplementorAdditionalData; import org.slf4j.Logger; @@ -82,6 +83,7 @@ import java.util.stream.Stream; import static org.openapitools.codegen.CodegenConstants.UNSUPPORTED_V310_SPEC_MSG; +import static org.openapitools.codegen.utils.CamelizeOption.LOWERCASE_FIRST_LETTER; import static org.openapitools.codegen.utils.OnceLogger.once; import static org.openapitools.codegen.utils.StringUtils.*; @@ -4012,8 +4014,9 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required, boo } else { property.openApiType = p.getType(); } - property.nameInCamelCase = camelize(property.name); - property.nameInSnakeCase = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, property.nameInCamelCase); + property.nameInPascalCase = camelize(property.name); + property.nameInCamelCase = camelize(property.name, LOWERCASE_FIRST_LETTER); + property.nameInSnakeCase = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, property.nameInPascalCase); property.description = escapeText(p.getDescription()); property.unescapedDescription = p.getDescription(); property.title = p.getTitle(); @@ -5458,6 +5461,11 @@ public CodegenParameter fromParameter(Parameter parameter, Set imports) codegenParameter.isCollectionFormatMulti = true; } codegenParameter.paramName = toParamName(parameter.getName()); + codegenParameter.nameInCamelCase = camelize(codegenParameter.paramName, LOWERCASE_FIRST_LETTER); + codegenParameter.nameInPascalCase = camelize(codegenParameter.paramName); + codegenParameter.nameInSnakeCase = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, codegenParameter.nameInPascalCase); + codegenParameter.nameInLowerCase = codegenParameter.paramName.toLowerCase(Locale.ROOT); + // import if (codegenProperty.complexType != null) { imports.add(codegenProperty.complexType); @@ -7185,6 +7193,11 @@ public CodegenParameter fromFormProperty(String name, Schema propertySchema, Set codegenParameter.dataType = codegenProperty.dataType; codegenParameter.baseName = codegenProperty.baseName; codegenParameter.paramName = toParamName(codegenParameter.baseName); + codegenParameter.nameInCamelCase = camelize(codegenParameter.paramName, LOWERCASE_FIRST_LETTER); + codegenParameter.nameInPascalCase = camelize(codegenParameter.paramName); + codegenParameter.nameInSnakeCase = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, codegenParameter.nameInPascalCase); + codegenParameter.nameInLowerCase = codegenParameter.paramName.toLowerCase(Locale.ROOT); + codegenParameter.dataFormat = codegenProperty.dataFormat; // non-array/map updateCodegenPropertyEnum(codegenProperty); @@ -7569,6 +7582,11 @@ protected void updateRequestBodyForArray(CodegenParameter codegenParameter, Sche codegenParameter.baseName = bodyParameterName; } codegenParameter.paramName = toArrayModelParamName(codegenParameter.baseName); + codegenParameter.nameInCamelCase = camelize(codegenParameter.paramName, LOWERCASE_FIRST_LETTER); + codegenParameter.nameInPascalCase = camelize(codegenParameter.paramName); + codegenParameter.nameInSnakeCase = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, codegenParameter.nameInPascalCase); + codegenParameter.nameInLowerCase = codegenParameter.paramName.toLowerCase(Locale.ROOT); + codegenParameter.items = codegenProperty.items; codegenParameter.mostInnerItems = codegenProperty.mostInnerItems; codegenParameter.dataType = getTypeDeclaration(arraySchema); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java index 5087cf7240de..887bb9ab6ea9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractAdaCodegen.java @@ -469,9 +469,9 @@ else if ("Integer".equals(datatype) || "Long".equals(datatype) || public CodegenProperty fromProperty(String name, Schema p, boolean required) { CodegenProperty property = super.fromProperty(name, p, required); if (property != null) { - String nameInCamelCase = property.nameInCamelCase; - nameInCamelCase = sanitizeName(nameInCamelCase); - property.nameInCamelCase = nameInCamelCase; + String nameInPascalCase = property.nameInPascalCase; + nameInPascalCase = sanitizeName(nameInPascalCase); + property.nameInPascalCase = nameInPascalCase; } return property; } @@ -650,10 +650,6 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation } } } - for (CodegenProperty header : rsp.headers) { - header.nameInCamelCase = toModelName(header.baseName); - header.nameInLowerCase = header.baseName.toLowerCase(Locale.ROOT); - } } return op; @@ -845,10 +841,6 @@ private void postProcessOperationWithModels(CodegenOperation op, List } } } - for (CodegenProperty header : rsp.headers) { - header.nameInCamelCase = toModelName(header.baseName); - header.nameInLowerCase = header.baseName.toLowerCase(Locale.ROOT); - } } /* diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java index 08b6023cd3ca..634d63b6c1c9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractCppCodegen.java @@ -280,7 +280,7 @@ public String toParamName(String name) { @Override public CodegenProperty fromProperty(String name, Schema p, boolean required) { CodegenProperty property = super.fromProperty(name, p, required); - String nameInCamelCase = property.nameInCamelCase; + String nameInCamelCase = property.nameInPascalCase; if (nameInCamelCase.length() > 1) { nameInCamelCase = sanitizeName(Character.toLowerCase(nameInCamelCase.charAt(0)) + nameInCamelCase.substring(1)); } else { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index 83843142ae2d..ea5082d6b135 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -648,7 +648,7 @@ public String toEnumVarName(String value, String datatype) { @Override public String toEnumName(CodegenProperty property) { - return property.nameInCamelCase; + return property.nameInPascalCase; } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java index f35cb23d722d..6574bdc9a5ab 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonCodegen.java @@ -2062,7 +2062,7 @@ private PythonType getType(CodegenProperty cp) { values.add((String) enumVar.get("value")); } } - return String.format(Locale.ROOT, "%sEnum", cp.nameInCamelCase); + return String.format(Locale.ROOT, "%sEnum", cp.nameInPascalCase); } else*/ if (result == null) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java index 921f28c3f709..6c2adeba4958 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPythonPydanticV1Codegen.java @@ -1351,7 +1351,7 @@ private String getPydanticType(CodegenProperty cp, values.add((String) enumVar.get("value")); } } - return String.format(Locale.ROOT, "%sEnum", cp.nameInCamelCase); + return String.format(Locale.ROOT, "%sEnum", cp.nameInPascalCase); } else*/ if (cp.isArray) { String constraints = ""; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java index 75d6d254dd79..f079b4507867 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java @@ -453,7 +453,7 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required) { CodegenProperty prop = super.fromProperty(name, p, required); String cc = camelize(prop.name, LOWERCASE_FIRST_LETTER); if (isReservedWord(cc)) { - cc = escapeReservedWord(cc); + cc = escapeReservedWord(cc); // e.g. byte => byte_ } prop.nameInCamelCase = cc; return prop; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustAxumServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustAxumServerCodegen.java index ecbc29c5c32c..e484122421ff 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustAxumServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustAxumServerCodegen.java @@ -550,20 +550,6 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation } } } - - for (CodegenProperty header : rsp.headers) { - header.nameInCamelCase = toModelName(header.baseName); - header.nameInLowerCase = header.baseName.toLowerCase(Locale.ROOT); - } - } - - for (CodegenParameter header : op.headerParams) { - header.nameInLowerCase = header.baseName.toLowerCase(Locale.ROOT); - } - - for (CodegenProperty header : op.responseHeaders) { - header.nameInCamelCase = toModelName(header.baseName); - header.nameInLowerCase = header.baseName.toLowerCase(Locale.ROOT); } return op; @@ -636,15 +622,6 @@ private void postProcessOperationWithModels(CodegenOperation op) { param.vendorExtensions.put("x-consumes-json", true); } } - - for (CodegenParameter header : op.headerParams) { - header.nameInLowerCase = header.baseName.toLowerCase(Locale.ROOT); - } - - for (CodegenProperty header : op.responseHeaders) { - header.nameInCamelCase = toModelName(header.baseName); - header.nameInLowerCase = header.baseName.toLowerCase(Locale.ROOT); - } } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java index 2f2d9f074863..0b0b8b070aea 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustServerCodegen.java @@ -773,7 +773,7 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation if (uuidType.equals(header.dataType)) { additionalProperties.put("apiUsesUuid", true); } - header.nameInCamelCase = toModelName(header.baseName); + header.nameInPascalCase = toModelName(header.baseName); header.nameInLowerCase = header.baseName.toLowerCase(Locale.ROOT); } } @@ -786,7 +786,7 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation if (uuidType.equals(header.dataType)) { additionalProperties.put("apiUsesUuid", true); } - header.nameInCamelCase = toModelName(header.baseName); + header.nameInPascalCase = toModelName(header.baseName); header.nameInLowerCase = header.baseName.toLowerCase(Locale.ROOT); } @@ -881,7 +881,7 @@ private void postProcessOperationWithModels(CodegenOperation op, List if (uuidType.equals(header.dataType)) { additionalProperties.put("apiUsesUuid", true); } - header.nameInCamelCase = toModelName(header.baseName); + header.nameInPascalCase = toModelName(header.baseName); header.nameInLowerCase = header.baseName.toLowerCase(Locale.ROOT); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java index 7a4f51e971c2..0b1883308223 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java @@ -1239,7 +1239,7 @@ public ExtendedCodegenProperty(CodegenProperty cp) { this.isInherited = cp.isInherited; this.discriminatorValue = cp.discriminatorValue; this.nameInLowerCase = cp.nameInLowerCase; - this.nameInCamelCase = cp.nameInCamelCase; + this.nameInPascalCase = cp.nameInPascalCase; this.nameInSnakeCase = cp.nameInSnakeCase; this.enumName = cp.enumName; this.maxItems = cp.maxItems; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pojo.mustache index 037cb1b11e62..f1786f2a495d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pojo.mustache @@ -133,7 +133,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); @@ -156,7 +156,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache index a82e337d8d03..c099cbd0e036 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache @@ -133,7 +133,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); @@ -156,7 +156,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache index 5446eeba9a0c..2898ccaeac7a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache @@ -145,7 +145,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); @@ -168,7 +168,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache index aca66a726e83..5b0f260635d1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache @@ -125,7 +125,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } @@ -135,7 +135,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache index d965736903e4..c440057eb76e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache @@ -133,7 +133,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); @@ -156,7 +156,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache index 58f26f647765..067ceade0d6e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pojo.mustache @@ -128,7 +128,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } @@ -138,7 +138,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index 6c213b93a529..ebf0883d4f3c 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -138,7 +138,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); @@ -161,7 +161,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache index 13a5cea6f491..856e70f7d0e9 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache @@ -50,7 +50,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } @@ -61,7 +61,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache index 527c389546ba..8f5d70e41922 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache @@ -112,7 +112,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi *
N.B. {{name}} is read only; client code should not call this method. {{/isReadOnly}} */ - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { this.{{name}}.add({{name}}Item); return this; } @@ -125,7 +125,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi *
N.B. {{name}} is read only; client code should not call this method. {{/isReadOnly}} */ - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { this.{{name}}.put(key, {{name}}Item); return this; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache index 9e707960cc76..6fb7cc552873 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache @@ -148,7 +148,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); @@ -164,7 +164,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey3/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey3/pojo.mustache index ff10e14468b9..56d29332ff4b 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey3/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey3/pojo.mustache @@ -46,7 +46,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } @@ -56,7 +56,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache index 6a530aca2879..374e0ee54270 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache @@ -46,7 +46,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } @@ -56,7 +56,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache index 8646fe2347f9..c7b55b1afa91 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache @@ -83,7 +83,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } @@ -92,7 +92,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens return this; } - public {{classname}} remove{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} remove{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { if ({{name}}Item != null && this.{{name}} != null) { this.{{name}}.remove({{name}}Item); } @@ -101,7 +101,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens } {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } @@ -110,7 +110,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens return this; } - public {{classname}} remove{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} remove{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { if ({{name}}Item != null && this.{{name}} != null) { this.{{name}}.remove({{name}}Item); } diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache index dfb6062aeb4d..f16334328b4f 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache @@ -53,7 +53,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } @@ -63,7 +63,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index 3bbcddb75e51..bb230120be8a 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -141,7 +141,7 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#openApiNullable}} if (this.{{name}} == null{{#isNullable}} || !this.{{name}}.isPresent(){{/isNullable}}) { this.{{name}} = {{#isNullable}}JsonNullable.of({{/isNullable}}{{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}{{#isNullable}}){{/isNullable}}; @@ -159,7 +159,7 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#openApiNullable}} if (this.{{name}} == null{{#isNullable}} || !this.{{name}}.isPresent(){{/isNullable}}) { this.{{name}} = {{#isNullable}}JsonNullable.of({{/isNullable}}{{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}HashMap{{/uniqueItems}}<>(){{/defaultValue}}{{#isNullable}}){{/isNullable}}; @@ -257,15 +257,15 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { - super.add{{nameInCamelCase}}Item({{name}}Item); + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + super.add{{nameInPascalCase}}Item({{name}}Item); return this; } {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { - super.put{{nameInCamelCase}}Item(key, {{name}}Item); + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + super.put{{nameInPascalCase}}Item(key, {{name}}Item); return this; } {{/isMap}} 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 fc08f46dda9a..28ded0fd3256 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 @@ -473,12 +473,12 @@ {{#-first}} {{#isString}} if ({{#lambda.pasteLine}}{{/lambda.pasteLine}} != null){{! we cant use name here because enumVar also has a name property, so use the paste lambda instead }} - writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{nameInCamelCase}}{{/lambda.camelcase_sanitize_param}}RawValue); + writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{nameInPascalCase}}{{/lambda.camelcase_sanitize_param}}RawValue); else writer.WriteNull("{{baseName}}"); {{/isString}} {{^isString}} - writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{nameInCamelCase}}{{/lambda.camelcase_sanitize_param}}RawValue); + writer.WriteNumber("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{nameInPascalCase}}{{/lambda.camelcase_sanitize_param}}RawValue); {{/isString}} {{/-first}} {{/enumVars}} diff --git a/modules/openapi-generator/src/main/resources/elm/customTypeDecoder.mustache b/modules/openapi-generator/src/main/resources/elm/customTypeDecoder.mustache index fa42e3b5f928..9f800ed52b23 100644 --- a/modules/openapi-generator/src/main/resources/elm/customTypeDecoder.mustache +++ b/modules/openapi-generator/src/main/resources/elm/customTypeDecoder.mustache @@ -1,4 +1,4 @@ -{{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}{{enumName}}Decoder : Json.Decode.Decoder {{classname}}{{nameInCamelCase}} +{{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}{{enumName}}Decoder : Json.Decode.Decoder {{classname}}{{nameInPascalCase}} {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}{{enumName}}Decoder = Json.Decode.{{#isString}}string{{/isString}}{{^isString}}int{{/isString}} |> Json.Decode.andThen diff --git a/modules/openapi-generator/src/main/resources/elm/model.mustache b/modules/openapi-generator/src/main/resources/elm/model.mustache index b78def71cf42..eafc7d46bc64 100644 --- a/modules/openapi-generator/src/main/resources/elm/model.mustache +++ b/modules/openapi-generator/src/main/resources/elm/model.mustache @@ -1,7 +1,7 @@ {{>licenseInfo}} module Api.Data exposing -{{#models}}{{#model}} {{#-first}}( {{/-first}}{{^-first}}, {{/-first}}{{classname}}{{#discriminator}}(..){{/discriminator}}{{^discriminator}}{{#oneOf}}{{#-first}}(..){{/-first}}{{/oneOf}}{{/discriminator}}{{#isEnum}}(..), {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}Variants{{/isEnum}}{{^isEnum}}{{#vars}}{{#isCircularReference}}, {{classname}}{{nameInCamelCase}}(..){{/isCircularReference}}{{#isEnum}}, {{classname}}{{nameInCamelCase}}(..), {{#lambda.camelcase}}{{classname}}{{nameInCamelCase}}{{/lambda.camelcase}}Variants{{/isEnum}}{{/vars}}{{/isEnum}} +{{#models}}{{#model}} {{#-first}}( {{/-first}}{{^-first}}, {{/-first}}{{classname}}{{#discriminator}}(..){{/discriminator}}{{^discriminator}}{{#oneOf}}{{#-first}}(..){{/-first}}{{/oneOf}}{{/discriminator}}{{#isEnum}}(..), {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}Variants{{/isEnum}}{{^isEnum}}{{#vars}}{{#isCircularReference}}, {{classname}}{{nameInPascalCase}}(..){{/isCircularReference}}{{#isEnum}}, {{classname}}{{nameInPascalCase}}(..), {{#lambda.camelcase}}{{classname}}{{nameInPascalCase}}{{/lambda.camelcase}}Variants{{/isEnum}}{{/vars}}{{/isEnum}} {{/model}}{{/models}}{{#models}}{{#model}} , {{#lambda.camelcase}}encode{{classname}}{{/lambda.camelcase}} {{/model}}{{/models}}{{#models}}{{#model}}{{#isEnum}} , stringFrom{{^paramName}}{{classname}}{{/paramName}}{{enumName}} {{/isEnum}}{{/model}}{{/models}}{{#models}}{{#model}} , {{#lambda.camelcase}}{{classname}}{{/lambda.camelcase}}Decoder diff --git a/modules/openapi-generator/src/main/resources/elm/record.mustache b/modules/openapi-generator/src/main/resources/elm/record.mustache index 4039db3fa347..7959d240ab58 100644 --- a/modules/openapi-generator/src/main/resources/elm/record.mustache +++ b/modules/openapi-generator/src/main/resources/elm/record.mustache @@ -9,16 +9,16 @@ type {{classname}} type alias {{#discriminator}}Base{{/discriminator}}{{classname}} = {{#lambda.indented}} { {{#parent}}{{#allOf}}{{^-first}}, {{/-first}}{{#lambda.camelcase}}{{.}}{{/lambda.camelcase}}: {{.}} -{{/allOf}}, {{/parent}}{{#vars}}{{^-first}}, {{/-first}}{{name}} : {{#isCircularReference}}{{classname}}{{nameInCamelCase}}{{/isCircularReference}}{{^isCircularReference}}{{>recordField}}{{/isCircularReference}} +{{/allOf}}, {{/parent}}{{#vars}}{{^-first}}, {{/-first}}{{name}} : {{#isCircularReference}}{{classname}}{{nameInPascalCase}}{{/isCircularReference}}{{^isCircularReference}}{{>recordField}}{{/isCircularReference}} {{/vars}} }{{/lambda.indented}}{{#vars}}{{#isCircularReference}} -type {{classname}}{{nameInCamelCase}} = {{classname}}{{nameInCamelCase}} ({{>recordField}}) +type {{classname}}{{nameInPascalCase}} = {{classname}}{{nameInPascalCase}} ({{>recordField}}) -unwrap{{classname}}{{nameInCamelCase}} : {{classname}}{{nameInCamelCase}} -> {{>recordField}} -unwrap{{classname}}{{nameInCamelCase}} ({{classname}}{{nameInCamelCase}} {{name}}) = {{name}}{{/isCircularReference}}{{/vars}}{{#vars}}{{#isEnum}} +unwrap{{classname}}{{nameInPascalCase}} : {{classname}}{{nameInPascalCase}} -> {{>recordField}} +unwrap{{classname}}{{nameInPascalCase}} ({{classname}}{{nameInPascalCase}} {{name}}) = {{name}}{{/isCircularReference}}{{/vars}}{{#vars}}{{#isEnum}} {{>customType}}{{/isEnum}}{{/vars}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/elm/recordFieldDecoder.mustache b/modules/openapi-generator/src/main/resources/elm/recordFieldDecoder.mustache index 13760c0adff3..7ae2bbc777d6 100644 --- a/modules/openapi-generator/src/main/resources/elm/recordFieldDecoder.mustache +++ b/modules/openapi-generator/src/main/resources/elm/recordFieldDecoder.mustache @@ -1 +1 @@ -{{#required}}decode{{/required}}{{^required}}maybeDecode{{/required}}{{#isNullable}}Nullable{{/isNullable}}{{#isCircularReference}}Lazy {{classname}}{{nameInCamelCase}}{{/isCircularReference}} "{{baseName}}" {{>recordFieldValueDecoder}} {{^required}}{{#defaultValue}}(Just {{{.}}}){{/defaultValue}}{{^defaultValue}}Nothing{{/defaultValue}}{{/required}} \ No newline at end of file +{{#required}}decode{{/required}}{{^required}}maybeDecode{{/required}}{{#isNullable}}Nullable{{/isNullable}}{{#isCircularReference}}Lazy {{classname}}{{nameInPascalCase}}{{/isCircularReference}} "{{baseName}}" {{>recordFieldValueDecoder}} {{^required}}{{#defaultValue}}(Just {{{.}}}){{/defaultValue}}{{^defaultValue}}Nothing{{/defaultValue}}{{/required}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/elm/recordFieldEncoder.mustache b/modules/openapi-generator/src/main/resources/elm/recordFieldEncoder.mustache index 886da29f6996..2534a1b320a8 100644 --- a/modules/openapi-generator/src/main/resources/elm/recordFieldEncoder.mustache +++ b/modules/openapi-generator/src/main/resources/elm/recordFieldEncoder.mustache @@ -1 +1 @@ -{{#required}}encode{{/required}}{{^required}}maybeEncode{{/required}}{{#isNullable}}Nullable{{/isNullable}} "{{baseName}}" {{#isContainer}}({{/isContainer}}{{>recordFieldValueEncoder}}{{#isContainer}}){{/isContainer}} {{#isCircularReference}}<| unwrap{{classname}}{{nameInCamelCase}} {{/isCircularReference}}model.{{name}} \ No newline at end of file +{{#required}}encode{{/required}}{{^required}}maybeEncode{{/required}}{{#isNullable}}Nullable{{/isNullable}} "{{baseName}}" {{#isContainer}}({{/isContainer}}{{>recordFieldValueEncoder}}{{#isContainer}}){{/isContainer}} {{#isCircularReference}}<| unwrap{{classname}}{{nameInPascalCase}} {{/isCircularReference}}model.{{name}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/erlang-client/model.mustache b/modules/openapi-generator/src/main/resources/erlang-client/model.mustache index 5577a0706de0..6a19e3d9e5f0 100644 --- a/modules/openapi-generator/src/main/resources/erlang-client/model.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-client/model.mustache @@ -11,10 +11,10 @@ {{/-last}}{{/vars}} }. -encode(#{ {{#vars}}'{{name}}' := {{{nameInCamelCase}}}{{^-last}}, +encode(#{ {{#vars}}'{{name}}' := {{{nameInPascalCase}}}{{^-last}}, {{/-last}}{{/vars}} }) -> - #{ {{#vars}}'{{baseName}}' => {{{nameInCamelCase}}}{{^-last}}, + #{ {{#vars}}'{{baseName}}' => {{{nameInPascalCase}}}{{^-last}}, {{/-last}}{{/vars}} }. {{/model}} diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pojo.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pojo.mustache index ce9f0551c722..54c9827d1429 100644 --- a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/mp/pojo.mustache @@ -113,14 +113,14 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { this.{{name}}.add({{name}}Item); return this; } {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { this.{{name}}.put(key, {{name}}Item); return this; } diff --git a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pojo.mustache b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pojo.mustache index ce9f0551c722..54c9827d1429 100644 --- a/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/java-helidon/client/libraries/se/pojo.mustache @@ -113,14 +113,14 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { this.{{name}}.add({{name}}Item); return this; } {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { this.{{name}}.put(key, {{name}}Item); return this; } diff --git a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pojo.mustache b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pojo.mustache index 373e88642036..a3310a0f0245 100644 --- a/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/java-helidon/server/libraries/mp/pojo.mustache @@ -119,14 +119,14 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { this.{{name}}.add({{name}}Item); return this; } {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { this.{{name}}.put(key, {{name}}Item); return this; } diff --git a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache index 335a539963f2..f100a893156b 100644 --- a/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/java-micronaut/common/model/pojo.mustache @@ -120,7 +120,7 @@ Declare the class with extends and implements } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}); @@ -145,7 +145,7 @@ Declare the class with extends and implements {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); diff --git a/modules/openapi-generator/src/main/resources/java-msf4j-server/pojo.mustache b/modules/openapi-generator/src/main/resources/java-msf4j-server/pojo.mustache index a672b3a763ec..23e732d43d15 100644 --- a/modules/openapi-generator/src/main/resources/java-msf4j-server/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/java-msf4j-server/pojo.mustache @@ -37,7 +37,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{^required}} if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}; @@ -49,7 +49,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { {{^required}} if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}; diff --git a/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache b/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache index c5838cb45f9b..f9161d58c588 100644 --- a/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/java-pkmst/pojo.mustache @@ -43,7 +43,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{nameInPascalCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } @@ -53,7 +53,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens {{/isArray}} {{#isMap}} - public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} put{{nameInPascalCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}); } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache index c84e38b3f085..6135a50b0e02 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache @@ -106,7 +106,7 @@ import {{packageName}}.infrastructure.ITransformForStorage {{#multiplatform}} @Serializable {{/multiplatform}} - {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{{nameInCamelCase}}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) { + {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{{nameInPascalCase}}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) { {{#allowableValues}} {{#enumVars}} {{^multiplatform}} @@ -130,17 +130,17 @@ import {{packageName}}.infrastructure.ITransformForStorage {{/allowableValues}} }{{#kotlinx_serialization}}{{#enumUnknownDefaultCase}} - @Serializer(forClass = {{{nameInCamelCase}}}::class) - internal object {{nameInCamelCase}}Serializer : KSerializer<{{nameInCamelCase}}> { + @Serializer(forClass = {{{nameInPascalCase}}}::class) + internal object {{nameInPascalCase}}Serializer : KSerializer<{{nameInPascalCase}}> { override val descriptor = {{{dataType}}}.serializer().descriptor - override fun deserialize(decoder: Decoder): {{nameInCamelCase}} { + override fun deserialize(decoder: Decoder): {{nameInPascalCase}} { val value = decoder.decodeSerializableValue({{{dataType}}}.serializer()) - return {{nameInCamelCase}}.values().firstOrNull { it.value == value } - ?: {{nameInCamelCase}}.{{#allowableValues}}{{#enumVars}}{{#-last}}{{&name}}{{/-last}}{{/enumVars}}{{/allowableValues}} + return {{nameInPascalCase}}.values().firstOrNull { it.value == value } + ?: {{nameInPascalCase}}.{{#allowableValues}}{{#enumVars}}{{#-last}}{{&name}}{{/-last}}{{/enumVars}}{{/allowableValues}} } - override fun serialize(encoder: Encoder, value: {{nameInCamelCase}}) { + override fun serialize(encoder: Encoder, value: {{nameInPascalCase}}) { encoder.encodeSerializableValue({{{dataType}}}.serializer(), value.value) } }{{/enumUnknownDefaultCase}}{{/kotlinx_serialization}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache index f0198c9e6b1f..1b328da49ea0 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache @@ -18,4 +18,4 @@ {{#deprecated}} @Deprecated(message = "This property is deprecated.") {{/deprecated}} - {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}{{#uniqueItems}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}Set{{/uniqueItems}}{{^uniqueItems}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}List{{/uniqueItems}}{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{#kotlinx_serialization}}@Contextual {{/kotlinx_serialization}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{/isArray}}{{^isEnum}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}.{{{nameInCamelCase}}}{{/isArray}}{{/isEnum}}? = {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{^multiplatform}}{{{dataType}}}("{{{defaultValue}}}"){{/multiplatform}}{{#multiplatform}}({{{defaultValue}}}).toDouble(){{/multiplatform}}{{/isNumber}}{{/defaultValue}} \ No newline at end of file + {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}{{#uniqueItems}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}Set{{/uniqueItems}}{{^uniqueItems}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}List{{/uniqueItems}}{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{#kotlinx_serialization}}@Contextual {{/kotlinx_serialization}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInPascalCase}}}{{/items.isEnum}}>{{/isArray}}{{^isEnum}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}.{{{nameInPascalCase}}}{{/isArray}}{{/isEnum}}? = {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{^multiplatform}}{{{dataType}}}("{{{defaultValue}}}"){{/multiplatform}}{{#multiplatform}}({{{defaultValue}}}).toDouble(){{/multiplatform}}{{/isNumber}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache index 1bfbcc582b43..4a31e0d01edf 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache @@ -18,4 +18,4 @@ {{#deprecated}} @Deprecated(message = "This property is deprecated.") {{/deprecated}} - {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}{{#uniqueItems}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}Set{{/uniqueItems}}{{^uniqueItems}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}List{{/uniqueItems}}{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{#kotlinx_serialization}}@Contextual {{/kotlinx_serialization}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{/isArray}}{{^isEnum}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}.{{{nameInCamelCase}}}{{/isArray}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{^multiplatform}}{{{dataType}}}("{{{defaultValue}}}"){{/multiplatform}}{{#multiplatform}}({{{defaultValue}}}).toDouble(){{/multiplatform}}{{/isNumber}}{{/defaultValue}} \ No newline at end of file + {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}{{#uniqueItems}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}Set{{/uniqueItems}}{{^uniqueItems}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}List{{/uniqueItems}}{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{#kotlinx_serialization}}@Contextual {{/kotlinx_serialization}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInPascalCase}}}{{/items.isEnum}}>{{/isArray}}{{^isEnum}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}.{{{nameInPascalCase}}}{{/isArray}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{^multiplatform}}{{{dataType}}}("{{{defaultValue}}}"){{/multiplatform}}{{#multiplatform}}({{{defaultValue}}}).toDouble(){{/multiplatform}}{{/isNumber}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/interface_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/interface_opt_var.mustache index 344a6c251d8e..260be5c3caa8 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/interface_opt_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/interface_opt_var.mustache @@ -15,4 +15,4 @@ {{^isEnum}}{{^isArray}}{{^isPrimitiveType}}{{^isModel}}@Contextual {{/isModel}}{{/isPrimitiveType}}{{/isArray}}{{/isEnum}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/kotlinx_serialization}} {{/multiplatform}} - {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{#kotlinx_serialization}}@Contextual {{/kotlinx_serialization}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{/isArray}}{{^isEnum}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}.{{{nameInCamelCase}}}{{/isArray}}{{/isEnum}}? \ No newline at end of file + {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{#kotlinx_serialization}}@Contextual {{/kotlinx_serialization}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInPascalCase}}}{{/items.isEnum}}>{{/isArray}}{{^isEnum}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}.{{{nameInPascalCase}}}{{/isArray}}{{/isEnum}}? \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/interface_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/interface_req_var.mustache index 743069ff554d..6560b23d9626 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/interface_req_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/interface_req_var.mustache @@ -15,4 +15,4 @@ {{^isEnum}}{{^isArray}}{{^isPrimitiveType}}{{^isModel}}@Contextual {{/isModel}}{{/isPrimitiveType}}{{/isArray}}{{/isEnum}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/kotlinx_serialization}} {{/multiplatform}} - {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{#kotlinx_serialization}}@Contextual {{/kotlinx_serialization}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{/isArray}}{{^isEnum}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}.{{{nameInCamelCase}}}{{/isArray}}{{/isEnum}}{{#isNullable}}?{{/isNullable}} \ No newline at end of file + {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{#kotlinx_serialization}}@Contextual {{/kotlinx_serialization}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInPascalCase}}}{{/items.isEnum}}>{{/isArray}}{{^isEnum}}{{^isArray}}{{{dataType}}}{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{classname}}.{{{nameInPascalCase}}}{{/isArray}}{{/isEnum}}{{#isNullable}}?{{/isNullable}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/SerializerHelper.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/SerializerHelper.kt.mustache index fbf67a75dde9..27f4d1ee617c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/SerializerHelper.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/SerializerHelper.kt.mustache @@ -32,8 +32,8 @@ import com.squareup.moshi.adapters.EnumJsonAdapter {{#allowableValues}} {{#enumVars}} {{#-last}} - .add({{modelPackage}}.{{classname}}.{{{nameInCamelCase}}}::class.java, EnumJsonAdapter.create({{modelPackage}}.{{classname}}.{{{nameInCamelCase}}}::class.java) - .withUnknownFallback({{modelPackage}}.{{classname}}.{{{nameInCamelCase}}}.{{&name}})) + .add({{modelPackage}}.{{classname}}.{{{nameInPascalCase}}}::class.java, EnumJsonAdapter.create({{modelPackage}}.{{classname}}.{{{nameInPascalCase}}}::class.java) + .withUnknownFallback({{modelPackage}}.{{classname}}.{{{nameInPascalCase}}}.{{&name}})) {{/-last}} {{/enumVars}} {{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/model_room.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/model_room.mustache index bb43e6bf87ec..bc442d04ea6b 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/model_room.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/model_room.mustache @@ -18,15 +18,15 @@ import {{modelPackage}}.* */ data class {{classname}}RoomModel ( @PrimaryKey(autoGenerate = true) var roomTableId: Int, - {{#allVars}}{{#items.isPrimitiveType}}var {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{>model_room_init_var}}{{/isArray}}, + {{#allVars}}{{#items.isPrimitiveType}}var {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInPascalCase}}}{{/items.isEnum}}>{{>model_room_init_var}}{{/isArray}}, {{/items.isPrimitiveType}}{{/allVars}} {{#allVars}}{{^isEnum}}{{^isArray}}var {{{name}}}: {{{dataType}}}{{>model_room_init_var}}, {{/isArray}}{{/isEnum}}{{/allVars}} - {{#allVars}}{{#isEnum}}{{^isArray}}var {{{name}}}: {{classname}}.{{{nameInCamelCase}}}{{>model_room_init_var}}, + {{#allVars}}{{#isEnum}}{{^isArray}}var {{{name}}}: {{classname}}.{{{nameInPascalCase}}}{{>model_room_init_var}}, {{/isArray}}{{/isEnum}}{{/allVars}}) { {{#allVars}}{{#isArray}}{{#isList}}{{^items.isPrimitiveType}} @Ignore - {{^isNullable}}{{#required}}lateinit {{/required}}{{/isNullable}}var {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{>model_room_init_var}}{{/isArray}} + {{^isNullable}}{{#required}}lateinit {{/required}}{{/isNullable}}var {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInPascalCase}}}{{/items.isEnum}}>{{>model_room_init_var}}{{/isArray}} {{/items.isPrimitiveType}}{{/isList}}{{/isArray}}{{/allVars}} {{^discriminator}}companion object { } diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class.mustache index e22559b5cc98..a28418d221d1 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class.mustache @@ -37,7 +37,7 @@ data class {{classname}} ( * {{{description}}} * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} */ - enum class {{nameInCamelCase}}(val value: {{dataType}}){ + enum class {{nameInPascalCase}}(val value: {{dataType}}){ {{#allowableValues}} {{#enumVars}} {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class_opt_var.mustache index df50e9867aaa..4e001dec7b49 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class_opt_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class_opt_var.mustache @@ -1,4 +1,4 @@ {{#description}} /* {{{.}}} */ {{/description}} - {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file + {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class_req_var.mustache index 0da9cbfe3c85..d4b9439a92a4 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class_req_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server-deprecated/data_class_req_var.mustache @@ -1,4 +1,4 @@ {{#description}} /* {{{.}}} */ {{/description}} - {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} \ No newline at end of file + {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache index 84e4637d60e9..4cf9f37e8fdd 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache @@ -37,7 +37,7 @@ data class {{classname}}( * {{{description}}} * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} */ - enum class {{{nameInCamelCase}}}(val value: {{{dataType}}}){ + enum class {{{nameInPascalCase}}}(val value: {{{dataType}}}){ {{#allowableValues}} {{#enumVars}} {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/data_class_opt_var.mustache index b2e7cc3b409c..a5885bca9b72 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/data_class_opt_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/data_class_opt_var.mustache @@ -1,4 +1,4 @@ {{#description}} /* {{{.}}} */ {{/description}} - {{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInCamelCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file + {{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/data_class_req_var.mustache index d3732ebad050..b1c939b130b8 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/data_class_req_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/data_class_req_var.mustache @@ -1,4 +1,4 @@ {{#description}} /* {{{.}}} */ {{/description}} - {{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInCamelCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} \ No newline at end of file + {{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class.mustache index c0fdd457ba7b..5fd73b908e8c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class.mustache @@ -55,7 +55,7 @@ import java.io.Serializable {{#kotlinx_serialization}} {{#serializableModel}}@KSerializable{{/serializableModel}}{{^serializableModel}}@Serializable{{/serializableModel}} {{/kotlinx_serialization}} - {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{{nameInCamelCase}}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) { + {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{{nameInPascalCase}}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) { {{#allowableValues}} {{#enumVars}} @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class_opt_var.mustache index 8dd88b383c2a..2e11ba04481c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class_opt_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class_opt_var.mustache @@ -3,4 +3,4 @@ {{/description}} @JsonProperty("{{{baseName}}}") -{{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file +{{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class_req_var.mustache index 2996b649b98d..f5b0958424a8 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class_req_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/data_class_req_var.mustache @@ -3,4 +3,4 @@ {{/description}} @JsonProperty("{{{baseName}}}") -{{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} \ No newline at end of file +{{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache index e56f233800c0..20c6889710e2 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache @@ -25,7 +25,7 @@ * {{{description}}} * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} */ - enum class {{{nameInCamelCase}}}(val value: {{#isContainer}}{{#items}}{{{dataType}}}{{/items}}{{/isContainer}}{{^isContainer}}{{{dataType}}}{{/isContainer}}) { + enum class {{{nameInPascalCase}}}(val value: {{#isContainer}}{{#items}}{{{dataType}}}{{/items}}{{/isContainer}}{{^isContainer}}{{{dataType}}}{{/isContainer}}) { {{#allowableValues}}{{#enumVars}} @JsonProperty({{{value}}}) {{{name}}}({{{value}}}){{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} } diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache index 229e4b036a66..7232af07e291 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache @@ -2,4 +2,4 @@ @Schema({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} @ApiModelProperty({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}}{{#deprecated}} @Deprecated(message = ""){{/deprecated}} - @get:JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInCamelCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}} \ No newline at end of file + @get:JsonProperty("{{{baseName}}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInPascalCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache index 5e347b64617b..80b7ea4c7e18 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache @@ -1,4 +1,4 @@ {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}} @Schema({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} @ApiModelProperty({{#example}}example = "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{.}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}} - @get:JsonProperty("{{{baseName}}}", required = true){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInCamelCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}} \ No newline at end of file + @get:JsonProperty("{{{baseName}}}", required = true){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInPascalCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache index 00ee2b1b7a75..660726f0c518 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache @@ -1,4 +1,4 @@ {{#swagger2AnnotationLibrary}} @get:Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}requiredMode = Schema.RequiredMode.REQUIRED, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} @get:ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}} - {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? {{^discriminator}}= {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/discriminator}} + {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? {{^discriminator}}= {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/discriminator}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache index 53c3b9c421e4..0f46b49c2b60 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache @@ -1,4 +1,4 @@ {{#swagger2AnnotationLibrary}} @get:Schema({{#example}}example = "{{{.}}}", {{/example}}{{#required}}requiredMode = Schema.RequiredMode.REQUIRED, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{{description}}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} @get:ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}"){{/swagger1AnnotationLibrary}} - {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} + {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class.mustache index 67a6a37c7e03..338856586b27 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class.mustache @@ -29,7 +29,7 @@ data class {{classname}} ( * {{{description}}} * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} */ - enum class {{nameInCamelCase}}(val value: {{dataType}}){ + enum class {{nameInPascalCase}}(val value: {{dataType}}){ {{#allowableValues}}{{#enumVars}} {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/enumVars}}{{/allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class_opt_var.mustache index df50e9867aaa..4e001dec7b49 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class_opt_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class_opt_var.mustache @@ -1,4 +1,4 @@ {{#description}} /* {{{.}}} */ {{/description}} - {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file + {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class_req_var.mustache index 96fc123d9f1d..104dfb5db90b 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class_req_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/data_class_req_var.mustache @@ -1,4 +1,4 @@ {{#description}} /* {{{.}}} */ {{/description}} - @SerializedName("{{{name}}}") private {{>modelMutable}} _{{{name}}}: {{#isEnum}}{{classname}}.{{nameInCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? \ No newline at end of file + @SerializedName("{{{name}}}") private {{>modelMutable}} _{{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/ktorm-schema/data_class_bind_field_req.mustache b/modules/openapi-generator/src/main/resources/ktorm-schema/data_class_bind_field_req.mustache index 8179517f98e4..f4c4ef323537 100644 --- a/modules/openapi-generator/src/main/resources/ktorm-schema/data_class_bind_field_req.mustache +++ b/modules/openapi-generator/src/main/resources/ktorm-schema/data_class_bind_field_req.mustache @@ -1 +1 @@ -{{#vendorExtensions}}{{#x-ktorm-schema}}{{#columnDefinition}} {{{name}}} = row[{{{name}}}]{{#isEnum}} ?: {{{classname}}}.{{{nameInCamelCase}}}.valueOf({{#isString}}""{{/isString}}{{#isNumeric}}0{{/isNumeric}}){{/isEnum}}{{^isEnum}}{{#isString}} ?: ""{{/isString}}{{#isNumeric}} ?: 0{{/isNumeric}}{{#isBoolean}} ?: false{{/isBoolean}}{{/isEnum}} /* {{{colKotlinType}}} */{{/columnDefinition}}{{/x-ktorm-schema}}{{/vendorExtensions}}{{#description}} /* {{{.}}} */{{/description}} \ No newline at end of file +{{#vendorExtensions}}{{#x-ktorm-schema}}{{#columnDefinition}} {{{name}}} = row[{{{name}}}]{{#isEnum}} ?: {{{classname}}}.{{{nameInPascalCase}}}.valueOf({{#isString}}""{{/isString}}{{#isNumeric}}0{{/isNumeric}}){{/isEnum}}{{^isEnum}}{{#isString}} ?: ""{{/isString}}{{#isNumeric}} ?: 0{{/isNumeric}}{{#isBoolean}} ?: false{{/isBoolean}}{{/isEnum}} /* {{{colKotlinType}}} */{{/columnDefinition}}{{/x-ktorm-schema}}{{/vendorExtensions}}{{#description}} /* {{{.}}} */{{/description}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/ktorm-schema/data_class_enum_opt.mustache b/modules/openapi-generator/src/main/resources/ktorm-schema/data_class_enum_opt.mustache index dfef01c71bb2..4fdd21bf8725 100644 --- a/modules/openapi-generator/src/main/resources/ktorm-schema/data_class_enum_opt.mustache +++ b/modules/openapi-generator/src/main/resources/ktorm-schema/data_class_enum_opt.mustache @@ -1,2 +1,2 @@ {{#deprecated}} @Deprecated(message = "This property is deprecated.") -{{/deprecated}}{{#vendorExtensions}}{{#x-ktorm-schema}}{{#columnDefinition}} val {{{name}}} = {{{colType}}}("{{{colName}}}").transform({ {{{classname}}}.{{{nameInCamelCase}}}.valueOf(it ?: {{#allowableValues}}{{#enumVars}}{{#-first}}{{{value}}}{{/-first}}{{/enumVars}}{{/allowableValues}}) }, { it.value }) /* null */{{/columnDefinition}}{{/x-ktorm-schema}}{{/vendorExtensions}}{{#description}} /* {{{.}}} */{{/description}} +{{/deprecated}}{{#vendorExtensions}}{{#x-ktorm-schema}}{{#columnDefinition}} val {{{name}}} = {{{colType}}}("{{{colName}}}").transform({ {{{classname}}}.{{{nameInPascalCase}}}.valueOf(it ?: {{#allowableValues}}{{#enumVars}}{{#-first}}{{{value}}}{{/-first}}{{/enumVars}}{{/allowableValues}}) }, { it.value }) /* null */{{/columnDefinition}}{{/x-ktorm-schema}}{{/vendorExtensions}}{{#description}} /* {{{.}}} */{{/description}} diff --git a/modules/openapi-generator/src/main/resources/ktorm-schema/data_class_enum_req.mustache b/modules/openapi-generator/src/main/resources/ktorm-schema/data_class_enum_req.mustache index 0748525fa8ed..f993d41edc50 100644 --- a/modules/openapi-generator/src/main/resources/ktorm-schema/data_class_enum_req.mustache +++ b/modules/openapi-generator/src/main/resources/ktorm-schema/data_class_enum_req.mustache @@ -1,2 +1,2 @@ {{#deprecated}} @Deprecated(message = "This property is deprecated.") -{{/deprecated}}{{#vendorExtensions}}{{#x-ktorm-schema}}{{#columnDefinition}} val {{{name}}} = {{{colType}}}("{{{colName}}}").transform({ {{{classname}}}.{{{nameInCamelCase}}}.valueOf(it) }, { it.value }){{/columnDefinition}}{{/x-ktorm-schema}}{{/vendorExtensions}}{{#description}} /* {{{.}}} */{{/description}} \ No newline at end of file +{{/deprecated}}{{#vendorExtensions}}{{#x-ktorm-schema}}{{#columnDefinition}} val {{{name}}} = {{{colType}}}("{{{colName}}}").transform({ {{{classname}}}.{{{nameInPascalCase}}}.valueOf(it) }, { it.value }){{/columnDefinition}}{{/x-ktorm-schema}}{{/vendorExtensions}}{{#description}} /* {{{.}}} */{{/description}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/php-nextgen/model_test.mustache b/modules/openapi-generator/src/main/resources/php-nextgen/model_test.mustache index fa9d12564694..4e6d79002dce 100644 --- a/modules/openapi-generator/src/main/resources/php-nextgen/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/php-nextgen/model_test.mustache @@ -74,7 +74,7 @@ class {{classname}}Test extends TestCase /** * Test attribute "{{name}}" */ - public function testProperty{{nameInCamelCase}}() + public function testProperty{{nameInPascalCase}}() { // TODO: implement self::markTestIncomplete('Not implemented'); diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/model_test.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/model_test.mustache index c45cba105a72..2f01951a1300 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/model_test.mustache @@ -74,7 +74,7 @@ class {{classname}}Test extends TestCase /** * Test attribute "{{name}}" */ - public function testProperty{{nameInCamelCase}}() + public function testProperty{{nameInPascalCase}}() { self::markTestIncomplete( 'Test of "{{name}}" property in "{{classname}}" model has not been implemented yet.' diff --git a/modules/openapi-generator/src/main/resources/php-symfony/model_generic.mustache b/modules/openapi-generator/src/main/resources/php-symfony/model_generic.mustache index 2bb14a388b0b..620051725deb 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/model_generic.mustache @@ -36,7 +36,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}} * * @return string|null */ - public function getSerialized{{nameInCamelCase}}(): string|null + public function getSerialized{{nameInPascalCase}}(): string|null { return $this->{{name}}?->value ? (string) $this->{{name}}->value : null; } @@ -50,7 +50,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}} * * @return array */ - public function getSerialized{{nameInCamelCase}}(): array + public function getSerialized{{nameInPascalCase}}(): array { return array_map( static fn ($value) => (string) $value->value, diff --git a/modules/openapi-generator/src/main/resources/php-symfony/model_variables.mustache b/modules/openapi-generator/src/main/resources/php-symfony/model_variables.mustache index aae9e405aa40..8e403f458914 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/model_variables.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/model_variables.mustache @@ -37,7 +37,7 @@ {{^isMap}} {{#items}} {{#isEnumRef}} - * @Accessor(getter="getSerialized{{nameInCamelCase}}") + * @Accessor(getter="getSerialized{{nameInPascalCase}}") * @Type("array") {{/isEnumRef}} {{^isEnumRef}} @@ -56,7 +56,7 @@ * @Type("DateTime") {{/isDateTime}} {{#isEnumRef}} - * @Accessor(getter="getSerialized{{nameInCamelCase}}") + * @Accessor(getter="getSerialized{{nameInPascalCase}}") * @Type("string") {{/isEnumRef}} {{^isDate}} diff --git a/modules/openapi-generator/src/main/resources/php-symfony/testing/model_test.mustache b/modules/openapi-generator/src/main/resources/php-symfony/testing/model_test.mustache index 86480fbc8284..8dda6a8a60de 100644 --- a/modules/openapi-generator/src/main/resources/php-symfony/testing/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/php-symfony/testing/model_test.mustache @@ -92,7 +92,7 @@ class {{classname}}Test extends TestCase * @group unit * @small */ - public function testProperty{{nameInCamelCase}}(): void + public function testProperty{{nameInPascalCase}}(): void { $this->markTestSkipped('Test for property {{name}} not implemented'); } diff --git a/modules/openapi-generator/src/main/resources/php/model_test.mustache b/modules/openapi-generator/src/main/resources/php/model_test.mustache index f515ce28899e..f1c46499bc09 100644 --- a/modules/openapi-generator/src/main/resources/php/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/php/model_test.mustache @@ -76,7 +76,7 @@ class {{classname}}Test extends TestCase /** * Test attribute "{{name}}" */ - public function testProperty{{nameInCamelCase}}() + public function testProperty{{nameInPascalCase}}() { // TODO: implement self::markTestIncomplete('Not implemented'); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index a5df77b6074c..0b1f9f17d4ad 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -4191,34 +4191,58 @@ public void testRequestBodyContent() { List formParams = co.formParams; assertEquals(formParams.get(0).paramName, "intParam"); + assertEquals(formParams.get(0).nameInCamelCase, "intParam"); + assertEquals(formParams.get(0).nameInPascalCase, "IntParam"); + assertEquals(formParams.get(0).nameInSnakeCase, "INT_PARAM"); + assertFalse(formParams.get(0).isContainer); assertFalse(formParams.get(0).isExplode); // Should not be true for non-container assertEquals(formParams.get(1).paramName, "explodeTrue"); + assertEquals(formParams.get(1).nameInCamelCase, "explodeTrue"); + assertEquals(formParams.get(1).nameInPascalCase, "ExplodeTrue"); + assertEquals(formParams.get(1).nameInSnakeCase, "EXPLODE_TRUE"); + assertEquals(formParams.get(1).nameInLowerCase, "explodetrue"); assertTrue(formParams.get(1).isContainer); assertEquals(formParams.get(1).style, Encoding.StyleEnum.FORM.toString()); assertTrue(formParams.get(1).isExplode); assertNull(formParams.get(1).contentType); assertEquals(formParams.get(2).paramName, "explodeFalse"); + assertEquals(formParams.get(2).nameInCamelCase, "explodeFalse"); + assertEquals(formParams.get(2).nameInPascalCase, "ExplodeFalse"); + assertEquals(formParams.get(2).nameInSnakeCase, "EXPLODE_FALSE"); + assertEquals(formParams.get(2).nameInLowerCase, "explodefalse"); assertTrue(formParams.get(2).isContainer); assertEquals(formParams.get(2).style, Encoding.StyleEnum.FORM.toString()); assertFalse(formParams.get(2).isExplode); assertNull(formParams.get(2).contentType); assertEquals(formParams.get(3).paramName, "noStyleNoExplode"); + assertEquals(formParams.get(3).nameInCamelCase, "noStyleNoExplode"); + assertEquals(formParams.get(3).nameInPascalCase, "NoStyleNoExplode"); + assertEquals(formParams.get(3).nameInSnakeCase, "NO_STYLE_NO_EXPLODE"); + assertEquals(formParams.get(3).nameInLowerCase, "nostylenoexplode"); assertTrue(formParams.get(3).isContainer); assertEquals(formParams.get(3).style, Encoding.StyleEnum.FORM.toString()); assertTrue(formParams.get(3).isExplode); // Defaults to true for style == FORM assertEquals(formParams.get(3).contentType, "text/plain"); assertEquals(formParams.get(4).paramName, "styleSpecified"); + assertEquals(formParams.get(4).nameInCamelCase, "styleSpecified"); + assertEquals(formParams.get(4).nameInPascalCase, "StyleSpecified"); + assertEquals(formParams.get(4).nameInSnakeCase, "STYLE_SPECIFIED"); + assertEquals(formParams.get(4).nameInLowerCase, "stylespecified"); assertTrue(formParams.get(4).isContainer); assertEquals(formParams.get(4).style, Encoding.StyleEnum.SPACE_DELIMITED.toString()); assertFalse(formParams.get(4).isExplode); assertNull(formParams.get(4).contentType); assertEquals(formParams.get(5).paramName, "styleSpecifiedNoExplode"); + assertEquals(formParams.get(5).nameInCamelCase, "styleSpecifiedNoExplode"); + assertEquals(formParams.get(5).nameInPascalCase, "StyleSpecifiedNoExplode"); + assertEquals(formParams.get(5).nameInSnakeCase, "STYLE_SPECIFIED_NO_EXPLODE"); + assertEquals(formParams.get(5).nameInLowerCase, "stylespecifiednoexplode"); assertTrue(formParams.get(5).isContainer); assertEquals(formParams.get(5).style, Encoding.StyleEnum.SPACE_DELIMITED.toString()); assertFalse(formParams.get(5).isExplode); // Defaults to false for style other than FORM diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java index e0b97f867df8..848d5d7edf0b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaModelTest.java @@ -67,7 +67,8 @@ public void simpleModelTest() { final CodegenProperty property1 = vars.get(0); Assert.assertEquals(property1.baseName, "id"); - Assert.assertEquals(property1.nameInCamelCase, "Id"); + Assert.assertEquals(property1.nameInPascalCase, "Id"); + Assert.assertEquals(property1.nameInCamelCase, "id"); Assert.assertEquals(property1.nameInSnakeCase, "ID"); Assert.assertEquals(property1.getter, "getId"); Assert.assertEquals(property1.setter, "setId"); @@ -80,7 +81,8 @@ public void simpleModelTest() { final CodegenProperty property2 = vars.get(1); Assert.assertEquals(property2.baseName, "name"); - Assert.assertEquals(property2.nameInCamelCase, "Name"); + Assert.assertEquals(property2.nameInPascalCase, "Name"); + Assert.assertEquals(property2.nameInCamelCase, "name"); Assert.assertEquals(property2.nameInSnakeCase, "NAME"); Assert.assertEquals(property2.getter, "getName"); Assert.assertEquals(property2.setter, "setName"); @@ -94,7 +96,8 @@ public void simpleModelTest() { final CodegenProperty property3 = vars.get(2); Assert.assertEquals(property3.baseName, "createdAt"); - Assert.assertEquals(property3.nameInCamelCase, "CreatedAt"); + Assert.assertEquals(property3.nameInPascalCase, "CreatedAt"); + Assert.assertEquals(property3.nameInCamelCase, "createdAt"); Assert.assertEquals(property3.nameInSnakeCase, "CREATED_AT"); Assert.assertEquals(property3.getter, "getCreatedAt"); Assert.assertEquals(property3.setter, "setCreatedAt"); @@ -1031,7 +1034,8 @@ public void longPropertyTest() { final CodegenProperty cp = codegen.fromProperty("property", property); Assert.assertEquals(cp.baseName, "property"); - Assert.assertEquals(cp.nameInCamelCase, "Property"); + Assert.assertEquals(cp.nameInPascalCase, "Property"); + Assert.assertEquals(cp.nameInCamelCase, "property"); Assert.assertEquals(cp.nameInSnakeCase, "PROPERTY"); Assert.assertEquals(cp.dataType, "Long"); Assert.assertEquals(cp.name, "property"); @@ -1057,7 +1061,8 @@ public void integerPropertyInReferencedSchemaTest() { CodegenProperty cp1 = cm.vars.get(0); Assert.assertEquals(cp1.baseName, "Integer1"); - Assert.assertEquals(cp1.nameInCamelCase, "Integer1"); + Assert.assertEquals(cp1.nameInPascalCase, "Integer1"); + Assert.assertEquals(cp1.nameInCamelCase, "integer1"); Assert.assertEquals(cp1.nameInSnakeCase, "INTEGER1"); Assert.assertEquals(cp1.dataType, "Integer"); Assert.assertEquals(cp1.name, "integer1"); @@ -1066,7 +1071,8 @@ public void integerPropertyInReferencedSchemaTest() { CodegenProperty cp2 = cm.vars.get(1); Assert.assertEquals(cp2.baseName, "Integer2"); - Assert.assertEquals(cp2.nameInCamelCase, "Integer2"); + Assert.assertEquals(cp2.nameInPascalCase, "Integer2"); + Assert.assertEquals(cp2.nameInCamelCase, "integer2"); Assert.assertEquals(cp2.nameInSnakeCase, "INTEGER2"); Assert.assertEquals(cp2.dataType, "Integer"); Assert.assertEquals(cp2.name, "integer2"); @@ -1111,7 +1117,8 @@ public void stringPropertyTest() { final CodegenProperty cp = codegen.fromProperty("somePropertyWithMinMaxAndPattern", property); Assert.assertEquals(cp.baseName, "somePropertyWithMinMaxAndPattern"); - Assert.assertEquals(cp.nameInCamelCase, "SomePropertyWithMinMaxAndPattern"); + Assert.assertEquals(cp.nameInPascalCase, "SomePropertyWithMinMaxAndPattern"); + Assert.assertEquals(cp.nameInCamelCase, "somePropertyWithMinMaxAndPattern"); Assert.assertEquals(cp.nameInSnakeCase, "SOME_PROPERTY_WITH_MIN_MAX_AND_PATTERN"); Assert.assertEquals(cp.dataType, "String"); Assert.assertEquals(cp.name, "somePropertyWithMinMaxAndPattern"); @@ -1150,7 +1157,8 @@ public void stringPropertyInObjectTest() { Assert.assertEquals(cm.getVars().size(), 1); CodegenProperty cp = cm.getVars().get(0); Assert.assertEquals(cp.baseName, "somePropertyWithMinMaxAndPattern"); - Assert.assertEquals(cp.nameInCamelCase, "SomePropertyWithMinMaxAndPattern"); + Assert.assertEquals(cp.nameInPascalCase, "SomePropertyWithMinMaxAndPattern"); + Assert.assertEquals(cp.nameInCamelCase, "somePropertyWithMinMaxAndPattern"); Assert.assertEquals(cp.nameInSnakeCase, "SOME_PROPERTY_WITH_MIN_MAX_AND_PATTERN"); Assert.assertEquals(cp.dataType, "String"); Assert.assertEquals(cp.name, "somePropertyWithMinMaxAndPattern"); @@ -1182,7 +1190,8 @@ public void stringPropertyReferencedInObjectTest() { Assert.assertEquals(cm.getVars().size(), 1); CodegenProperty cp = cm.getVars().get(0); Assert.assertEquals(cp.baseName, "somePropertyWithMinMaxAndPattern"); - Assert.assertEquals(cp.nameInCamelCase, "SomePropertyWithMinMaxAndPattern"); + Assert.assertEquals(cp.nameInPascalCase, "SomePropertyWithMinMaxAndPattern"); + Assert.assertEquals(cp.nameInCamelCase, "somePropertyWithMinMaxAndPattern"); Assert.assertEquals(cp.nameInSnakeCase, "SOME_PROPERTY_WITH_MIN_MAX_AND_PATTERN"); Assert.assertEquals(cp.dataType, "String"); Assert.assertEquals(cp.name, "somePropertyWithMinMaxAndPattern"); diff --git a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java index cc0e1f14e727..b56d87357281 100644 --- a/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java +++ b/samples/server/petstore/java-undertow/src/main/java/org/openapitools/handler/PathHandlerInterface.java @@ -577,13 +577,13 @@ public interface PathHandlerInterface { *

Response headers: [CodegenProperty{openApiType='string', baseName='Set-Cookie', complexType='null', getter='getSetCookie', setter='setSetCookie', description='Cookie authentication key for use with the `api_key` apiKey authentication.', dataType='String', datatypeWithEnum='String', dataFormat='null', name='setCookie', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.Set-Cookie;', baseType='String', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='Cookie authentication key for use with the `api_key` apiKey authentication.', maxLength=null, minLength=null, pattern='null', example='AUTH_KEY=abcde12345; Path=/; HttpOnly', jsonSchema='{ "example" : "AUTH_KEY=abcde12345; Path=/; HttpOnly", "type" : "string" -}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=true, isNumeric=false, isInteger=false, isShort=false, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='SetCookie', nameInSnakeCase='SET_COOKIE', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null}, CodegenProperty{openApiType='integer', baseName='X-Rate-Limit', complexType='null', getter='getxRateLimit', setter='setxRateLimit', description='calls per hour allowed by the user', dataType='Integer', datatypeWithEnum='Integer', dataFormat='int32', name='xRateLimit', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Rate-Limit;', baseType='Integer', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='calls per hour allowed by the user', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{ +}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=true, isNumeric=false, isInteger=false, isShort=false, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='setCookie', nameInPascalCase='SetCookie', nameInSnakeCase='SET_COOKIE', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=null, dependentRequired=null, contains=null}, CodegenProperty{openApiType='integer', baseName='X-Rate-Limit', complexType='null', getter='getxRateLimit', setter='setxRateLimit', description='calls per hour allowed by the user', dataType='Integer', datatypeWithEnum='Integer', dataFormat='int32', name='xRateLimit', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Rate-Limit;', baseType='Integer', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='calls per hour allowed by the user', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{ "format" : "int32", "type" : "integer" -}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=false, isNumeric=true, isInteger=true, isShort=true, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='XRateLimit', nameInSnakeCase='X_RATE_LIMIT', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=int32, dependentRequired=null, contains=null}, CodegenProperty{openApiType='string', baseName='X-Expires-After', complexType='Date', getter='getxExpiresAfter', setter='setxExpiresAfter', description='date in UTC when token expires', dataType='Date', datatypeWithEnum='Date', dataFormat='date-time', name='xExpiresAfter', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Expires-After;', baseType='Date', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='date in UTC when token expires', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{ +}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=true, isModel=false, isContainer=false, isString=false, isNumeric=true, isInteger=true, isShort=true, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=false, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='xRateLimit', nameInPascalCase='XRateLimit', nameInSnakeCase='X_RATE_LIMIT', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=int32, dependentRequired=null, contains=null}, CodegenProperty{openApiType='string', baseName='X-Expires-After', complexType='Date', getter='getxExpiresAfter', setter='setxExpiresAfter', description='date in UTC when token expires', dataType='Date', datatypeWithEnum='Date', dataFormat='date-time', name='xExpiresAfter', min='null', max='null', defaultValue='null', defaultValueWithParam=' = data.X-Expires-After;', baseType='Date', containerType='null', containerTypeMapped='null', title='null', unescapedDescription='date in UTC when token expires', maxLength=null, minLength=null, pattern='null', example='null', jsonSchema='{ "format" : "date-time", "type" : "string" -}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=false, isModel=false, isContainer=false, isString=false, isNumeric=false, isInteger=false, isShort=false, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=true, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='XExpiresAfter', nameInSnakeCase='X_EXPIRES_AFTER', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=date-time, dependentRequired=null, contains=null}]

+}', minimum='null', maximum='null', exclusiveMinimum=false, exclusiveMaximum=false, required=false, deprecated=false, hasMoreNonReadOnly=false, isPrimitiveType=false, isModel=false, isContainer=false, isString=false, isNumeric=false, isInteger=false, isShort=false, isLong=false, isUnboundedInteger=false, isNumber=false, isFloat=false, isDouble=false, isDecimal=false, isByteArray=false, isBinary=false, isFile=false, isBoolean=false, isDate=false, isDateTime=true, isUuid=false, isUri=false, isEmail=false, isPassword=false, isFreeFormObject=false, isArray=false, isMap=false, isEnum=false, isInnerEnum=false, isEnumRef=false, isAnyType=false, isReadOnly=false, isWriteOnly=false, isNullable=false, isSelfReference=false, isCircularReference=false, isDiscriminator=false, isNew=false, isOverridden=null, _enum=null, allowableValues=null, items=null, additionalProperties=null, vars=[], requiredVars=[], mostInnerItems=null, vendorExtensions={}, hasValidation=false, isInherited=false, discriminatorValue='null', nameInCamelCase='xExpiresAfter', nameInPascalCase='XExpiresAfter', nameInSnakeCase='X_EXPIRES_AFTER', enumName='null', maxItems=null, minItems=null, maxProperties=null, minProperties=null, uniqueItems=false, uniqueItemsBoolean=null, multipleOf=null, isXmlAttribute=false, xmlPrefix='null', xmlName='null', xmlNamespace='null', isXmlWrapped=false, isNull=false, isVoid=false, getAdditionalPropertiesIsAnyType=false, getHasVars=false, getHasRequired=false, getHasDiscriminatorWithNonEmptyMapping=false, composedSchemas=null, hasMultipleTypes=false, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=date-time, dependentRequired=null, contains=null}]

* *

Produces: [{isXml=true, mediaType=application/xml}, {isJson=true, mediaType=application/json}]

*

Returns: {@link String}