diff --git a/bin/configs/kotlin-misk-config.yaml b/bin/configs/kotlin-misk-config.yaml index 70ecde187aa4..6c9442faf960 100644 --- a/bin/configs/kotlin-misk-config.yaml +++ b/bin/configs/kotlin-misk-config.yaml @@ -1,6 +1,6 @@ generatorName: kotlin-misk outputDir: samples/server/petstore/kotlin-misk-config -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-kotlin-misk.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-misk validateSpec: false useBeanValidation: true diff --git a/bin/configs/kotlin-misk.yaml b/bin/configs/kotlin-misk.yaml index 5593aad0b7a7..684448fae443 100644 --- a/bin/configs/kotlin-misk.yaml +++ b/bin/configs/kotlin-misk.yaml @@ -1,6 +1,6 @@ generatorName: kotlin-misk outputDir: samples/server/petstore/kotlin-misk -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-kotlin-misk.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-misk additionalProperties: hideGenerationTimestamp: "true" diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java index 47e09ea292d4..e8c89ac9b6fa 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java @@ -33,7 +33,7 @@ public class CodegenOperation { hasErrorResponseObject; // if 4xx, 5xx responses have at least one error object defined public CodegenProperty returnProperty; public String path, operationId, returnType, returnFormat, httpMethod, returnBaseType, - returnContainer, summary, unescapedNotes, notes, baseName, defaultResponse; + returnContainer, summary, unescapedSummary, unescapedNotes, notes, baseName, defaultResponse; public CodegenDiscriminator discriminator; public List> consumes, produces, prioritizedContentTypes; public List servers = new ArrayList(); @@ -429,6 +429,7 @@ public String toString() { sb.append(", returnBaseType='").append(returnBaseType).append('\''); sb.append(", returnContainer='").append(returnContainer).append('\''); sb.append(", summary='").append(summary).append('\''); + sb.append(", unescapedSummary='").append(unescapedSummary).append('\''); sb.append(", unescapedNotes='").append(unescapedNotes).append('\''); sb.append(", notes='").append(notes).append('\''); sb.append(", baseName='").append(baseName).append('\''); @@ -502,6 +503,7 @@ public boolean equals(Object o) { Objects.equals(returnBaseType, that.returnBaseType) && Objects.equals(returnContainer, that.returnContainer) && Objects.equals(summary, that.summary) && + Objects.equals(unescapedSummary, that.unescapedSummary) && Objects.equals(unescapedNotes, that.unescapedNotes) && Objects.equals(notes, that.notes) && Objects.equals(baseName, that.baseName) && @@ -547,7 +549,7 @@ public int hashCode() { returnTypeIsPrimitive, returnSimpleType, subresourceOperation, isMap, isArray, isMultipart, isVoid, isResponseBinary, isResponseFile, isResponseOptional, hasReference, isDeprecated, isCallbackRequest, uniqueItems, path, operationId, returnType, httpMethod, - returnBaseType, returnContainer, summary, unescapedNotes, notes, baseName, defaultResponse, + returnBaseType, returnContainer, summary, unescapedSummary, unescapedNotes, notes, baseName, defaultResponse, discriminator, consumes, produces, prioritizedContentTypes, servers, bodyParam, allParams, bodyParams, pathParams, queryParams, headerParams, formParams, cookieParams, requiredParams, returnProperty, optionalParams, authMethods, tags, responses, callbacks, imports, examples, requestBodyExamples, externalDocs, 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 90c4c66558c0..35933108c49a 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 @@ -34,7 +34,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties { isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, isDeepObject, isMatrix, isAllowEmptyValue, isFormStyle, isSpaceDelimited, isPipeDelimited; public String baseName, paramName, dataType, datatypeWithEnum, dataFormat, contentType, - collectionFormat, description, unescapedDescription, baseType, defaultValue, enumDefaultValue, enumName, style; + collectionFormat, description, unescapedDescription, baseType, defaultValue, unescapedDefaultValue, enumDefaultValue, enumName, style; public String nameInLowerCase; // property name in lower case public String nameInCamelCase; // property name in camel case (e.g. modifiedDate) @@ -182,6 +182,7 @@ public CodegenParameter copy() { output.multipleOf = this.multipleOf; output.jsonSchema = this.jsonSchema; output.defaultValue = this.defaultValue; + output.unescapedDefaultValue = this.unescapedDefaultValue; output.enumDefaultValue = this.enumDefaultValue; output.example = this.example; output.examples = this.examples; @@ -289,7 +290,7 @@ 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, + unescapedDescription, baseType, containerType, containerTypeMapped, defaultValue, unescapedDefaultValue, enumDefaultValue, enumName, style, isDeepObject, isMatrix, isAllowEmptyValue, example, examples, isFormStyle, isSpaceDelimited, isPipeDelimited, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, @@ -382,6 +383,7 @@ public boolean equals(Object o) { Objects.equals(containerType, that.containerType) && Objects.equals(containerTypeMapped, that.containerTypeMapped) && Objects.equals(defaultValue, that.defaultValue) && + Objects.equals(unescapedDefaultValue, that.unescapedDefaultValue) && Objects.equals(enumDefaultValue, that.enumDefaultValue) && Objects.equals(enumName, that.enumName) && Objects.equals(style, that.style) && @@ -450,6 +452,7 @@ public String toString() { sb.append(", containerType='").append(containerType).append('\''); sb.append(", containerTypeMapped='").append(containerTypeMapped).append('\''); sb.append(", defaultValue='").append(defaultValue).append('\''); + sb.append(", unescapedDefaultValue='").append(unescapedDefaultValue).append('\''); sb.append(", enumDefaultValue='").append(enumDefaultValue).append('\''); sb.append(", enumName='").append(enumName).append('\''); sb.append(", style='").append(style).append('\''); 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 c854389be7b2..a45c180869bf 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 @@ -81,6 +81,14 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti @Getter @Setter public String unescapedDescription; + /** + * The default value string without escape characters; use this in string literal contexts + * (e.g. inside "..." or """...""") together with an appropriate escaping lambda. + * Unlike {@code defaultValue}, this is never passed through escapeText() or escapeUnsafeCharacters(). + */ + @Getter @Setter + public String unescapedDefaultValue; + /** * maxLength validation for strings, see http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.2.1 */ @@ -992,6 +1000,7 @@ public String toString() { sb.append(", containerTypeMapped='").append(containerTypeMapped).append('\''); sb.append(", title='").append(title).append('\''); sb.append(", unescapedDescription='").append(unescapedDescription).append('\''); + sb.append(", unescapedDefaultValue='").append(unescapedDefaultValue).append('\''); sb.append(", maxLength=").append(maxLength); sb.append(", minLength=").append(minLength); sb.append(", pattern='").append(pattern).append('\''); @@ -1179,6 +1188,7 @@ public boolean equals(Object o) { Objects.equals(containerTypeMapped, that.containerTypeMapped) && Objects.equals(title, that.title) && Objects.equals(unescapedDescription, that.unescapedDescription) && + Objects.equals(unescapedDefaultValue, that.unescapedDefaultValue) && Objects.equals(maxLength, that.maxLength) && Objects.equals(minLength, that.minLength) && Objects.equals(pattern, that.pattern) && @@ -1212,7 +1222,7 @@ public int hashCode() { return Objects.hash(openApiType, baseName, complexType, getter, setter, description, dataType, datatypeWithEnum, dataFormat, name, min, max, defaultValue, - defaultValueWithParam, baseType, containerType, containerTypeMapped, title, unescapedDescription, + defaultValueWithParam, baseType, containerType, containerTypeMapped, title, unescapedDescription, unescapedDefaultValue, maxLength, minLength, pattern, example, jsonSchema, minimum, maximum, exclusiveMinimum, exclusiveMaximum, required, deprecated, isPrimitiveType, isModel, isContainer, isString, isNumeric, diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java index 3298d80868f2..c9a426d7b9a1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java @@ -33,6 +33,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { public boolean is4xx; public boolean is5xx; public String message; + public String unescapedMessage; public List> examples; public String dataType; public String baseType; @@ -109,7 +110,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { @Override public int hashCode() { - return Objects.hash(headers, code, message, examples, dataType, baseType, containerType, containerTypeMapped, hasHeaders, + return Objects.hash(headers, code, message, unescapedMessage, examples, dataType, baseType, containerType, containerTypeMapped, hasHeaders, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBoolean, isDate, isDateTime, isUuid, isEmail, isPassword, isModel, isFreeFormObject, isAnyType, isDefault, simpleType, primitiveType, isMap, isOptional, isArray, isBinary, isFile, schema, jsonSchema, vendorExtensions, items, additionalProperties, @@ -182,6 +183,7 @@ public boolean equals(Object o) { Objects.equals(headers, that.headers) && Objects.equals(code, that.code) && Objects.equals(message, that.message) && + Objects.equals(unescapedMessage, that.unescapedMessage) && Objects.equals(examples, that.examples) && Objects.equals(dataType, that.dataType) && Objects.equals(baseType, that.baseType) && @@ -582,6 +584,7 @@ public String toString() { sb.append(", is4xx='").append(is4xx).append('\''); sb.append(", is5xx='").append(is5xx).append('\''); sb.append(", message='").append(message).append('\''); + sb.append(", unescapedMessage='").append(unescapedMessage).append('\''); sb.append(", examples=").append(examples); sb.append(", dataType='").append(dataType).append('\''); sb.append(", baseType='").append(baseType).append('\''); 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 710f7838d72f..0429fc31e5d1 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 @@ -476,7 +476,24 @@ protected ImmutableMap.Builder addMustacheLambdas() { .put("trimLineBreaks", new TrimLineBreaksLambda()) .put("trimWhitespace", new TrimWhitespaceLambda()) .put("trimTrailingWithNewLine", new TrimTrailingWhiteSpaceLambda(true)) - .put("trimTrailing", new TrimTrailingWhiteSpaceLambda(false)); + .put("trimTrailing", new TrimTrailingWhiteSpaceLambda(false)) + // Escapes text for use inside a Markdown table cell or inline text. + // Order matters: \\ and & must be first to avoid double-escaping. + // $ is escaped to prevent LaTeX math mode ($...$) in renderers that support it. + .put("escapeMarkdown", (fragment, writer) -> writer.write(fragment.execute() + .replace("\\", "\\\\") + .replace("&", "&") + .replace("<", "<") + .replace(">", ">") + .replace("$", "\\$") + .replace("|", "\\|") + .replace("\r\n", " ") + .replace("\n", " ") + .replace("\r", " "))) + .put("collapseNewlines", (fragment, writer) -> writer.write(fragment.execute() + .replace("\r\n", " ") + .replace("\n", " ") + .replace("\r", " "))); } private void registerMustacheLambdas() { @@ -4315,6 +4332,7 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required, boo // set the default value property.defaultValue = toDefaultValue(property, p); + property.unescapedDefaultValue = p.getDefault() != null ? String.valueOf(p.getDefault()) : null; property.defaultValueWithParam = toDefaultValueWithParam(name, p); LOGGER.debug("debugging from property return: {}", property); @@ -4738,6 +4756,7 @@ public CodegenOperation fromOperation(String path, } op.summary = escapeText(operation.getSummary()); + op.unescapedSummary = operation.getSummary(); op.unescapedNotes = operation.getDescription(); op.notes = escapeText(operation.getDescription()); op.hasConsumes = false; @@ -5092,6 +5111,7 @@ public CodegenResponse fromResponse(String responseCode, ApiResponse response) { } r.schema = responseSchema; r.message = escapeText(response.getDescription()); + r.unescapedMessage = response.getDescription(); // adding examples to API responses Map examples = ExamplesUtils.getExamplesFromResponse(openAPI, response); @@ -5641,6 +5661,7 @@ public CodegenParameter fromParameter(Parameter parameter, Set imports) // set default value codegenParameter.defaultValue = toDefaultParameterValue(codegenProperty, parameterSchema); + codegenParameter.unescapedDefaultValue = parameterSchema.getDefault() != null ? String.valueOf(parameterSchema.getDefault()) : null; finishUpdatingParameter(codegenParameter, parameter); return codegenParameter; @@ -7543,6 +7564,7 @@ public CodegenParameter fromFormProperty(String name, Schema propertySchema, Set // set default value codegenParameter.defaultValue = toDefaultParameterValue(codegenProperty, propertySchema); + codegenParameter.unescapedDefaultValue = propertySchema.getDefault() != null ? String.valueOf(propertySchema.getDefault()) : null; if (ModelUtils.isFileSchema(ps) && !ModelUtils.isStringSchema(ps)) { // swagger v2 only, type file @@ -8089,6 +8111,7 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S codegenParameter.baseName = "UNKNOWN_BASE_NAME"; codegenParameter.paramName = "UNKNOWN_PARAM_NAME"; codegenParameter.description = escapeText(body.getDescription()); + codegenParameter.unescapedDescription = body.getDescription(); codegenParameter.required = body.getRequired() != null ? body.getRequired() : Boolean.FALSE; codegenParameter.isBodyParam = Boolean.TRUE; if (body.getExtensions() != null) { 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 4d9b8217d763..8aea9042b0e6 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 @@ -1274,7 +1274,20 @@ protected void updateModelForObject(CodegenModel m, Schema schema) { @Override protected ImmutableMap.Builder addMustacheLambdas() { return super.addMustacheLambdas() - .put("escapeDollar", new EscapeChar("(? writer.write(fragment.execute() + .replace("\\", "\\\\") + .replace("$", "\\$") + .replace("\"", "\\\"") + .replace("\n", "\\n") + .replace("\r", "\\r") + .replace("\t", "\\t"))); } protected interface DataTypeAssigner { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index fe2407cd128c..4c3290408540 100755 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -1062,6 +1062,26 @@ public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List writer.write(fragment.execute().replaceAll("([$\"\\\\])", "\\\\$1"))); - additionalProperties.put("lambdaRemoveLineBreak", - (Mustache.Lambda) (fragment, writer) -> writer.write(fragment.execute().replaceAll("[\\r\\n]", ""))); } @Override protected ImmutableMap.Builder addMustacheLambdas() { return super.addMustacheLambdas() - .put("escapeDoubleQuote", new EscapeLambda("\"", "\\\"")); + .put("escapeDoubleQuote", new EscapeLambda("\"", "\\\"")) + .put("removeLineBreak", (fragment, writer) -> writer.write(fragment.execute().replaceAll("[\\r\\n]", ""))); } @Override @@ -1445,6 +1441,7 @@ private void markPropertyAsInherited(CodegenModel model, String baseName, String p.defaultValue = dataType + "." + toEnumVarName(discriminatorValue, dataType); } else { p.defaultValue = "\"" + escapeText(discriminatorValue) + "\""; + p.unescapedDefaultValue = discriminatorValue; } } }); diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache index a997cafd1621..86f60ae4f22d 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/api_doc.mustache @@ -1,22 +1,22 @@ # {{classname}}{{#description}} -{{.}}{{/description}} +{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{/description}} All URIs are relative to *{{basePath}}* | Method | HTTP request | Description | | ------------- | ------------- | ------------- | -{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#lambda.escapeMarkdown}}{{{unescapedSummary}}}{{/lambda.escapeMarkdown}} | {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{operationId}}** -> {{#returnType}}{{.}}{{#nullableReturnType}}?{{/nullableReturnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{#nullableReturnType}}?{{/nullableReturnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) -{{summary}}{{#notes}} +{{#lambda.escapeMarkdown}}{{{unescapedSummary}}}{{/lambda.escapeMarkdown}}{{#unescapedNotes}} -{{.}}{{/notes}} +{{#lambda.escapeMarkdown}}{{{unescapedNotes}}}{{/lambda.escapeMarkdown}}{{/unescapedNotes}} ### Example ```kotlin @@ -27,7 +27,7 @@ All URIs are relative to *{{basePath}}* {{! TODO: Auth method documentation examples}} val apiInstance = {{{classname}}}() {{#allParams}} -val {{{paramName}}} : {{{dataType}}} = {{{example}}} // {{{dataType}}} | {{{description}}} +val {{{paramName}}} : {{{dataType}}} = {{{example}}} // {{{dataType}}} | {{#lambda.collapseNewlines}}{{{unescapedDescription}}}{{/lambda.collapseNewlines}} {{/allParams}} try { {{#returnType}}val result : {{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}} = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}} @@ -46,11 +46,11 @@ try { This endpoint does not need any parameter. {{/allParams}} {{#allParams}} -{{#-last}} +{{#-first}} | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | -{{/-last}} -| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | +{{/-first}} +| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{#lambda.escapeMarkdown}}{{{unescapedDescription}}}{{/lambda.escapeMarkdown}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/class_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/class_doc.mustache index 6ab282918f35..d5f934b50df9 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/class_doc.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/class_doc.mustache @@ -3,7 +3,7 @@ ## Properties | Name | Type | Description | Notes | | ------------ | ------------- | ------------- | ------------- | -{{#vars}}| **{{name}}** | {{#isEnum}}[**inline**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} | +{{#vars}}| **{{name}}** | {{#isEnum}}[**inline**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}}{{/isEnum}} | {{#lambda.escapeMarkdown}}{{{unescapedDescription}}}{{/lambda.escapeMarkdown}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} | {{/vars}} {{#vars}}{{#isEnum}} @@ -11,5 +11,5 @@ ## Enum: {{baseName}} | Name | Value | | ---- | ----- |{{#allowableValues}} -| {{name}} | {{#values}}{{.}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}} | +| {{name}} | {{#values}}{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}} | {{/isEnum}}{{/vars}} 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 abaf53a3b30a..193b0f6b1ed3 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 @@ -9,7 +9,7 @@ @SerializedName("{{{vendorExtensions.x-base-name-literal}}}") {{/gson}} {{#jackson}} - @get:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") + @get:JsonProperty("{{#lambda.escapeInNormalString}}{{{baseName}}}{{/lambda.escapeInNormalString}}") {{/jackson}} {{#kotlinx_serialization}} {{^isEnum}}{{^isArray}}{{^isPrimitiveType}}{{^isModel}}@Contextual {{/isModel}}{{/isPrimitiveType}}{{/isArray}}{{/isEnum}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @@ -21,4 +21,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}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}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 + {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}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}}{{#isString}}{{^isEnum}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{^multiplatform}}{{{dataType}}}("{{{defaultValue}}}"){{/multiplatform}}{{#multiplatform}}({{{defaultValue}}}).toDouble(){{/multiplatform}}{{/isNumber}}{{/isString}}{{/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 0d9ec6067c5a..d64962ca840e 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 @@ -9,7 +9,7 @@ @SerializedName("{{{vendorExtensions.x-base-name-literal}}}") {{/gson}} {{#jackson}} - @get:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") + @get:JsonProperty("{{#lambda.escapeInNormalString}}{{{baseName}}}{{/lambda.escapeInNormalString}}") {{/jackson}} {{#kotlinx_serialization}} {{^isEnum}}{{^isArray}}{{^isPrimitiveType}}{{^isModel}}@Contextual {{/isModel}}{{/isPrimitiveType}}{{/isArray}}{{/isEnum}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @@ -21,4 +21,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}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}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 + {{#multiplatform}}@SerialName(value = "{{{vendorExtensions.x-base-name-literal}}}") @Required {{/multiplatform}}{{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.{{#modelMutable}}Mutable{{/modelMutable}}{{#uniqueItems}}Set{{/uniqueItems}}{{^uniqueItems}}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}} = {{#isString}}{{^isEnum}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{^multiplatform}}{{{dataType}}}("{{{defaultValue}}}"){{/multiplatform}}{{#multiplatform}}({{{defaultValue}}}).toDouble(){{/multiplatform}}{{/isNumber}}{{/isString}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/api.mustache index 8b2dbf4a3cdd..14cd05ed1505 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-ktor/api.mustache @@ -132,17 +132,17 @@ import com.fasterxml.jackson.databind.ObjectMapper val localVariableQuery = mutableMapOf>() {{#queryParams}} - {{{paramName}}}?.apply { localVariableQuery["{{baseName}}"] = {{#isContainer}}toMultiValue(this, "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf("${{{paramName}}}"){{/isContainer}} } + {{{paramName}}}?.apply { localVariableQuery["{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}"] = {{#isContainer}}toMultiValue(this, "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf("${{{paramName}}}"){{/isContainer}} } {{/queryParams}} val localVariableHeaders = mutableMapOf() {{#headerParams}} - {{{paramName}}}?.apply { localVariableHeaders["{{baseName}}"] = {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}} } + {{{paramName}}}?.apply { localVariableHeaders["{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}"] = {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}} } {{/headerParams}} val localVariableConfig = RequestConfig( RequestMethod.{{httpMethod}}, - "{{{path}}}"{{#pathParams}}.replace("{" + "{{baseName}}" + "}", "${{{paramName}}}"){{/pathParams}}, + "{{#lambda.escapeInNormalString}}{{{path}}}{{/lambda.escapeInNormalString}}"{{#pathParams}}.replace("{" + "{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}" + "}", "${{{paramName}}}"){{/pathParams}}, query = localVariableQuery, headers = localVariableHeaders, requiresAuthentication = {{#hasAuthMethods}}true{{/hasAuthMethods}}{{^hasAuthMethods}}false{{/hasAuthMethods}}, diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache index 8727a9a79b6f..8dd766d85280 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache @@ -142,7 +142,7 @@ import {{packageName}}.infrastructure.Serializer {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}{{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { + {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}{{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{#isString}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{#isString}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { {{#isDeprecated}} @Suppress("DEPRECATION") {{/isDeprecated}} @@ -264,7 +264,7 @@ import {{packageName}}.infrastructure.Serializer return RequestConfig( method = RequestMethod.{{httpMethod}}, - path = "{{{path}}}"{{#pathParams}}.replace("{"+"{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"+"}", encodeURIComponent({{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}.toString(){{/isContainer}})){{/pathParams}}, + path = "{{#lambda.escapeInNormalString}}{{{path}}}{{/lambda.escapeInNormalString}}"{{#pathParams}}.replace("{"+"{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"+"}", encodeURIComponent({{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}.toString(){{/isContainer}})){{/pathParams}}, query = localVariableQuery, headers = localVariableHeaders, requiresAuthentication = {{#hasAuthMethods}}true{{/hasAuthMethods}}{{^hasAuthMethods}}false{{/hasAuthMethods}}, diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache index 9cd7ef3fea02..614d09fe1884 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api.mustache @@ -155,7 +155,7 @@ import okhttp3.MultipartBody {{/-first}} {{/prioritizedContentTypes}} {{/formParams}} - @{{httpMethod}}("{{{path}}}") + @{{httpMethod}}("{{#lambda.escapeInNormalString}}{{{path}}}{{/lambda.escapeInNormalString}}") {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}{{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{^allParams}}){{/allParams}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{#-last}}){{/-last}}{{/allParams}}{{#returnType}}: {{/returnType}}{{^returnType}}{{#useResponseAsReturnType}}: {{/useResponseAsReturnType}}{{/returnType}}{{^doNotUseRxAndCoroutines}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Single<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Single<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{#useCoroutines}}{{#useResponseAsReturnType}}Response<{{/useResponseAsReturnType}}{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}{{#useResponseAsReturnType}}Unit{{/useResponseAsReturnType}}{{/returnType}}{{/isResponseFile}}{{#useResponseAsReturnType}}>{{/useResponseAsReturnType}}{{/useCoroutines}}{{/doNotUseRxAndCoroutines}}{{#doNotUseRxAndCoroutines}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}>{{/doNotUseRxAndCoroutines}} {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api_doc.mustache index f764206df126..e42df8e69aae 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/api_doc.mustache @@ -1,19 +1,19 @@ # {{classname}}{{#description}} -{{.}}{{/description}} +{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{/description}} All URIs are relative to *{{basePath}}* | Method | HTTP request | Description | | ------------- | ------------- | ------------- | -{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | +{{#operations}}{{#operation}}| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#lambda.escapeMarkdown}}{{{unescapedSummary}}}{{/lambda.escapeMarkdown}} | {{/operation}}{{/operations}} {{#operations}} {{#operation}} -{{summary}}{{#notes}} +{{#lambda.escapeMarkdown}}{{{unescapedSummary}}}{{/lambda.escapeMarkdown}}{{#unescapedNotes}} -{{.}}{{/notes}} +{{#lambda.escapeMarkdown}}{{{unescapedNotes}}}{{/lambda.escapeMarkdown}}{{/unescapedNotes}} ### Example ```kotlin @@ -35,7 +35,7 @@ apiClient.setBearerToken("TOKEN") {{/authMethods}} val webService = apiClient.createWebservice({{{classname}}}::class.java) {{#allParams}} -val {{{paramName}}} : {{{dataType}}} = {{{example}}} // {{{dataType}}} | {{{description}}} +val {{{paramName}}} : {{{dataType}}} = {{{example}}} // {{{dataType}}} | {{#lambda.collapseNewlines}}{{{unescapedDescription}}}{{/lambda.collapseNewlines}} {{/allParams}} {{#useCoroutines}} @@ -52,11 +52,11 @@ launch(Dispatchers.IO) { This endpoint does not need any parameter. {{/allParams}} {{#allParams}} -{{#-last}} +{{#-first}} | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | -{{/-last}} -| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | +{{/-first}} +| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{#lambda.escapeMarkdown}}{{{unescapedDescription}}}{{/lambda.escapeMarkdown}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/explodedQueryParam.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/explodedQueryParam.mustache index 3aaa4e67fbf4..1a266486f8aa 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/explodedQueryParam.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/explodedQueryParam.mustache @@ -1 +1 @@ -@Query("{{baseName}}") {{{baseName}}}: {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}} \ No newline at end of file +@Query("{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}") {{{baseName}}}: {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/formParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/formParams.mustache index fe5c9db69053..bb12b0dd5116 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field{{/isMultipart}}("{{baseName}}") {{{paramName}}}: {{{dataType}}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isFile}}{{#isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field("{{baseName}}"){{/isMultipart}} {{{paramName}}}: {{#isCollectionFormatMulti}}List<{{/isCollectionFormatMulti}}MultipartBody.Part{{#isCollectionFormatMulti}}>{{/isCollectionFormatMulti}}{{^required}}? = null{{/required}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field{{/isMultipart}}("{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}") {{{paramName}}}: {{{dataType}}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isFile}}{{#isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field("{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}"){{/isMultipart}} {{{paramName}}}: {{#isCollectionFormatMulti}}List<{{/isCollectionFormatMulti}}MultipartBody.Part{{#isCollectionFormatMulti}}>{{/isCollectionFormatMulti}}{{^required}}? = null{{/required}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/headerParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/headerParams.mustache index eaf1e7c3bf60..3e10dde21134 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@Header("{{baseName}}") {{{paramName}}}: {{#isEnum}}{{enumName}}{{operationIdCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}@Header("{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}") {{{paramName}}}: {{#isEnum}}{{enumName}}{{operationIdCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache index c48089c023d9..7274e265edf4 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/infrastructure/ApiClient.kt.mustache @@ -134,7 +134,7 @@ import okhttp3.MediaType.Companion.toMediaType okHttpClientBuilder: OkHttpClient.Builder? = null, {{^kotlinx_serialization}}serializerBuilder: {{#gson}}GsonBuilder{{/gson}}{{#moshi}}Moshi.Builder{{/moshi}}{{#jackson}}ObjectMapper{{/jackson}} = Serializer.{{#gson}}gsonBuilder{{/gson}}{{#moshi}}moshiBuilder{{/moshi}}{{#jackson}}jacksonObjectMapper{{/jackson}},{{/kotlinx_serialization}} authNames: Array - ) : this(baseUrl, okHttpClientBuilder{{^kotlinx_serialization}}, serializerBuilder{{/kotlinx_serialization}}) { + ) : this(baseUrl, okHttpClientBuilder{{^kotlinx_serialization}}, {{#generateOneOfAnyOfWrappers}}{{#gson}}registerTypeAdapterFactoryForAllModels(serializerBuilder){{/gson}}{{^gson}}serializerBuilder{{/gson}}{{/generateOneOfAnyOfWrappers}}{{^generateOneOfAnyOfWrappers}}serializerBuilder{{/generateOneOfAnyOfWrappers}}{{/kotlinx_serialization}}) { authNames.forEach { authName -> val auth: Interceptor? = when (authName) { {{#authMethods}} {{#isBasicBasic}}"{{name}}" -> HttpBasicAuth() @@ -148,21 +148,6 @@ import okhttp3.MediaType.Companion.toMediaType addAuthorization(authName, auth) } } - {{#generateOneOfAnyOfWrappers}} - {{^kotlinx_serialization}} - {{#gson}} - {{#models}} - {{#model}} - {{^isEnum}} - {{^hasChildren}} - serializerBuilder.registerTypeAdapterFactory({{modelPackage}}.{{{classname}}}.CustomTypeAdapterFactory()) - {{/hasChildren}} - {{/isEnum}} - {{/model}} - {{/models}} - {{/gson}} - {{/kotlinx_serialization}} - {{/generateOneOfAnyOfWrappers}} } {{#authMethods}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/paramJavadoc.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/paramJavadoc.mustache index fe821c41b4df..24146e3603a4 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/paramJavadoc.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/paramJavadoc.mustache @@ -1,5 +1,5 @@ {{#allParams}}{{#isDeepObject}} - * @param {{{paramName}}} {{description}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}{{/required}}{{/isDeepObject}}{{^isDeepObject}}{{#isExplode}}{{#hasVars}}{{#vars}} - * @param {{{baseName}}} {{description}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}{{/required}}{{/vars}}{{/hasVars}}{{^hasVars}} - * @param {{{paramName}}} {{description}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}{{/required}}{{/hasVars}}{{/isExplode}}{{^isExplode}} - * @param {{{paramName}}} {{description}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{#required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}}{{/required}}{{/isExplode}}{{/isDeepObject}}{{/allParams}} \ No newline at end of file + * @param {{{paramName}}} {{description}}{{^required}} (optional{{#defaultValue}}, default to {{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{/defaultValue}}){{/required}}{{#required}}{{#defaultValue}} (default to {{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}){{/defaultValue}}{{/required}}{{/isDeepObject}}{{^isDeepObject}}{{#isExplode}}{{#hasVars}}{{#vars}} + * @param {{{baseName}}} {{description}}{{^required}} (optional{{#defaultValue}}, default to {{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{/defaultValue}}){{/required}}{{#required}}{{#defaultValue}} (default to {{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}){{/defaultValue}}{{/required}}{{/vars}}{{/hasVars}}{{^hasVars}} + * @param {{{paramName}}} {{description}}{{^required}} (optional{{#defaultValue}}, default to {{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{/defaultValue}}){{/required}}{{#required}}{{#defaultValue}} (default to {{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}){{/defaultValue}}{{/required}}{{/hasVars}}{{/isExplode}}{{^isExplode}} + * @param {{{paramName}}} {{description}}{{^required}} (optional{{#defaultValue}}, default to {{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{/defaultValue}}){{/required}}{{#required}}{{#defaultValue}} (default to {{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}){{/defaultValue}}{{/required}}{{/isExplode}}{{/isDeepObject}}{{/allParams}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/pathParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/pathParams.mustache index 685c514e6a90..d5953158c7ee 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}@Path("{{baseName}}") {{{paramName}}}: {{{dataType}}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}@Path("{{{vendorExtensions.x-retrofit-path-name}}}") {{{paramName}}}: {{{dataType}}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/queryParam.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/queryParam.mustache index e5c9833fb8d5..1d3edfd936c1 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/queryParam.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-retrofit2/queryParam.mustache @@ -1 +1 @@ -@Query("{{baseName}}") {{{paramName}}}: {{#collectionFormat}}{{#isCollectionFormatMulti}}@JvmSuppressWildcards {{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{/collectionFormat}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}} \ No newline at end of file +@Query("{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}") {{{paramName}}}: {{#collectionFormat}}{{#isCollectionFormatMulti}}@JvmSuppressWildcards {{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{/collectionFormat}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/api.mustache index dc90d004dbdc..c2b25ca3cd0a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-restclient/api.mustache @@ -101,17 +101,17 @@ import {{packageName}}.infrastructure.* {{#queryParams}} {{^required}} if ({{{paramName}}} != null) { - put("{{baseName}}", {{#isContainer}}toMultiValue({{{paramName}}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDateTime}}{{#isDate}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{{paramName}}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) + put("{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}", {{#isContainer}}toMultiValue({{{paramName}}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDateTime}}{{#isDate}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{{paramName}}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) } {{/required}} {{#required}} {{#isNullable}} if ({{{paramName}}} != null) { - put("{{baseName}}", {{#isContainer}}toMultiValue({{{paramName}}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDateTime}}{{#isDate}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{{paramName}}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) + put("{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}", {{#isContainer}}toMultiValue({{{paramName}}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDateTime}}{{#isDate}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{{paramName}}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) } {{/isNullable}} {{^isNullable}} - put("{{baseName}}", {{#isContainer}}toMultiValue({{{paramName}}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDateTime}}{{#isDate}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{{paramName}}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) + put("{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}", {{#isContainer}}toMultiValue({{{paramName}}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDateTime}}{{#isDate}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{{paramName}}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) {{/isNullable}} {{/required}} {{/queryParams}} @@ -119,7 +119,7 @@ import {{packageName}}.infrastructure.* {{/hasQueryParams}} val localVariableHeaders: MutableMap = mutableMapOf({{#hasFormParams}}"Content-Type" to {{^consumes}}"multipart/form-data"{{/consumes}}{{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}{{/hasFormParams}}) {{#headerParams}} - {{{paramName}}}{{^required}}?{{/required}}.apply { localVariableHeaders["{{baseName}}"] = {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}} } + {{{paramName}}}{{^required}}?{{/required}}.apply { localVariableHeaders["{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}"] = {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}} } {{/headerParams}} {{^hasFormParams}}{{#hasConsumes}}{{#consumes}}localVariableHeaders["Content-Type"] = "{{{mediaType}}}" {{/consumes}}{{/hasConsumes}}{{/hasFormParams}}{{#hasProduces}}localVariableHeaders["Accept"] = "{{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}" @@ -127,13 +127,13 @@ import {{packageName}}.infrastructure.* val params = mutableMapOf( {{#pathParams}} - "{{baseName}}" to {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}{{/isContainer}}, + "{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}" to {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}{{/isContainer}}, {{/pathParams}} ) return RequestConfig( method = RequestMethod.{{httpMethod}}, - path = "{{{path}}}", + path = "{{#lambda.escapeInNormalString}}{{{path}}}{{/lambda.escapeInNormalString}}", params = params, query = localVariableQuery, headers = localVariableHeaders, diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/api.mustache index 6e30787d5042..77d9f45277af 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-spring-webclient/api.mustache @@ -103,17 +103,17 @@ import {{packageName}}.infrastructure.* {{#queryParams}} {{^required}} if ({{{paramName}}} != null) { - put("{{baseName}}", {{#isContainer}}toMultiValue({{{paramName}}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDateTime}}{{#isDate}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{{paramName}}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) + put("{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}", {{#isContainer}}toMultiValue({{{paramName}}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDateTime}}{{#isDate}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{{paramName}}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) } {{/required}} {{#required}} {{#isNullable}} if ({{{paramName}}} != null) { - put("{{baseName}}", {{#isContainer}}toMultiValue({{{paramName}}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDateTime}}{{#isDate}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{{paramName}}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) + put("{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}", {{#isContainer}}toMultiValue({{{paramName}}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDateTime}}{{#isDate}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{{paramName}}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) } {{/isNullable}} {{^isNullable}} - put("{{baseName}}", {{#isContainer}}toMultiValue({{{paramName}}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDateTime}}{{#isDate}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{{paramName}}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) + put("{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}", {{#isContainer}}toMultiValue({{{paramName}}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDateTime}}{{#isDate}}parseDateToQueryString<{{{dataType}}}>({{{paramName}}}){{/isDate}}{{^isDateTime}}{{^isDate}}{{{paramName}}}.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) {{/isNullable}} {{/required}} {{/queryParams}} @@ -121,7 +121,7 @@ import {{packageName}}.infrastructure.* {{/hasQueryParams}} val localVariableHeaders: MutableMap = mutableMapOf({{#hasFormParams}}"Content-Type" to {{^consumes}}"multipart/form-data"{{/consumes}}{{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}{{/hasFormParams}}) {{#headerParams}} - {{{paramName}}}{{^required}}?{{/required}}.apply { localVariableHeaders["{{baseName}}"] = {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}} } + {{{paramName}}}{{^required}}?{{/required}}.apply { localVariableHeaders["{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}"] = {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}} } {{/headerParams}} {{^hasFormParams}}{{#hasConsumes}}{{#consumes}}localVariableHeaders["Content-Type"] = "{{{mediaType}}}" {{/consumes}}{{/hasConsumes}}{{/hasFormParams}}{{#hasProduces}}localVariableHeaders["Accept"] = "{{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}" @@ -129,13 +129,13 @@ import {{packageName}}.infrastructure.* val params = mutableMapOf( {{#pathParams}} - "{{baseName}}" to {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}{{/isContainer}}, + "{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}" to {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}{{/isContainer}}, {{/pathParams}} ) return RequestConfig( method = RequestMethod.{{httpMethod}}, - path = "{{{path}}}", + path = "{{#lambda.escapeInNormalString}}{{{path}}}{{/lambda.escapeInNormalString}}", params = params, query = localVariableQuery, headers = localVariableHeaders, diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/api.mustache index a82b32cbfb7a..dec3078745b2 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-vertx/api.mustache @@ -104,7 +104,7 @@ import {{packageName}}.infrastructure.* {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}{{#useCoroutines}}suspend {{/useCoroutines}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : {{^useCoroutines}}Future<{{/useCoroutines}}{{#returnType}}{{{returnType}}}{{#nullableReturnType}}{{^isResponseOptional}}?{{/isResponseOptional}}{{/nullableReturnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{^useCoroutines}}>{{/useCoroutines}} { + {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}{{#useCoroutines}}suspend {{/useCoroutines}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : {{^useCoroutines}}Future<{{/useCoroutines}}{{#returnType}}{{{returnType}}}{{#nullableReturnType}}{{^isResponseOptional}}?{{/isResponseOptional}}{{/nullableReturnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{^useCoroutines}}>{{/useCoroutines}} { return {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}).map { localVarResponse -> when (localVarResponse.responseType) { ResponseType.Success -> {{#returnType}}(localVarResponse as Success<*>).data as {{{returnType}}}{{#nullableReturnType}}{{^isResponseOptional}}?{{/isResponseOptional}}{{/nullableReturnType}}{{#isResponseOptional}}?{{/isResponseOptional}}{{/returnType}}{{^returnType}}Unit{{/returnType}} @@ -138,10 +138,10 @@ import {{packageName}}.infrastructure.* {{/isDeprecated}} {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : Future> { val vertxClient = WebClient.create(vertx) - val request = vertxClient.requestAbs(HttpMethod.{{httpMethod}}, UriTemplate.of("$basePath{{{path}}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", encodeURIComponent({{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}.toString(){{/isContainer}})){{/pathParams}})) + val request = vertxClient.requestAbs(HttpMethod.{{httpMethod}}, UriTemplate.of("$basePath{{#lambda.escapeInNormalString}}{{{path}}}{{/lambda.escapeInNormalString}}"{{#pathParams}}.replace("{"+"{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}"+"}", encodeURIComponent({{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}{{^required}}?{{/required}}.value{{/isEnum}}.toString(){{/isContainer}})){{/pathParams}})) {{#hasFormParams}}request.putHeader("Content-Type", {{^consumes}}"multipart/form-data"{{/consumes}}{{#consumes.0}}"{{{mediaType}}}"{{/consumes.0}}){{/hasFormParams}} - {{#headerParams}}{{{paramName}}}{{^required}}?{{/required}}.apply { request.putHeader("{{baseName}}", {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}})}{{/headerParams}} + {{#headerParams}}{{{paramName}}}{{^required}}?{{/required}}.apply { request.putHeader("{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}", {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}})}{{/headerParams}} {{^hasFormParams}}{{#hasConsumes}} {{#consumes}} request.putHeader("Content-Type", "{{{mediaType}}}") @@ -158,7 +158,7 @@ import {{packageName}}.infrastructure.* {{#hasQueryParams}} {{#queryParams}} - {{{paramName}}}{{^required}}?{{/required}}.let { request.queryParams().add("{{baseName}}", {{#isContainer}}toMultiValue(it.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString<{{{dataType}}}>(it){{/isDateTime}}{{#isDate}}parseDateToQueryString<{{{dataType}}}>(it){{/isDate}}{{^isDateTime}}{{^isDate}}it.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) } + {{{paramName}}}{{^required}}?{{/required}}.let { request.queryParams().add("{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}", {{#isContainer}}toMultiValue(it.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{#isDateTime}}parseDateToQueryString<{{{dataType}}}>(it){{/isDateTime}}{{#isDate}}parseDateToQueryString<{{{dataType}}}>(it){{/isDate}}{{^isDateTime}}{{^isDate}}it.toString(){{/isDate}}{{/isDateTime}}){{/isContainer}}) } {{/queryParams}} {{/hasQueryParams}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache index 246b5e73d169..6911da4884ce 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache @@ -63,10 +63,10 @@ import {{packageName}}.infrastructure.CollectionFormats.* // to make it easy to override with your own. // create path and map variables - val path = "{{{path}}}"{{#pathParams}}.replace("{" + "{{baseName}}" + "}", {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}IRequestFactory.escapeString({{{paramName}}}.toString()){{/isContainer}}){{/pathParams}} + val path = "{{#lambda.escapeInNormalString}}{{{path}}}{{/lambda.escapeInNormalString}}"{{#pathParams}}.replace("{" + "{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}" + "}", {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}IRequestFactory.escapeString({{{paramName}}}.toString()){{/isContainer}}){{/pathParams}} val formParams = mapOf({{^formParams}}){{/formParams}}{{#formParams}} - "{{baseName}}" to IRequestFactory.parameterToString({{paramName}}){{^-last}},{{/-last}}{{#-last}} + "{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}" to IRequestFactory.parameterToString({{paramName}}){{^-last}},{{/-last}}{{#-last}} ){{/-last}}{{/formParams}} @@ -74,12 +74,12 @@ import {{packageName}}.infrastructure.CollectionFormats.* // TODO, if its apikey auth, then add the header names here and the hardcoded auth key // Only support hard coded apikey in query param auth for when we do this first path val queryParams = mapOf({{^queryParams}}){{/queryParams}}{{#queryParams}} - "{{baseName}}" to IRequestFactory.parameterToString({{paramName}}){{^-last}},{{/-last}}{{#-last}} + "{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}" to IRequestFactory.parameterToString({{paramName}}){{^-last}},{{/-last}}{{#-last}} ){{/-last}}{{/queryParams}} .filter { it.value.isNotEmpty() } val headerParams: Map = mapOf({{^headerParams}}){{/headerParams}}{{#headerParams}} - "{{baseName}}" to IRequestFactory.parameterToString({{paramName}}){{^-last}},{{/-last}}{{#-last}} + "{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}" to IRequestFactory.parameterToString({{paramName}}){{^-last}},{{/-last}}{{#-last}} ){{/-last}}{{/headerParams}} return suspendCoroutine { continuation -> diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api_doc.mustache index f7bf73ae31d0..0880f411d23d 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api_doc.mustache @@ -5,15 +5,15 @@ All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{#lambda.escapeMarkdown}}{{{unescapedSummary}}}{{/lambda.escapeMarkdown}}{{/summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} -{{summary}}{{#notes}} +{{#lambda.escapeMarkdown}}{{{unescapedSummary}}}{{/lambda.escapeMarkdown}}{{#unescapedNotes}} -{{notes}}{{/notes}} +{{#lambda.escapeMarkdown}}{{{unescapedNotes}}}{{/lambda.escapeMarkdown}}{{/unescapedNotes}} ### Example ```kotlin @@ -35,7 +35,7 @@ apiClient.setBearerToken("TOKEN") {{/authMethods}} val webService = apiClient.createWebservice({{{classname}}}::class.java) {{#allParams}} -val {{{paramName}}} : {{{dataType}}} = {{{example}}} // {{{dataType}}} | {{{description}}} +val {{{paramName}}} : {{{dataType}}} = {{{example}}} // {{{dataType}}} | {{#lambda.collapseNewlines}}{{{unescapedDescription}}}{{/lambda.collapseNewlines}} {{/allParams}} {{#useCoroutines}} @@ -48,10 +48,10 @@ launch(Dispatchers.IO) { ``` ### Parameters -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-first}} Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +------------- | ------------- | ------------- | -------------{{/-first}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{#lambda.escapeMarkdown}}{{{unescapedDescription}}}{{/lambda.escapeMarkdown}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{{defaultValue}}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/formParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/formParams.mustache index 98427cd4817c..49200a17ef2e 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{{paramName}}}: {{{dataType}}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{{paramName}}}: {{{dataType}}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/headerParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/headerParams.mustache index 3e5c64b2cd8e..f88388a5dfd8 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}{{{paramName}}}: {{{dataType}}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}{{{paramName}}}: {{{dataType}}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/pathParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/pathParams.mustache index 4cc7de2240bd..3d7d5d145855 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}{{{paramName}}}: {{{dataType}}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{{paramName}}}: {{{dataType}}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/queryParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/queryParams.mustache index da0a0c0930ac..2cbe779502bb 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{{paramName}}}: {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{{paramName}}}: {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache index cf5a4fe733e7..ba8348755c44 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache @@ -68,7 +68,7 @@ import kotlinx.serialization.encoding.* {{#returnType}} @Suppress("UNCHECKED_CAST") {{/returnType}} - {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open suspend fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{defaultValue}}}.toDouble(){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{defaultValue}}}.toDouble(){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): HttpResponse<{{{returnType}}}{{^returnType}}Unit{{/returnType}}> { + {{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}open suspend fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{defaultValue}}}.toDouble(){{/isNumber}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{^isNumber}}{{#isEnum}}{{enumName}}{{operationIdCamelCase}}.{{&enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{defaultValue}}}.toDouble(){{/isNumber}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): HttpResponse<{{{returnType}}}{{^returnType}}Unit{{/returnType}}> { val localVariableAuthNames = listOf({{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}}) @@ -123,13 +123,13 @@ import kotlinx.serialization.encoding.* {{/hasBodyParam}} val localVariableQuery = mutableMapOf>(){{#queryParams}} - {{{paramName}}}?.apply { localVariableQuery["{{baseName}}"] = {{#isContainer}}toMultiValue(this, "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{^isEnumOrRef}}"${{{paramName}}}"{{/isEnumOrRef}}{{#isEnumOrRef}}"${ {{paramName}}.value }"{{/isEnumOrRef}}){{/isContainer}} }{{/queryParams}} + {{{paramName}}}?.apply { localVariableQuery["{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}"] = {{#isContainer}}toMultiValue(this, "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf({{^isEnumOrRef}}"${{{paramName}}}"{{/isEnumOrRef}}{{#isEnumOrRef}}"${ {{paramName}}.value }"{{/isEnumOrRef}}){{/isContainer}} }{{/queryParams}} val localVariableHeaders = mutableMapOf(){{#headerParams}} - {{{paramName}}}?.apply { localVariableHeaders["{{baseName}}"] = {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}} }{{/headerParams}} + {{{paramName}}}?.apply { localVariableHeaders["{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}"] = {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}} }{{/headerParams}} val localVariableConfig = RequestConfig( RequestMethod.{{httpMethod}}, - "{{{path}}}"{{#pathParams}}.replace("{" + "{{baseName}}" + "}", {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{^isEnumOrRef}}"${{{paramName}}}"{{/isEnumOrRef}}{{#isEnumOrRef}}"${ {{paramName}}.value }"{{/isEnumOrRef}}{{/isContainer}}){{/pathParams}}, + "{{#lambda.escapeInNormalString}}{{{path}}}{{/lambda.escapeInNormalString}}"{{#pathParams}}.replace("{" + "{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}" + "}", {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{^isEnumOrRef}}"${{{paramName}}}"{{/isEnumOrRef}}{{#isEnumOrRef}}"${ {{paramName}}.value }"{{/isEnumOrRef}}{{/isContainer}}){{/pathParams}}, query = localVariableQuery, headers = localVariableHeaders, requiresAuthentication = {{#hasAuthMethods}}true{{/hasAuthMethods}}{{^hasAuthMethods}}false{{/hasAuthMethods}}, diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/param_default_value.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/param_default_value.mustache index cb392335071d..2818c5ebcb26 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/param_default_value.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/param_default_value.mustache @@ -1 +1 @@ -{{^isNumber}}{{#isEnum}}{{#enumDefaultValue}}{{enumName}}{{operationIdCamelCase}}.{{&.}}{{/enumDefaultValue}}{{^enumDefaultValue}}null{{/enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{defaultValue}}}.toDouble(){{/isNumber}} \ No newline at end of file +{{^isNumber}}{{#isEnum}}{{#enumDefaultValue}}{{enumName}}{{operationIdCamelCase}}.{{&.}}{{/enumDefaultValue}}{{^enumDefaultValue}}null{{/enumDefaultValue}}{{/isEnum}}{{^isEnum}}{{#isString}}{{^allowableValues}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/allowableValues}}{{#allowableValues}}{{{defaultValue}}}{{/allowableValues}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/isEnum}}{{/isNumber}}{{#isNumber}}{{{defaultValue}}}.toDouble(){{/isNumber}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-misk/apiAction.mustache b/modules/openapi-generator/src/main/resources/kotlin-misk/apiAction.mustache index 9d9f929aeed6..9871eb7bae0d 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-misk/apiAction.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-misk/apiAction.mustache @@ -45,7 +45,7 @@ class {{classname}}Action @Inject constructor( {{#operation}} @{{httpMethod}}("{{{actionPathPrefix}}}{{path}}") - @Description("{{{summary}}}"){{#hasConsumes}} + @Description("{{#lambda.escapeInNormalString}}{{{unescapedSummary}}}{{/lambda.escapeInNormalString}}"){{#hasConsumes}} {{{actionRequestContentType}}}({{#consumes}}{{{actionRequestContentTypePrefix}}}.{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}){{/hasConsumes}}{{#hasProduces}} @ResponseContentType({{#produces}}MediaTypes.{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}){{/hasProduces}} {{#actionAnnotations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-misk/api_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-misk/api_doc.mustache index 6553762ac7cf..9352bf7b0696 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-misk/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-misk/api_doc.mustache @@ -1,22 +1,22 @@ # {{classname}}{{#description}} -{{.}}{{/description}} +{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#lambda.escapeMarkdown}}{{{unescapedSummary}}}{{/lambda.escapeMarkdown}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{operationId}}** -> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) -{{summary}}{{#notes}} +{{#lambda.escapeMarkdown}}{{{unescapedSummary}}}{{/lambda.escapeMarkdown}}{{#unescapedNotes}} -{{.}}{{/notes}} +{{#lambda.escapeMarkdown}}{{{unescapedNotes}}}{{/lambda.escapeMarkdown}}{{/unescapedNotes}} ### Example ```kotlin @@ -27,10 +27,10 @@ Method | HTTP request | Description {{! TODO: Auth method documentation examples}} val apiInstance = {{{classname}}}() {{#allParams}} -val {{{paramName}}} : {{{dataType}}} = {{{example}}} // {{{dataType}}} | {{{description}}} +val {{{paramName}}} : {{{dataType}}} = {{{example}}} // {{{dataType}}} | {{#lambda.collapseNewlines}}{{{unescapedDescription}}}{{/lambda.collapseNewlines}} {{/allParams}} try { - {{#returnType}}val result : {{{.}}} = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}} + {{#returnType}}val result : {{{returnType}}} = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}} println(result){{/returnType}} } catch (e: ClientException) { println("4xx response calling {{{classname}}}#{{{operationId}}}") @@ -45,7 +45,7 @@ try { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{#lambda.escapeMarkdown}}{{{unescapedDescription}}}{{/lambda.escapeMarkdown}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/kotlin-misk/class_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-misk/class_doc.mustache index b6b482afb78b..01d22ac87c05 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-misk/class_doc.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-misk/class_doc.mustache @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isEnum}}[**inline**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} +{{#vars}}**{{name}}** | {{#isEnum}}[**inline**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}}{{/isEnum}} | {{#lambda.escapeMarkdown}}{{{unescapedDescription}}}{{/lambda.escapeMarkdown}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} {{/vars}} {{#vars}}{{#isEnum}} @@ -11,5 +11,5 @@ Name | Type | Description | Notes ## Enum: {{baseName}} Name | Value ---- | -----{{#allowableValues}} -{{name}} | {{#values}}{{.}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}} +{{name}} | {{#values}}{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}} {{/isEnum}}{{/vars}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-misk/cookieParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-misk/cookieParams.mustache index 028264a18bcf..1f225337dc10 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-misk/cookieParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-misk/cookieParams.mustache @@ -1 +1 @@ -{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@CookieValue(name = "{{baseName}}"{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}) {{{paramName}}}: {{>optionalDataType}}{{/isCookieParam}} \ No newline at end of file +{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@CookieValue(name = "{{baseName}}"{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"{{/defaultValue}}) {{{paramName}}}: {{>optionalDataType}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-misk/model.mustache b/modules/openapi-generator/src/main/resources/kotlin-misk/model.mustache index 88970ebaba28..60c855812169 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-misk/model.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-misk/model.mustache @@ -23,7 +23,7 @@ data class {{classname}}( {{#description}} /** {{description}} */ {{/description}} - val {{{name}}}: {{{dataType}}}{{^required}}?{{/required}}{{#defaultValue}}{{#isNumber}} = {{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{^isNumber}} = {{{defaultValue}}}{{/isNumber}}{{/defaultValue}}{{^defaultValue}}{{^required}} = null{{/required}}{{/defaultValue}}{{^-last}},{{/-last}} + val {{{name}}}: {{{dataType}}}{{^required}}?{{/required}}{{#defaultValue}}{{#isString}}{{^isEnum}} = "{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}} = {{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{#isNumber}} = {{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{^isNumber}} = {{{defaultValue}}}{{/isNumber}}{{/isString}}{{/defaultValue}}{{^defaultValue}}{{^required}} = null{{/required}}{{/defaultValue}}{{^-last}},{{/-last}} {{/vars}} ) {{/isEnum}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/api_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/api_doc.mustache index 6553762ac7cf..9352bf7b0696 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/api_doc.mustache @@ -1,22 +1,22 @@ # {{classname}}{{#description}} -{{.}}{{/description}} +{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#lambda.escapeMarkdown}}{{{unescapedSummary}}}{{/lambda.escapeMarkdown}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{operationId}}** -> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) -{{summary}}{{#notes}} +{{#lambda.escapeMarkdown}}{{{unescapedSummary}}}{{/lambda.escapeMarkdown}}{{#unescapedNotes}} -{{.}}{{/notes}} +{{#lambda.escapeMarkdown}}{{{unescapedNotes}}}{{/lambda.escapeMarkdown}}{{/unescapedNotes}} ### Example ```kotlin @@ -27,10 +27,10 @@ Method | HTTP request | Description {{! TODO: Auth method documentation examples}} val apiInstance = {{{classname}}}() {{#allParams}} -val {{{paramName}}} : {{{dataType}}} = {{{example}}} // {{{dataType}}} | {{{description}}} +val {{{paramName}}} : {{{dataType}}} = {{{example}}} // {{{dataType}}} | {{#lambda.collapseNewlines}}{{{unescapedDescription}}}{{/lambda.collapseNewlines}} {{/allParams}} try { - {{#returnType}}val result : {{{.}}} = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}} + {{#returnType}}val result : {{{returnType}}} = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}} println(result){{/returnType}} } catch (e: ClientException) { println("4xx response calling {{{classname}}}#{{{operationId}}}") @@ -45,7 +45,7 @@ try { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{#lambda.escapeMarkdown}}{{{unescapedDescription}}}{{/lambda.escapeMarkdown}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/class_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/class_doc.mustache index b6b482afb78b..01d22ac87c05 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/class_doc.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/class_doc.mustache @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isEnum}}[**inline**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} +{{#vars}}**{{name}}** | {{#isEnum}}[**inline**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}}{{/isEnum}} | {{#lambda.escapeMarkdown}}{{{unescapedDescription}}}{{/lambda.escapeMarkdown}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} {{/vars}} {{#vars}}{{#isEnum}} @@ -11,5 +11,5 @@ Name | Type | Description | Notes ## Enum: {{baseName}} Name | Value ---- | -----{{#allowableValues}} -{{name}} | {{#values}}{{.}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}} +{{name}} | {{#values}}{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}} {{/isEnum}}{{/vars}} 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 a5885bca9b72..de2dd38d6779 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}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file + {{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{#isString}}{{^isEnum}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/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 4adcedf78cba..c35b69a40798 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 @@ -2,4 +2,4 @@ /* {{{.}}} */ {{/description}} {{! Note that required properties may be nullable according to the OpenAPI specification. }} - {{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}} \ No newline at end of file + {{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{#isString}}{{^isEnum}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/isString}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/data_class_opt_var.mustache index 684077c31410..8b2cf1411e5a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/data_class_opt_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/data_class_opt_var.mustache @@ -3,4 +3,4 @@ {{/description}} {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}} @field:com.fasterxml.jackson.annotation.JsonProperty("{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}") - {{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file + {{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{#isString}}{{^isEnum}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/data_class_req_var.mustache index f8c518ff8c05..b595d5f22725 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/data_class_req_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/data_class_req_var.mustache @@ -3,4 +3,4 @@ {{/description}} {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}} @field:com.fasterxml.jackson.annotation.JsonProperty("{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}") - {{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}} \ No newline at end of file + {{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{#isString}}{{^isEnum}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/isString}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/paramDefault.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/paramDefault.mustache index dd5fc214c553..71530aa445e8 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/paramDefault.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin5/paramDefault.mustache @@ -1,2 +1,2 @@ -{{#defaultValue}} ?:{{#isInteger}}{{{defaultValue}}}{{/isInteger}}{{#isLong}}{{{defaultValue}}}L{{/isLong}}{{#isShort}}{{{defaultValue}}}.toShort(){{/isShort}}{{#isDouble}}{{{defaultValue}}}.toDouble(){{/isDouble}}{{#isFloat}}{{{defaultValue}}}f{{/isFloat}}{{#isEnum}}{{{dataType}}}.valueOf("{{{defaultValue}}}"){{/isEnum}}{{#isBoolean}}{{{defaultValue}}}{{/isBoolean}}{{#isString}}"{{{defaultValue}}}"{{/isString}}{{#isUuid}}"UUID.fromString({{{defaultValue}}})"{{/isUuid}}{{#isUuid}}"UUID.fromString({{{defaultValue}}})"{{/isUuid}} +{{#defaultValue}} ?:{{#isInteger}}{{{defaultValue}}}{{/isInteger}}{{#isLong}}{{{defaultValue}}}L{{/isLong}}{{#isShort}}{{{defaultValue}}}.toShort(){{/isShort}}{{#isDouble}}{{{defaultValue}}}.toDouble(){{/isDouble}}{{#isFloat}}{{{defaultValue}}}f{{/isFloat}}{{#isEnum}}{{{dataType}}}.valueOf("{{{defaultValue}}}"){{/isEnum}}{{#isBoolean}}{{{defaultValue}}}{{/isBoolean}}{{#isString}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isString}}{{#isUuid}}"UUID.fromString({{{defaultValue}}})"{{/isUuid}} {{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/data_class_opt_var.mustache index 684077c31410..8b2cf1411e5a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/data_class_opt_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/data_class_opt_var.mustache @@ -3,4 +3,4 @@ {{/description}} {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}} @field:com.fasterxml.jackson.annotation.JsonProperty("{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}") - {{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file + {{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{#isString}}{{^isEnum}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/data_class_req_var.mustache index f8c518ff8c05..b595d5f22725 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/data_class_req_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/data_class_req_var.mustache @@ -3,4 +3,4 @@ {{/description}} {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}} @field:com.fasterxml.jackson.annotation.JsonProperty("{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}") - {{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}} \ No newline at end of file + {{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{#isString}}{{^isEnum}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/isString}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/paramDefault.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/paramDefault.mustache index dd5fc214c553..71530aa445e8 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/paramDefault.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/javalin6/paramDefault.mustache @@ -1,2 +1,2 @@ -{{#defaultValue}} ?:{{#isInteger}}{{{defaultValue}}}{{/isInteger}}{{#isLong}}{{{defaultValue}}}L{{/isLong}}{{#isShort}}{{{defaultValue}}}.toShort(){{/isShort}}{{#isDouble}}{{{defaultValue}}}.toDouble(){{/isDouble}}{{#isFloat}}{{{defaultValue}}}f{{/isFloat}}{{#isEnum}}{{{dataType}}}.valueOf("{{{defaultValue}}}"){{/isEnum}}{{#isBoolean}}{{{defaultValue}}}{{/isBoolean}}{{#isString}}"{{{defaultValue}}}"{{/isString}}{{#isUuid}}"UUID.fromString({{{defaultValue}}})"{{/isUuid}}{{#isUuid}}"UUID.fromString({{{defaultValue}}})"{{/isUuid}} +{{#defaultValue}} ?:{{#isInteger}}{{{defaultValue}}}{{/isInteger}}{{#isLong}}{{{defaultValue}}}L{{/isLong}}{{#isShort}}{{{defaultValue}}}.toShort(){{/isShort}}{{#isDouble}}{{{defaultValue}}}.toDouble(){{/isDouble}}{{#isFloat}}{{{defaultValue}}}f{{/isFloat}}{{#isEnum}}{{{dataType}}}.valueOf("{{{defaultValue}}}"){{/isEnum}}{{#isBoolean}}{{{defaultValue}}}{{/isBoolean}}{{#isString}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isString}}{{#isUuid}}"UUID.fromString({{{defaultValue}}})"{{/isUuid}} {{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/cookieParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/cookieParams.mustache index 929a3218703d..e651554834ed 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/cookieParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/cookieParams.mustache @@ -1 +1 @@ -{{#isCookieParam}}@CookieParam("{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue({{#lambda.doublequote}}{{{.}}}{{/lambda.doublequote}}){{/defaultValue}}{{/isContainer}} {{paramName}}: {{{dataType}}}{{#isNullable}}?{{/isNullable}}{{^isNullable}}{{^defaultValue}}{{^required}}?{{/required}}{{/defaultValue}}{{/isNullable}}{{/isCookieParam}} \ No newline at end of file +{{#isCookieParam}}@CookieParam("{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue({{#lambda.doublequote}}{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/lambda.doublequote}}){{/defaultValue}}{{/isContainer}} {{paramName}}: {{{dataType}}}{{#isNullable}}?{{/isNullable}}{{^isNullable}}{{^defaultValue}}{{^required}}?{{/required}}{{/defaultValue}}{{/isNullable}}{{/isCookieParam}} \ No newline at end of file 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 f277f71da441..059feb846954 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("{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}") -{{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/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}}null{{/defaultValue}}{{#defaultValue}}{{#isString}}{{^isEnum}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/headerParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/headerParams.mustache index cc1ce2f3ea90..335afdafb0b6 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@HeaderParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} {{#defaultValue}} @DefaultValue({{#lambda.doublequote}}{{{.}}}{{/lambda.doublequote}}){{/defaultValue}} {{paramName}}: {{{dataType}}}{{#isNullable}}?{{/isNullable}}{{^isNullable}}{{^defaultValue}}{{^required}}?{{/required}}{{/defaultValue}}{{/isNullable}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}@HeaderParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} {{#defaultValue}} @DefaultValue({{#lambda.doublequote}}{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/lambda.doublequote}}){{/defaultValue}} {{paramName}}: {{{dataType}}}{{#isNullable}}?{{/isNullable}}{{^isNullable}}{{^defaultValue}}{{^required}}?{{/required}}{{/defaultValue}}{{/isNullable}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/queryParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/queryParams.mustache index a0155cf4b59d..07ef848c8fc0 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/jaxrs-spec/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}@QueryParam("{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue({{#lambda.doublequote}}{{{.}}}{{/lambda.doublequote}}){{/defaultValue}}{{/isContainer}} {{paramName}}: {{{dataType}}}{{#isNullable}}?{{/isNullable}}{{^isNullable}}{{^defaultValue}}{{^required}}?{{/required}}{{/defaultValue}}{{/isNullable}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}@QueryParam("{{#lambda.escapeDollar}}{{baseName}}{{/lambda.escapeDollar}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue({{#lambda.doublequote}}{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/lambda.doublequote}}){{/defaultValue}}{{/isContainer}} {{paramName}}: {{{dataType}}}{{#isNullable}}?{{/isNullable}}{{^isNullable}}{{^defaultValue}}{{^required}}?{{/required}}{{/defaultValue}}{{/isNullable}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor2/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor2/data_class_opt_var.mustache index a5885bca9b72..de2dd38d6779 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor2/data_class_opt_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor2/data_class_opt_var.mustache @@ -1,4 +1,4 @@ {{#description}} /* {{{.}}} */ {{/description}} - {{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file + {{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{#isString}}{{^isEnum}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor2/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor2/data_class_req_var.mustache index 4adcedf78cba..c35b69a40798 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor2/data_class_req_var.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor2/data_class_req_var.mustache @@ -2,4 +2,4 @@ /* {{{.}}} */ {{/description}} {{! Note that required properties may be nullable according to the OpenAPI specification. }} - {{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/defaultValue}} \ No newline at end of file + {{>modelMutable}} {{{name}}}: {{#isEnum}}{{{classname}}}.{{{nameInPascalCase}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{#isString}}{{^isEnum}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/isString}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache index 033d044fb28e..822bfab3f4bc 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache @@ -72,22 +72,22 @@ class {{classname}}Controller({{#serviceInterface}}@Autowired(required = true) v }}{{/useResponseEntity}}{{! }}{{#swagger2AnnotationLibrary}}{{! }} @Operation( - summary = "{{{summary}}}", + summary = "{{#lambda.escapeInNormalString}}{{{unescapedSummary}}}{{/lambda.escapeInNormalString}}", operationId = "{{{operationId}}}", - description = """{{{unescapedNotes}}}""", + description = """{{#lambda.escapeDollarInMultiline}}{{{unescapedNotes}}}{{/lambda.escapeDollarInMultiline}}""", responses = [{{#responses}} - ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{#baseType}}, content = [Content({{#isArray}}array = ArraySchema({{/isArray}}schema = Schema(implementation = {{{baseType}}}::class)){{#isArray}}){{/isArray}}]{{/baseType}}){{^-last}},{{/-last}}{{/responses}} ]{{#hasAuthMethods}}, + ApiResponse(responseCode = "{{{code}}}", description = "{{#lambda.escapeInNormalString}}{{{unescapedMessage}}}{{/lambda.escapeInNormalString}}"{{#baseType}}, content = [Content({{#isArray}}array = ArraySchema({{/isArray}}schema = Schema(implementation = {{{baseType}}}::class)){{#isArray}}){{/isArray}}]{{/baseType}}){{^-last}},{{/-last}}{{/responses}} ]{{#hasAuthMethods}}, security = [ {{#authMethods}}SecurityRequirement(name = "{{name}}"{{#isOAuth}}, scopes = [ {{#scopes}}"{{scope}}"{{^-last}}, {{/-last}}{{/scopes}} ]{{/isOAuth}}){{^-last}},{{/-last}}{{/authMethods}} ]{{/hasAuthMethods}} ){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} @ApiOperation( - value = "{{{summary}}}", + value = "{{#lambda.escapeInNormalString}}{{{unescapedSummary}}}{{/lambda.escapeInNormalString}}", nickname = "{{{operationId}}}", - notes = "{{{notes}}}"{{#returnBaseType}}, + notes = "{{#lambda.escapeInNormalString}}{{{unescapedNotes}}}{{/lambda.escapeInNormalString}}"{{#returnBaseType}}, response = {{{.}}}::class{{/returnBaseType}}{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = [{{#authMethods}}Authorization(value = "{{name}}"{{#isOAuth}}, scopes = [{{#scopes}}AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}}]{{/isOAuth}}){{^-last}}, {{/-last}}{{/authMethods}}]{{/hasAuthMethods}}) @ApiResponses( - value = [{{#responses}}ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}::class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}}]){{/swagger1AnnotationLibrary}} + value = [{{#responses}}ApiResponse(code = {{{code}}}, message = "{{#lambda.escapeInNormalString}}{{{unescapedMessage}}}{{/lambda.escapeInNormalString}}"{{#baseType}}, response = {{{.}}}::class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}}]){{/swagger1AnnotationLibrary}} {{#implicitHeadersParams.0}} {{>implicitHeaders}} {{/implicitHeadersParams.0}} @@ -99,7 +99,7 @@ class {{classname}}Controller({{#serviceInterface}}@Autowired(required = true) v {{/isDeprecated}} @RequestMapping( method = [RequestMethod.{{httpMethod}}], - // "{{#lambdaEscapeInNormalString}}{{{path}}}{{/lambdaEscapeInNormalString}}" + // "{{#lambda.escapeInNormalString}}{{{path}}}{{/lambda.escapeInNormalString}}" value = [PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}}]{{#singleContentTypes}}{{#hasProduces}}, produces = [{{#vendorExtensions.x-accepts}}"{{{.}}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-accepts}}]{{/hasProduces}}{{#hasConsumes}}, consumes = "{{{vendorExtensions.x-content-type}}}"{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}, @@ -122,7 +122,7 @@ class {{classname}}Controller({{#serviceInterface}}@Autowired(required = true) v const val BASE_PATH: String = "{{=<% %>=}}<%contextPath%><%={{ }}=%>" {{/useRequestMappingOnController}} {{#operation}} - const val PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}}: String = "{{{path}}}" + const val PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}}: String = "{{#lambda.escapeInNormalString}}{{{path}}}{{/lambda.escapeInNormalString}}" {{/operation}} } } diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache index 795070dde368..d1ac16e26efc 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache @@ -84,24 +84,24 @@ interface {{classname}} { }}{{#swagger2AnnotationLibrary}}{{! }} @Operation( tags = [{{#tags}}"{{{name}}}",{{/tags}}], - summary = "{{{summary}}}", + summary = "{{#lambda.escapeInNormalString}}{{{unescapedSummary}}}{{/lambda.escapeInNormalString}}", operationId = "{{{operationId}}}", - description = """{{{unescapedNotes}}}""", + description = """{{#lambda.escapeDollarInMultiline}}{{{unescapedNotes}}}{{/lambda.escapeDollarInMultiline}}""", responses = [{{#responses}} - ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{#baseType}}, content = [Content({{#isArray}}array = ArraySchema({{/isArray}}schema = Schema(implementation = {{{baseType}}}::class)){{#isArray}}){{/isArray}}]{{/baseType}}){{^-last}},{{/-last}}{{/responses}} + ApiResponse(responseCode = "{{{code}}}", description = "{{#lambda.escapeInNormalString}}{{{unescapedMessage}}}{{/lambda.escapeInNormalString}}"{{#baseType}}, content = [Content({{#isArray}}array = ArraySchema({{/isArray}}schema = Schema(implementation = {{{baseType}}}::class)){{#isArray}}){{/isArray}}]{{/baseType}}){{^-last}},{{/-last}}{{/responses}} ]{{#hasAuthMethods}}, security = [ {{#authMethods}}SecurityRequirement(name = "{{name}}"{{#isOAuth}}, scopes = [ {{#scopes}}"{{scope}}"{{^-last}}, {{/-last}}{{/scopes}} ]{{/isOAuth}}){{^-last}},{{/-last}}{{/authMethods}} ]{{/hasAuthMethods}} ){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} @ApiOperation( - value = "{{{summary}}}", + value = "{{#lambda.escapeInNormalString}}{{{unescapedSummary}}}{{/lambda.escapeInNormalString}}", nickname = "{{{operationId}}}", - notes = "{{{notes}}}"{{#returnBaseType}}, + notes = "{{#lambda.escapeInNormalString}}{{{unescapedNotes}}}{{/lambda.escapeInNormalString}}"{{#returnBaseType}}, response = {{{.}}}::class{{/returnBaseType}}{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = [{{#authMethods}}Authorization(value = "{{name}}"{{#isOAuth}}, scopes = [{{#scopes}}AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}}]{{/isOAuth}}){{^-last}}, {{/-last}}{{/authMethods}}]{{/hasAuthMethods}} ) @ApiResponses( - value = [{{#responses}}ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}::class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}}, {{/-last}}{{/responses}}] + value = [{{#responses}}ApiResponse(code = {{{code}}}, message = "{{#lambda.escapeInNormalString}}{{{unescapedMessage}}}{{/lambda.escapeInNormalString}}"{{#baseType}}, response = {{{.}}}::class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}}, {{/-last}}{{/responses}}] ){{/swagger1AnnotationLibrary}} {{#implicitHeadersParams.0}} {{>implicitHeaders}} @@ -114,7 +114,7 @@ interface {{classname}} { {{/isDeprecated}} @RequestMapping( method = [RequestMethod.{{httpMethod}}], - // "{{#lambdaEscapeInNormalString}}{{{path}}}{{/lambdaEscapeInNormalString}}" + // "{{#lambda.escapeInNormalString}}{{{path}}}{{/lambda.escapeInNormalString}}" value = [PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}}]{{#singleContentTypes}}{{#hasProduces}}, produces = [{{#vendorExtensions.x-accepts}}"{{{.}}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-accepts}}]{{/hasProduces}}{{#hasConsumes}}, consumes = "{{{vendorExtensions.x-content-type}}}"{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}, @@ -142,7 +142,7 @@ interface {{classname}} { const val BASE_PATH: String = "{{=<% %>=}}<%contextPath%><%={{ }}=%>" {{/useRequestMappingOnInterface}} {{#operation}} - const val PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}}: String = "{{{path}}}" + const val PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}}: String = "{{#lambda.escapeInNormalString}}{{{path}}}{{/lambda.escapeInNormalString}}" {{/operation}} } } diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/bodyParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/bodyParams.mustache index b4f03475cd0b..528774332746 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"{{#required}}, required = true{{/required}}{{^isContainer}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = ["{{{allowableValues}}}"], defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}, schema = Schema(defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = ["{{{allowableValues}}}"]){{/defaultValue}}{{/allowableValues}}{{/isContainer}}) {{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{^isContainer}}{{#allowableValues}}, allowableValues = "{{{.}}}"{{/allowableValues}}{{/isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}) {{/swagger1AnnotationLibrary}}{{#useBeanValidation}}@Valid{{>beanValidationBodyParams}}{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{{paramName}}}: {{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}Flow<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"{{#required}}, required = true{{/required}}{{^isContainer}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = ["{{{allowableValues}}}"], defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}, schema = Schema(defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = ["{{{allowableValues}}}"]){{/defaultValue}}{{/allowableValues}}{{/isContainer}}) {{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"{{#required}}, required = true{{/required}}{{^isContainer}}{{#allowableValues}}, allowableValues = "{{{.}}}"{{/allowableValues}}{{/isContainer}}{{#defaultValue}}, defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"{{/defaultValue}}) {{/swagger1AnnotationLibrary}}{{#useBeanValidation}}@Valid{{>beanValidationBodyParams}}{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{{paramName}}}: {{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}{{>optionalDataType}}{{/isArray}}{{#isArray}}Flow<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/cookieParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/cookieParams.mustache index 028264a18bcf..1f225337dc10 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/cookieParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/cookieParams.mustache @@ -1 +1 @@ -{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@CookieValue(name = "{{baseName}}"{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}) {{{paramName}}}: {{>optionalDataType}}{{/isCookieParam}} \ No newline at end of file +{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@CookieValue(name = "{{baseName}}"{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"{{/defaultValue}}) {{{paramName}}}: {{>optionalDataType}}{{/isCookieParam}} \ No newline at end of file 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 ab575d4bf9d3..a480199012b5 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassOptVar.mustache @@ -1,6 +1,6 @@ {{#useBeanValidation}}{{>beanValidation}}{{>beanValidationModel}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}} - @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}} + @Schema({{#example}}example = "{{#lambda.escapeInNormalString}}{{{.}}}{{/lambda.escapeInNormalString}}", {{/example}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{#lambda.escapeInNormalString}}{{{.}}}{{/lambda.escapeInNormalString}}", {{/example}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"){{/swagger1AnnotationLibrary}}{{#deprecated}} @Deprecated(message = ""){{/deprecated}}{{#vendorExtensions.x-field-extra-annotation}} {{{.}}}{{/vendorExtensions.x-field-extra-annotation}} - @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 + @get:JsonProperty("{{#lambda.escapeInNormalString}}{{{baseName}}}{{/lambda.escapeInNormalString}}"){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInPascalCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{#isString}}{{^isEnum}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/isString}}{{/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 92e2875ac08a..b7c20a085acd 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClassReqVar.mustache @@ -1,5 +1,5 @@ {{#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}}{{#vendorExtensions.x-field-extra-annotation}} + @Schema({{#example}}example = "{{#lambda.escapeInNormalString}}{{{.}}}{{/lambda.escapeInNormalString}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} + @ApiModelProperty({{#example}}example = "{{#lambda.escapeInNormalString}}{{{.}}}{{/lambda.escapeInNormalString}}", {{/example}}required = true, {{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"){{/swagger1AnnotationLibrary}}{{#vendorExtensions.x-field-extra-annotation}} {{{.}}}{{/vendorExtensions.x-field-extra-annotation}} - @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 + @get:JsonProperty("{{#lambda.escapeInNormalString}}{{{baseName}}}{{/lambda.escapeInNormalString}}", required = true){{#isInherited}} override{{/isInherited}} {{>modelMutable}} {{{name}}}: {{#isEnum}}{{#isArray}}{{baseType}}<{{/isArray}}{{classname}}.{{{nameInPascalCase}}}{{#isArray}}>{{/isArray}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}}?{{/isNullable}}{{#defaultValue}} = {{#isString}}{{^isEnum}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{^isNumber}}{{{defaultValue}}}{{/isNumber}}{{#isNumber}}{{{dataType}}}("{{{defaultValue}}}"){{/isNumber}}{{/isString}}{{/defaultValue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/formParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/formParams.mustache index 456af893718f..41b695aff458 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]{{^isContainer}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/isContainer}}{{/defaultValue}}{{/allowableValues}}) {{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}) {{/swagger1AnnotationLibrary}}{{#useBeanValidation}}@Valid {{/useBeanValidation}}{{#isModel}}@RequestPart{{/isModel}}{{^isModel}}@RequestParam{{/isModel}}(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}}{{/isFile}}{{#isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}") {{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "file detail") {{/swagger1AnnotationLibrary}}{{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart("{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]{{^isContainer}}, defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"){{/isContainer}}{{/defaultValue}}{{/allowableValues}}) {{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"{{/defaultValue}}) {{/swagger1AnnotationLibrary}}{{#useBeanValidation}}@Valid {{/useBeanValidation}}{{#isModel}}@RequestPart{{/isModel}}{{^isModel}}@RequestParam{{/isModel}}(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}}{{/isFile}}{{#isFile}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}") {{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "file detail") {{/swagger1AnnotationLibrary}}{{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart("{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{paramName}}}: {{>optionalDataType}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/headerParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/headerParams.mustache index 0c2678f1bf67..8287a7c95dfc 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}{{#useBeanValidation}}{{>beanValidationCore}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}", `in` = ParameterIn.HEADER{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]{{^isContainer}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/isContainer}}{{/defaultValue}}{{/allowableValues}}) {{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}) {{/swagger1AnnotationLibrary}}@RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}{{#defaultValue}}, defaultValue = {{^isString}}"{{{.}}}"{{/isString}}{{#isString}}{{#isEnum}}"{{{.}}}"{{/isEnum}}{{^isEnum}}{{{.}}}{{/isEnum}}{{/isString}}{{/defaultValue}}) {{{paramName}}}: {{>optionalDataType}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}{{#useBeanValidation}}{{>beanValidationCore}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}", `in` = ParameterIn.HEADER{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]{{^isContainer}}, defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"){{/isContainer}}{{/defaultValue}}{{/allowableValues}}) {{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}) {{/swagger1AnnotationLibrary}}@RequestHeader(value = "{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}{{#defaultValue}}, defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"{{/defaultValue}}) {{{paramName}}}: {{>optionalDataType}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/implicitHeaders.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/implicitHeaders.mustache index c7b37059e2d9..6ac7bc679eba 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/implicitHeaders.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/implicitHeaders.mustache @@ -1,14 +1,14 @@ {{#swagger2AnnotationLibrary}} @Parameters(value = [ {{#implicitHeadersParams}} - Parameter(name = "{{{baseName}}}"{{#isDeprecated}}, deprecated = true{{/isDeprecated}}, description = "{{{description}}}"{{#required}}, required = true{{/required}}, `in` = ParameterIn.HEADER){{^-last}},{{/-last}} + Parameter(name = "{{#lambda.escapeInNormalString}}{{{baseName}}}{{/lambda.escapeInNormalString}}"{{#isDeprecated}}, deprecated = true{{/isDeprecated}}, description = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"{{#required}}, required = true{{/required}}, `in` = ParameterIn.HEADER){{^-last}},{{/-last}} {{/implicitHeadersParams}} ]) {{/swagger2AnnotationLibrary}} {{#swagger1AnnotationLibrary}} @ApiImplicitParams(value = [ {{#implicitHeadersParams}} - ApiImplicitParam(name = "{{{baseName}}}", value = "{{{description}}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{^-last}},{{/-last}} + ApiImplicitParam(name = "{{#lambda.escapeInNormalString}}{{{baseName}}}{{/lambda.escapeInNormalString}}", value = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}", {{#required}}required = true,{{/required}} dataType = "{{{dataType}}}", paramType = "header"){{^-last}},{{/-last}} {{/implicitHeadersParams}} ]) {{/swagger1AnnotationLibrary}} \ 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 3fa63ad64876..222949e2d42c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceOptVar.mustache @@ -1,5 +1,5 @@ {{#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}}{{#vendorExtensions.x-field-extra-annotation}} + @get:Schema({{#example}}example = "{{#lambda.escapeInNormalString}}{{{.}}}{{/lambda.escapeInNormalString}}", {{/example}}{{#required}}requiredMode = Schema.RequiredMode.REQUIRED, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} + @get:ApiModelProperty({{#example}}example = "{{#lambda.escapeInNormalString}}{{{.}}}{{/lambda.escapeInNormalString}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"){{/swagger1AnnotationLibrary}}{{#vendorExtensions.x-field-extra-annotation}} {{{.}}}{{/vendorExtensions.x-field-extra-annotation}} - {{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? {{^discriminator}}= {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}}{{/discriminator}} + {{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? {{^discriminator}}= {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{#isString}}{{^isEnum}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/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 8f0fb71ba319..fc9af6228d44 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/interfaceReqVar.mustache @@ -1,5 +1,5 @@ {{#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}}{{#vendorExtensions.x-field-extra-annotation}} + @get:Schema({{#example}}example = "{{#lambda.escapeInNormalString}}{{{.}}}{{/lambda.escapeInNormalString}}", {{/example}}{{#required}}requiredMode = Schema.RequiredMode.REQUIRED, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}description = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"){{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}} + @get:ApiModelProperty({{#example}}example = "{{#lambda.escapeInNormalString}}{{{.}}}{{/lambda.escapeInNormalString}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"){{/swagger1AnnotationLibrary}}{{#vendorExtensions.x-field-extra-annotation}} {{{.}}}{{/vendorExtensions.x-field-extra-annotation}} {{#isInherited}}override {{/isInherited}}{{>modelMutable}} {{{name}}}: {{#isEnum}}{{classname}}.{{nameInPascalCase}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-declarative-http-interface/apiInterface.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-declarative-http-interface/apiInterface.mustache index 53ce2730aa8b..de44538b18d7 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-declarative-http-interface/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-declarative-http-interface/apiInterface.mustache @@ -63,7 +63,7 @@ interface {{classname}} { }}{{^useResponseEntity}} @ResponseStatus({{#springHttpStatus}}{{#responses.0}}{{{code}}}{{/responses.0}}{{/springHttpStatus}}) {{/useResponseEntity}}{{! }}{{#httpMethod}} @HttpExchange( - // "{{#lambdaEscapeInNormalString}}{{{path}}}{{/lambdaEscapeInNormalString}}" + // "{{#lambda.escapeInNormalString}}{{{path}}}{{/lambda.escapeInNormalString}}" url = PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}}, method = "{{httpMethod}}" ) diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-declarative-http-interface/httpInterfaceBodyParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-declarative-http-interface/httpInterfaceBodyParams.mustache index e884046f7d6d..cd6e83f9680c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-declarative-http-interface/httpInterfaceBodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-declarative-http-interface/httpInterfaceBodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"{{#required}}, required = true{{/required}}{{^isContainer}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = ["{{{allowableValues}}}"], defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}, schema = Schema(defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = ["{{{allowableValues}}}"]){{/defaultValue}}{{/allowableValues}}{{/isContainer}}) {{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{^isContainer}}{{#allowableValues}}, allowableValues = "{{{.}}}"{{/allowableValues}}{{/isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}) {{/swagger1AnnotationLibrary}}{{#useBeanValidation}}@Valid{{>beanValidationBodyParams}}{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{{paramName}}}: {{>optionalDataType}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"{{#required}}, required = true{{/required}}{{^isContainer}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = ["{{{allowableValues}}}"], defaultValue = "{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}, schema = Schema(defaultValue = "{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = ["{{{allowableValues}}}"]){{/defaultValue}}{{/allowableValues}}{{/isContainer}}) {{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"{{#required}}, required = true{{/required}}{{^isContainer}}{{#allowableValues}}, allowableValues = "{{{.}}}"{{/allowableValues}}{{/isContainer}}{{#defaultValue}}, defaultValue = "{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/defaultValue}}) {{/swagger1AnnotationLibrary}}{{#useBeanValidation}}@Valid{{>beanValidationBodyParams}}{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{{paramName}}}: {{>optionalDataType}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/methodBody.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/methodBody.mustache index 0a6660b342a8..73cb1e15d498 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/methodBody.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/methodBody.mustache @@ -5,7 +5,7 @@ getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { {{/-first}} if (mediaType.isCompatibleWith(MediaType.valueOf("{{{contentType}}}"))) { - ApiUtil.setExampleResponse(request, "{{{contentType}}}", "{{#lambdaRemoveLineBreak}}{{#lambdaEscapeInNormalString}}{{{example}}}{{/lambdaEscapeInNormalString}}{{/lambdaRemoveLineBreak}}") + ApiUtil.setExampleResponse(request, "{{{contentType}}}", "{{#lambda.escapeInNormalString}}{{{example}}}{{/lambda.escapeInNormalString}}") break } {{#-last}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/pathParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/pathParams.mustache index 2e28d18c78fa..f3189ef2c381 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]{{^isContainer}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/isContainer}}{{/defaultValue}}{{/allowableValues}}) {{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}) {{/swagger1AnnotationLibrary}}@PathVariable("{{baseName}}") {{{paramName}}}: {{>optionalDataType}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]{{^isContainer}}, defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"){{/isContainer}}{{/defaultValue}}{{/allowableValues}}) {{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}) {{/swagger1AnnotationLibrary}}@PathVariable("{{baseName}}") {{{paramName}}}: {{>optionalDataType}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/queryParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/queryParams.mustache index 27d7e286bb33..ca0a9c62d12a 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]{{^isContainer}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}){{/isContainer}}{{/defaultValue}}{{/allowableValues}}) {{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) {{/swagger1AnnotationLibrary}}{{#useBeanValidation}}@Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue = {{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}){{/isModel}}{{#isDate}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME){{/isDateTime}} {{{paramName}}}: {{>optionalDataType}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{#swagger2AnnotationLibrary}}@Parameter(description = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"{{#required}}, required = true{{/required}}{{#allowableValues}}{{#defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]{{^isContainer}}, defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"{{/isContainer}}){{/defaultValue}}{{/allowableValues}}{{#allowableValues}}{{^defaultValue}}, schema = Schema(allowableValues = [{{#values}}"{{{.}}}"{{^-last}}, {{/-last}}{{/values}}]){{/defaultValue}}{{/allowableValues}}{{^allowableValues}}{{#defaultValue}}{{^isContainer}}, schema = Schema(defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"){{/isContainer}}{{/defaultValue}}{{/allowableValues}}) {{/swagger2AnnotationLibrary}}{{#swagger1AnnotationLibrary}}@ApiParam(value = "{{#lambda.escapeInNormalString}}{{{unescapedDescription}}}{{/lambda.escapeInNormalString}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"{{/defaultValue}}{{/isContainer}}) {{/swagger1AnnotationLibrary}}{{#useBeanValidation}}@Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = "{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{#isString}}{{^isEnum}}{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}"{{/defaultValue}}{{/isContainer}}){{/isModel}}{{#isDate}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME){{/isDateTime}} {{{paramName}}}: {{>optionalDataType}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/api_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/api_doc.mustache index 31dee489e67c..425dd3db6ce6 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/api_doc.mustache @@ -1,28 +1,28 @@ # {{classname}}{{#description}} -{{.}}{{/description}} +{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#lambda.escapeMarkdown}}{{{unescapedSummary}}}{{/lambda.escapeMarkdown}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{operationId}}** -> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) -{{summary}}{{#notes}} +{{#lambda.escapeMarkdown}}{{{unescapedSummary}}}{{/lambda.escapeMarkdown}}{{#unescapedNotes}} -{{.}}{{/notes}} +{{#lambda.escapeMarkdown}}{{{unescapedNotes}}}{{/lambda.escapeMarkdown}}{{/unescapedNotes}} ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{#lambda.escapeMarkdown}}{{{unescapedDescription}}}{{/lambda.escapeMarkdown}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/class_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/class_doc.mustache index b6b482afb78b..01d22ac87c05 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-vertx-server/class_doc.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-vertx-server/class_doc.mustache @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isEnum}}[**inline**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} +{{#vars}}**{{name}}** | {{#isEnum}}[**inline**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}}{{/isEnum}} | {{#lambda.escapeMarkdown}}{{{unescapedDescription}}}{{/lambda.escapeMarkdown}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} {{/vars}} {{#vars}}{{#isEnum}} @@ -11,5 +11,5 @@ Name | Type | Description | Notes ## Enum: {{baseName}} Name | Value ---- | -----{{#allowableValues}} -{{name}} | {{#values}}{{.}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}} +{{name}} | {{#values}}{{#lambda.escapeMarkdown}}{{{.}}}{{/lambda.escapeMarkdown}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}} {{/isEnum}}{{/vars}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-wiremock/api-stub.mustache b/modules/openapi-generator/src/main/resources/kotlin-wiremock/api-stub.mustache index d3b79befcf3a..3ca7701c1702 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-wiremock/api-stub.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-wiremock/api-stub.mustache @@ -33,12 +33,12 @@ open class {{classname}}Stubs(private val objectMapper: ObjectMapper) { * @return A [{{operationIdCamelCase}}StubBuilder] to configure the response, and the final [MappingBuilder]. */ fun {{operationId}}({{#pathParams}}{{paramName}}: StringValuePattern, {{/pathParams}}{{#queryParams}}{{paramName}}: StringValuePattern? = null, {{/queryParams}}configurer: MappingBuilder.() -> MappingBuilder = { this }): {{operationIdCamelCase}}StubBuilder = - {{operationIdCamelCase}}StubBuilder(objectMapper, {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}(urlPathTemplate("{{{path}}}")) + {{operationIdCamelCase}}StubBuilder(objectMapper, {{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}(urlPathTemplate("{{#lambda.escapeInNormalString}}{{{path}}}{{/lambda.escapeInNormalString}}")) {{#pathParams}} - .withPathParam("{{baseName}}", {{paramName}}) + .withPathParam("{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}", {{paramName}}) {{/pathParams}} {{#queryParams}} - .apply { {{paramName}}?.let { withQueryParam("{{baseName}}", it) } } + .apply { {{paramName}}?.let { withQueryParam("{{#lambda.escapeInNormalString}}{{baseName}}{{/lambda.escapeInNormalString}}", it) } } {{/queryParams}} .configurer() ) diff --git a/modules/openapi-generator/src/main/resources/kotlin-wiremock/model.mustache b/modules/openapi-generator/src/main/resources/kotlin-wiremock/model.mustache index c060ec50935c..79dc87577c0c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-wiremock/model.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-wiremock/model.mustache @@ -21,10 +21,10 @@ enum class {{classname}} { {{^isEnum}} data class {{classname}}( {{#allVars}} - @field:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}") + @field:JsonProperty("{{#lambda.escapeInNormalString}}{{{vendorExtensions.x-base-name-literal}}}{{/lambda.escapeInNormalString}}") val {{{name}}}: {{{dataType}}}{{^required}}?{{/required}}{{! - !}}{{^required}} = {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{{.}}}{{/defaultValue}}{{/required}}{{! - }}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}, + !}}{{^required}} = {{^defaultValue}}null{{/defaultValue}}{{#defaultValue}}{{#isString}}{{^isEnum}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/defaultValue}}{{/required}}{{! + }}{{#required}}{{#defaultValue}} = {{#isString}}{{^isEnum}}"{{#lambda.escapeInNormalString}}{{{unescapedDefaultValue}}}{{/lambda.escapeInNormalString}}"{{/isEnum}}{{#isEnum}}{{{defaultValue}}}{{/isEnum}}{{/isString}}{{^isString}}{{{defaultValue}}}{{/isString}}{{/defaultValue}}{{/required}}, {{/allVars}} ) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinClientCodegenApiTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinClientCodegenApiTest.java index dd0c30ccf6ac..2e4d0931a42d 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinClientCodegenApiTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinClientCodegenApiTest.java @@ -171,6 +171,29 @@ public void testJvmOkHttp4ApiClientUsesExplicitDateTypeArgumentsForQuerySerializ assertFileNotContains(Paths.get(apiClientPath), "is OffsetDateTime -> parseDateToQueryString(value)"); } + @Test + public void testDollarInPathParamSanitizedForRetrofit2_20502() throws IOException { + OpenAPI openAPI = readOpenAPI("src/test/resources/3_0/kotlin/echo_api.yaml"); + + KotlinClientCodegen codegen = createCodegen(ClientLibrary.JVM_RETROFIT2); + codegen.additionalProperties().put(KotlinClientCodegen.USE_COROUTINES, "true"); + codegen.additionalProperties().put(KotlinClientCodegen.USE_RESPONSE_AS_RETURN_TYPE, "true"); + + ClientOptInput input = createClientOptInput(openAPI, codegen); + DefaultGenerator generator = new DefaultGenerator(); + enableOnlyApiGeneration(generator); + + List files = generator.opts(input).generate(); + File echoApi = files.stream().filter(file -> file.getName().equals("EchoApi.kt")).findAny().orElseThrow(); + + // Retrofit @Path name must not contain '$' — must use the sanitized paramName + assertFileContains(echoApi.toPath(), "@Path(\"dollarParamName\")"); + assertFileContains(echoApi.toPath(), "echo/string-escaping/{dollarParamName}"); + // Raw '$paramName' must never appear in the @Path annotation value + assertFileNotContains(echoApi.toPath(), "@Path(\"$paramName\")"); + assertFileNotContains(echoApi.toPath(), "@Path(\"\\$paramName\")"); + } + @Test(dataProvider = "librariesWithDateQueryHelper") public void testGeneratedApisUseExplicitDateTypeArgumentsForQuerySerialization(ClientLibrary library) throws IOException { OpenAPI openAPI = readOpenAPI("3_0/kotlin/echo_api.yaml"); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinClientCodegenModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinClientCodegenModelTest.java index 23f98e3c443e..4d1607a6ce65 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinClientCodegenModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/KotlinClientCodegenModelTest.java @@ -923,6 +923,35 @@ public void testCompanionObjectGeneratesCompanionInModel() throws IOException { TestUtils.assertFileContains(petModel, "companion object { }"); } + /** + * Issue 20502: $ in property baseName must be escaped to \$ in @get:JsonProperty strings + * when using jackson serialization library (uses escapeInNormalString lambda). + */ + @Test + public void issue20502_dollarInBaseNameEscapedInJsonProperty() throws IOException { + File output = Files.createTempDirectory("test").toFile(); + output.deleteOnExit(); + + KotlinClientCodegen codegen = new KotlinClientCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, "jackson"); + codegen.processOpts(); + + new DefaultGenerator() + .opts(new ClientOptInput() + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue20502-kotlin-string-escaping.yaml")) + .config(codegen)) + .generate(); + + Path modelFile = Paths.get(output + "/src/main/kotlin/org/openapitools/client/models/ItemWithAllEscapingEdgeCases.kt"); + // baseName "$id" must be escaped to "\$id" inside @get:JsonProperty + TestUtils.assertFileContains(modelFile, "@get:JsonProperty(\"\\$id\")"); + // baseName "name$Value" must be escaped to "name\$Value" + TestUtils.assertFileContains(modelFile, "@get:JsonProperty(\"name\\$Value\")"); + // plain baseName without $ must appear verbatim (verifies lambda resolves {{{baseName}}} at all) + TestUtils.assertFileContains(modelFile, "@get:JsonProperty(\"commentCloseValue\")"); + } + private static class ModelNameTest { private final String expectedName; private final String expectedClassName; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java index 95c8024deccc..f2febe614a9e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java @@ -6017,4 +6017,88 @@ public void testSealedResponseInterfacesWithDeclarativeHttpInterface() throws IO "fun getUser(", "): ResponseEntity"); } + + + + // ── Issue 20502: string-escaping fixes ───────────────────────────────────────────────────────── + + /** + * Issue 1: path parameters containing {@code $} (e.g. {@code {item$Id}}) were emitted as-is into + * Kotlin {@code const val} string literals, triggering Kotlin string interpolation and causing a + * compile error. The path must be rendered with {@code $} escaped to {@code \$}. + */ + @Test(description = "Issue 20502 #1: $ in path param names must be escaped to \\$ in PATH const val") + public void issue20502_dollarEscapedInPathConstVal() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + + new DefaultGenerator() + .opts(new ClientOptInput() + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue20502-kotlin-string-escaping.yaml")) + .config(codegen)) + .generate(); + + Path apiFile = Paths.get(output + "/src/main/kotlin/org/openapitools/api/ItemsApiController.kt"); + // The path "/items/{item$Id}/sub/{item$SubId}" must have $ escaped as \$ in the const val + assertFileContains(apiFile, "\"/items/{item\\$Id}/sub/{item\\$SubId}\""); + } + + /** + * Issue 2: {@code $}, {@code "}, and {@code \} in operation summaries, descriptions, response + * messages, and parameter descriptions were not properly escaped when placed inside Kotlin + * annotation double-quoted strings, producing invalid Kotlin code. + */ + @Test(description = "Issue 20502 #2: $, \", \\ in annotation strings must be properly escaped") + public void issue20502_specialCharsEscapedInAnnotationStrings() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + + new DefaultGenerator() + .opts(new ClientOptInput() + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue20502-kotlin-string-escaping.yaml")) + .config(codegen)) + .generate(); + + Path apiFile = Paths.get(output + "/src/main/kotlin/org/openapitools/api/ItemsApiController.kt"); + // Summary/message annotation strings must have $ escaped to \$ + assertFileContains(apiFile, "\\$some"); + // Notes/description uses triple-quoted strings: $ becomes ${'$'} + assertFileContains(apiFile, "${'$'}some"); + } + + /** + * Issue 3: {@code toDefaultValue()} previously called {@code escapeText()} which internally + * calls {@code escapeUnsafeCharacters()}, corrupting star-slash to star-underscore-slash inside + * Kotlin string literals. Default values must be emitted verbatim (modulo string-literal + * escaping). + */ + @Test(description = "Issue 20502 #3: */ in string defaults must not be corrupted to *_/") + public void issue20502_starSlashNotCorruptedInModelDefaults() throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + + KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + + new DefaultGenerator() + .opts(new ClientOptInput() + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/issue20502-kotlin-string-escaping.yaml")) + .config(codegen)) + .generate(); + + Path modelFile = Paths.get(output + "/src/main/kotlin/org/openapitools/model/ItemWithAllEscapingEdgeCases.kt"); + // The default "starts /* comment and ends */" must not be mangled to *_/ + assertFileContains(modelFile, "\"starts /* comment and ends */\""); + // $ in string defaults must be escaped to \$ (not left raw, which would cause interpolation) + assertFileContains(modelFile, "\"\\$one"); + // baseName with $ must be escaped in @get:JsonProperty (verifies lambda resolves baseName correctly) + assertFileContains(modelFile, "@get:JsonProperty(\"\\$id\")"); + assertFileContains(modelFile, "@get:JsonProperty(\"name\\$Value\")"); + } } diff --git a/modules/openapi-generator/src/test/resources/3_0/issue_10865_default_values.yaml b/modules/openapi-generator/src/test/resources/3_0/issue_10865_default_values.yaml index c7fd7668cb4a..e43be3e1815c 100644 --- a/modules/openapi-generator/src/test/resources/3_0/issue_10865_default_values.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/issue_10865_default_values.yaml @@ -154,6 +154,12 @@ paths: default: - item0 + - name: qs0 + in: query + required: false + type: string + default: "hello $world, backslash=\\, quote=\", end */" + description: "String with $dollar, backslash, quote, comment-close in default" responses: "200": @@ -178,3 +184,7 @@ definitions: n1: type: number default: 68 + s0: + type: string + default: "hello $world, backslash=\\, quote=\", end */" + description: "String property with $dollar, backslash, quote, comment-close in default" diff --git a/modules/openapi-generator/src/test/resources/3_0/kotlin/echo_api.yaml b/modules/openapi-generator/src/test/resources/3_0/kotlin/echo_api.yaml index 940803b93b92..dbe0e43539e8 100644 --- a/modules/openapi-generator/src/test/resources/3_0/kotlin/echo_api.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/kotlin/echo_api.yaml @@ -602,6 +602,34 @@ paths: text/plain: schema: type: string + # To test string escaping edge cases in Kotlin (Issue 20502) + /echo/string-escaping/{$paramName}: + get: + tags: + - echo + summary: "Test $-in-path-param escaping" + description: "Tests that path params with $dollar, backslash \\ and quote \" are properly escaped" + operationId: "tests/echo/string-escaping/{$paramName}" + parameters: + - in: path + name: "$paramName" + required: true + schema: + type: string + - in: query + name: "filter$Type" + required: false + description: "Filter with $dollar in description and comment-close */" + schema: + type: string + default: "default$Value with \\ and \"" + responses: + '200': + description: "ok" + content: + text/plain: + schema: + type: string components: securitySchemes: http_auth: @@ -810,3 +838,14 @@ components: format: double minimum: 0.8 maximum: 50.2 + StringEscapingEdgeCases: + type: object + description: "Model to test: $dollar, backslash \\, quote \", comment-close */" + properties: + dollarDefault: + type: string + description: "A string whose default has $dollar, backslash \\, quote \" and comment-close */" + default: "hello $world, backslash=\\, quote=\", end */" + regularProp: + type: string + description: "Regular property for baseline comparison" diff --git a/modules/openapi-generator/src/test/resources/3_0/kotlin/issue20502-kotlin-string-escaping.yaml b/modules/openapi-generator/src/test/resources/3_0/kotlin/issue20502-kotlin-string-escaping.yaml new file mode 100644 index 000000000000..6050d433a8f2 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/kotlin/issue20502-kotlin-string-escaping.yaml @@ -0,0 +1,225 @@ +openapi: 3.0.0 +info: + title: "Kotlin string-escaping worst-case: SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + description: | + Multi-line description with every problematic sequence: + double-quote: " + single-backslash: \ + double-backslash: \\ + dollar: $interpolated + comment-close: */ + comment-open: /* + triple-quote: """ + all combined: SQ="; SBS=\; DBS=\\; SD=$some; CC=*/; TQ=""" + version: "1.0.0" + +servers: + - url: 'http://localhost/v1' + +# External path-level docs to show externalDocs on an operation +externalDocs: + description: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some" + url: 'http://example.com/docs' + +paths: + + # ── Issue 1: $ in path parameter names ──────────────────────────────────── + /items/{item$Id}/sub/{item$SubId}: + get: + operationId: getItemWithDollarPathParams + summary: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + description: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + externalDocs: + description: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some" + url: 'http://example.com/ops/getItem' + parameters: + # $ in path param name — double-quote YAML form + - name: "item$Id" + in: path + required: true + description: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + schema: + type: string + example: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + + # $ in path param name — single-quote YAML form + - name: "item$SubId" + in: path + required: true + description: 'SQ="; SBS=\; DBS=\\; SD=$some; CC=*/; TQ="""' + schema: + type: string + example: 'SQ="; SBS=\; DBS=\\; SD=$some; CC=*/; TQ="""' + + # $ in query param name, with default + - name: "filter$Type" + in: query + required: false + description: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + schema: + type: string + example: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + default: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + + # deprecated query param + - name: "filter$SubType" + in: query + required: false + deprecated: true + description: 'SQ="; SBS=\; DBS=\\; SD=$some; CC=*/; TQ="""' + schema: + type: string + example: 'SQ="; SBS=\; DBS=\\; SD=$some; CC=*/; TQ="""' + default: 'SQ="; SBS=\; DBS=\\; SD=$some; CC=*/; TQ="""' + + # $ in header param name + - name: "X-Custom$Header" + in: header + required: false + description: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + schema: + type: string + example: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + + # $ in cookie param name + - name: "session$Token" + in: cookie + required: false + description: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + schema: + type: string + example: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + + responses: + '200': + description: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + content: + application/json: + schema: + $ref: '#/components/schemas/ItemWithAllEscapingEdgeCases' + + # ── Issue 2: $ / " / \ in form body ─────────────────────────────────────── + /items: + post: + operationId: createItemWithDollarFormParams + summary: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + description: | + Multi-line description: + double-quote: " + single-backslash: \ + double-backslash: \\ + dollar-interpolation: $some + comment-closer: */ + comment-opener: /* + triple-quote: """ + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + form$Name: + type: string + description: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + example: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + form$Value: + type: string + description: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + example: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + default: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + responses: + '201': + description: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + content: + application/json: + schema: + $ref: '#/components/schemas/ItemWithAllEscapingEdgeCases' + +components: + schemas: + + # ── Issue 3: $ / " / \ in property names, descriptions, defaults, examples + ItemWithAllEscapingEdgeCases: + type: object + description: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + properties: + + # property name starts with $ + $id: + type: string + description: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + example: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + default: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + + # property name has $ in middle + name$Value: + type: string + description: 'SQ="; SBS=\; DBS=\\; SD=$some; CC=*/; TQ="""' + example: 'SQ="; SBS=\; DBS=\\; SD=$some; CC=*/; TQ="""' + default: 'SQ="; SBS=\; DBS=\\; SD=$some; CC=*/; TQ="""' + + # just backslashes (edge case: odd vs even number) + backslashValue: + type: string + description: "one-bs: \\; two-bs: \\\\" + example: "one-bs: \\; two-bs: \\\\" + default: "one-bs: \\; two-bs: \\\\" + + # just dollar signs + dollarValue: + type: string + description: "$one $$two $$$three" + example: "$one $$two $$$three" + default: "$one $$two $$$three" + + # comment-closing sequence (the escapeUnsafeCharacters bug) + commentCloseValue: + type: string + description: "starts /* comment and ends */" + example: "starts /* comment and ends */" + default: "starts /* comment and ends */" + + # triple-quote sequence (would break """ Kotlin strings) + tripleQuoteValue: + type: string + description: 'contains """ triple quotes' + example: 'contains """ triple quotes' + default: 'contains """ triple quotes' + + # multiline description (YAML literal block) + multilineDescription: + type: string + description: | + Line one with $dollar and "quote" and \backslash + Line two with */ comment-close and /* comment-open + Line three with """ triple-quote + example: "single line example" + + # integer with default (should not be quoted in output) + intWithDefault: + type: integer + format: int32 + description: "integer property, default should not be quoted" + default: 42 + + # boolean with default + boolWithDefault: + type: boolean + description: "boolean property" + default: false + + # nested object with $ properties + details$Info: + type: object + description: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + properties: + detail$One: + type: string + description: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + example: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + default: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some; CC=*/; TQ=\"\"\"" + detail$Two: + type: integer + description: "SQ=\"; SBS=\\; DBS=\\\\; SD=$some" + example: 42 diff --git a/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-kotlin-misk.yaml b/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-kotlin-misk.yaml new file mode 100644 index 000000000000..68a446b31aba --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-kotlin-misk.yaml @@ -0,0 +1,766 @@ +openapi: 3.0.0 +servers: + - url: 'http://petstore.swagger.io/v2' +info: + description: >- + This is a sample server Petstore server. For this sample, you can use the api key + `special-key` to test the authorization filters. + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /pet: + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + externalDocs: + url: "http://petstore.swagger.io/v2/doc/updatePet" + description: "API documentation for the updatePet operation" + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + deprecated: true + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - petstore_auth: + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - petstore_auth: + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /pet/escaping: + get: + tags: + - pet + operationId: getEscapingEdgeCases + summary: "Test escaping: $dollar, backslash \\ and quote \"" + description: "Retrieves edge-cases for escaping: $var, \\, \", */" + responses: + '200': + description: "Response with $dollar in message and backslash \\" + content: + application/json: + schema: + $ref: '#/components/schemas/EscapingEdgeCases' + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{orderId}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generate exceptions + operationId: getOrderById + parameters: + - name: orderId + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: orderId + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + security: + - api_key: [] + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + Set-Cookie: + description: >- + Cookie authentication key for use with the `api_key` + apiKey authentication. + schema: + type: string + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + security: + - api_key: [] + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + security: + - api_key: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - api_key: [] +externalDocs: + description: Find out more about Swagger + url: 'http://swagger.io' +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + schemas: + Order: + title: Pet Order + description: An order for a pets from the pet store + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + title: Pet category + description: A category for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + pattern: '^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$' + xml: + name: Category + User: + title: a User + description: A User who is purchasing from the pet store + type: object + properties: + id: + type: integer + format: int64 + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + title: Pet Tag + description: A tag for a pet + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + title: a Pet + description: A pet for sale in the pet store + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + deprecated: true + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + title: An uploaded response + description: Describes the result of uploading an image resource + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + EscapingEdgeCases: + type: object + description: "Schema to test: $dollar, backslash \\, quote \", comment-close */" + properties: + dollarDefault: + type: string + description: "A string whose default has $dollar, backslash \\, quote \" and comment-close */" + default: "hello $world, backslash=\\, quote=\", end */" + regularProp: + type: string + description: "Regular property for baseline comparison" \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore.yaml b/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore.yaml index a3800e235c08..0fefaba8954b 100644 --- a/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore.yaml @@ -822,3 +822,14 @@ components: - type: array items: type: string + PetWithSpecialProps: + type: object + description: "Model with $-prefixed property names for escaping tests (Issue 20502)" + properties: + $id: + type: string + description: "Property with $-prefix in name; default has $dollar and backslash \\" + default: "hello $world" + name$Suffix: + type: string + description: "Property with $ mid-name; description has backslash \\ and quote \"" diff --git a/samples/client/echo_api/kotlin-jvm-okhttp/.openapi-generator/FILES b/samples/client/echo_api/kotlin-jvm-okhttp/.openapi-generator/FILES index f94d2fba7db1..4280f869c94e 100644 --- a/samples/client/echo_api/kotlin-jvm-okhttp/.openapi-generator/FILES +++ b/samples/client/echo_api/kotlin-jvm-okhttp/.openapi-generator/FILES @@ -5,6 +5,7 @@ docs/Bird.md docs/BodyApi.md docs/Category.md docs/DefaultValue.md +docs/EchoApi.md docs/FormApi.md docs/HeaderApi.md docs/NumberPropertiesOnly.md @@ -13,6 +14,7 @@ docs/Pet.md docs/Query.md docs/QueryApi.md docs/StringEnumRef.md +docs/StringEscapingEdgeCases.md docs/Tag.md docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md gradle/wrapper/gradle-wrapper.jar @@ -22,6 +24,7 @@ gradlew.bat settings.gradle src/main/kotlin/org/openapitools/client/apis/AuthApi.kt src/main/kotlin/org/openapitools/client/apis/BodyApi.kt +src/main/kotlin/org/openapitools/client/apis/EchoApi.kt src/main/kotlin/org/openapitools/client/apis/FormApi.kt src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt src/main/kotlin/org/openapitools/client/apis/PathApi.kt @@ -50,5 +53,6 @@ src/main/kotlin/org/openapitools/client/models/ApiNumberPropertiesOnly.kt src/main/kotlin/org/openapitools/client/models/ApiPet.kt src/main/kotlin/org/openapitools/client/models/ApiQuery.kt src/main/kotlin/org/openapitools/client/models/ApiStringEnumRef.kt +src/main/kotlin/org/openapitools/client/models/ApiStringEscapingEdgeCases.kt src/main/kotlin/org/openapitools/client/models/ApiTag.kt src/main/kotlin/org/openapitools/client/models/ApiTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt diff --git a/samples/client/echo_api/kotlin-jvm-okhttp/README.md b/samples/client/echo_api/kotlin-jvm-okhttp/README.md index a29b68a2ad07..9f68bc7fd835 100644 --- a/samples/client/echo_api/kotlin-jvm-okhttp/README.md +++ b/samples/client/echo_api/kotlin-jvm-okhttp/README.md @@ -55,6 +55,7 @@ All URIs are relative to *http://localhost:3000* | *BodyApi* | [**testEchoBodyPet**](docs/BodyApi.md#testechobodypet) | **POST** /echo/body/Pet | Test body parameter(s) | | *BodyApi* | [**testEchoBodyPetResponseString**](docs/BodyApi.md#testechobodypetresponsestring) | **POST** /echo/body/Pet/response_string | Test empty response body | | *BodyApi* | [**testEchoBodyTagResponseString**](docs/BodyApi.md#testechobodytagresponsestring) | **POST** /echo/body/Tag/response_string | Test empty json (request body) | +| *EchoApi* | [**testsEchoStringEscapingParamName**](docs/EchoApi.md#testsechostringescapingparamname) | **GET** /echo/string-escaping/{$paramName} | Test $-in-path-param escaping | | *FormApi* | [**testFormIntegerBooleanString**](docs/FormApi.md#testformintegerbooleanstring) | **POST** /form/integer/boolean/string | Test form parameter(s) | | *FormApi* | [**testFormOneof**](docs/FormApi.md#testformoneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema | | *HeaderApi* | [**testHeaderIntegerBooleanStringEnums**](docs/HeaderApi.md#testheaderintegerbooleanstringenums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s) | @@ -77,6 +78,7 @@ All URIs are relative to *http://localhost:3000* - [org.openapitools.client.models.ApiPet](docs/ApiPet.md) - [org.openapitools.client.models.ApiQuery](docs/ApiQuery.md) - [org.openapitools.client.models.ApiStringEnumRef](docs/ApiStringEnumRef.md) + - [org.openapitools.client.models.ApiStringEscapingEdgeCases](docs/ApiStringEscapingEdgeCases.md) - [org.openapitools.client.models.ApiTag](docs/ApiTag.md) - [org.openapitools.client.models.ApiTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/ApiTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md) diff --git a/samples/client/echo_api/kotlin-jvm-okhttp/docs/EchoApi.md b/samples/client/echo_api/kotlin-jvm-okhttp/docs/EchoApi.md new file mode 100644 index 000000000000..99314ea19281 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-okhttp/docs/EchoApi.md @@ -0,0 +1,57 @@ +# EchoApi + +All URIs are relative to *http://localhost:3000* + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**testsEchoStringEscapingParamName**](EchoApi.md#testsEchoStringEscapingParamName) | **GET** /echo/string-escaping/{$paramName} | Test \$-in-path-param escaping | + + + +# **testsEchoStringEscapingParamName** +> kotlin.String testsEchoStringEscapingParamName(dollarParamName, filterDollarType) + +Test \$-in-path-param escaping + +Tests that path params with \$dollar, backslash \\ and quote " are properly escaped + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = EchoApi() +val dollarParamName : kotlin.String = dollarParamName_example // kotlin.String | +val filterDollarType : kotlin.String = filterDollarType_example // kotlin.String | Filter with $dollar in description and comment-close */ +try { + val result : kotlin.String = apiInstance.testsEchoStringEscapingParamName(dollarParamName, filterDollarType) + println(result) +} catch (e: ClientException) { + println("4xx response calling EchoApi#testsEchoStringEscapingParamName") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling EchoApi#testsEchoStringEscapingParamName") + e.printStackTrace() +} +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **dollarParamName** | **kotlin.String**| | | +| **filterDollarType** | **kotlin.String**| Filter with \$dollar in description and comment-close */ | [optional] [default to "default\$Value with \\\\ and \\""] | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + diff --git a/samples/client/echo_api/kotlin-jvm-okhttp/docs/FormApi.md b/samples/client/echo_api/kotlin-jvm-okhttp/docs/FormApi.md index 5d229c127758..79e5916a75f8 100644 --- a/samples/client/echo_api/kotlin-jvm-okhttp/docs/FormApi.md +++ b/samples/client/echo_api/kotlin-jvm-okhttp/docs/FormApi.md @@ -39,10 +39,10 @@ try { ``` ### Parameters -| **integerForm** | **kotlin.Int**| | [optional] | -| **booleanForm** | **kotlin.Boolean**| | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **integerForm** | **kotlin.Int**| | [optional] | +| **booleanForm** | **kotlin.Boolean**| | [optional] | | **stringForm** | **kotlin.String**| | [optional] | ### Return type @@ -92,13 +92,13 @@ try { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **form1** | **kotlin.String**| | [optional] | | **form2** | **kotlin.Int**| | [optional] | | **form3** | **kotlin.String**| | [optional] | | **form4** | **kotlin.Boolean**| | [optional] | | **id** | **kotlin.Long**| | [optional] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **name** | **kotlin.String**| | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-okhttp/docs/HeaderApi.md b/samples/client/echo_api/kotlin-jvm-okhttp/docs/HeaderApi.md index 0d48e224e7c7..86fcea88eab3 100644 --- a/samples/client/echo_api/kotlin-jvm-okhttp/docs/HeaderApi.md +++ b/samples/client/echo_api/kotlin-jvm-okhttp/docs/HeaderApi.md @@ -40,12 +40,12 @@ try { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **integerHeader** | **kotlin.Int**| | [optional] | | **booleanHeader** | **kotlin.Boolean**| | [optional] | | **stringHeader** | **kotlin.String**| | [optional] | | **enumNonrefStringHeader** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **enumRefStringHeader** | [**ApiStringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-okhttp/docs/PathApi.md b/samples/client/echo_api/kotlin-jvm-okhttp/docs/PathApi.md index e2445c0bc23a..355eeed26b0f 100644 --- a/samples/client/echo_api/kotlin-jvm-okhttp/docs/PathApi.md +++ b/samples/client/echo_api/kotlin-jvm-okhttp/docs/PathApi.md @@ -39,11 +39,11 @@ try { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **pathString** | **kotlin.String**| | | | **pathInteger** | **kotlin.Int**| | | | **enumNonrefStringPath** | **kotlin.String**| | [enum: success, failure, unclassified] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **enumRefStringPath** | [**ApiStringEnumRef**](.md)| | [enum: success, failure, unclassified] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-okhttp/docs/QueryApi.md b/samples/client/echo_api/kotlin-jvm-okhttp/docs/QueryApi.md index 20b2a4d282a7..e816f6c18a1a 100644 --- a/samples/client/echo_api/kotlin-jvm-okhttp/docs/QueryApi.md +++ b/samples/client/echo_api/kotlin-jvm-okhttp/docs/QueryApi.md @@ -42,9 +42,9 @@ try { ``` ### Parameters -| **enumNonrefStringQuery** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **enumNonrefStringQuery** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | | **enumRefStringQuery** | [**ApiStringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] | ### Return type @@ -91,10 +91,10 @@ try { ``` ### Parameters -| **datetimeQuery** | **java.time.OffsetDateTime**| | [optional] | -| **dateQuery** | **java.time.LocalDate**| | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **datetimeQuery** | **java.time.OffsetDateTime**| | [optional] | +| **dateQuery** | **java.time.LocalDate**| | [optional] | | **stringQuery** | **kotlin.String**| | [optional] | ### Return type @@ -141,10 +141,10 @@ try { ``` ### Parameters -| **integerQuery** | **kotlin.Int**| | [optional] | -| **booleanQuery** | **kotlin.Boolean**| | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **integerQuery** | **kotlin.Int**| | [optional] | +| **booleanQuery** | **kotlin.Boolean**| | [optional] | | **stringQuery** | **kotlin.String**| | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-okhttp/docs/StringEscapingEdgeCases.md b/samples/client/echo_api/kotlin-jvm-okhttp/docs/StringEscapingEdgeCases.md new file mode 100644 index 000000000000..e49f8e50da00 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-okhttp/docs/StringEscapingEdgeCases.md @@ -0,0 +1,11 @@ + +# ApiStringEscapingEdgeCases + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **dollarDefault** | **kotlin.String** | A string whose default has \$dollar, backslash \\, quote " and comment-close */ | [optional] | +| **regularProp** | **kotlin.String** | Regular property for baseline comparison | [optional] | + + + diff --git a/samples/client/echo_api/kotlin-jvm-okhttp/src/main/kotlin/org/openapitools/client/apis/EchoApi.kt b/samples/client/echo_api/kotlin-jvm-okhttp/src/main/kotlin/org/openapitools/client/apis/EchoApi.kt new file mode 100644 index 000000000000..5058e0f5ca7f --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-okhttp/src/main/kotlin/org/openapitools/client/apis/EchoApi.kt @@ -0,0 +1,139 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.apis + +import java.io.IOException +import okhttp3.Call +import okhttp3.HttpUrl + + +import com.squareup.moshi.Json + +import org.openapitools.client.infrastructure.ApiClient +import org.openapitools.client.infrastructure.ApiResponse +import org.openapitools.client.infrastructure.ClientException +import org.openapitools.client.infrastructure.ClientError +import org.openapitools.client.infrastructure.ServerException +import org.openapitools.client.infrastructure.ServerError +import org.openapitools.client.infrastructure.MultiValueMap +import org.openapitools.client.infrastructure.PartConfig +import org.openapitools.client.infrastructure.RequestConfig +import org.openapitools.client.infrastructure.RequestMethod +import org.openapitools.client.infrastructure.ResponseType +import org.openapitools.client.infrastructure.Success +import org.openapitools.client.infrastructure.toMultiValue + +open class EchoApi(basePath: kotlin.String = defaultBasePath, client: Call.Factory = ApiClient.defaultClient) : ApiClient(basePath, client) { + companion object { + @JvmStatic + val defaultBasePath: String by lazy { + System.getProperties().getProperty(ApiClient.BASE_URL_KEY, "http://localhost:3000") + } + } + + /** + * GET /echo/string-escaping/{$paramName} + * Test $-in-path-param escaping + * Tests that path params with $dollar, backslash \\ and quote \" are properly escaped + * @param dollarParamName + * @param filterDollarType Filter with $dollar in description and comment-close *_/ (optional, default to "default$Value with \\ and \"") + * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + * @throws UnsupportedOperationException If the API returns an informational or redirection response + * @throws ClientException If the API returns a client error response + * @throws ServerException If the API returns a server error response + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) + fun testsEchoStringEscapingParamName(dollarParamName: kotlin.String, filterDollarType: kotlin.String? = "default\$Value with \\ and \"") : kotlin.String { + val localVarResponse = testsEchoStringEscapingParamNameWithHttpInfo(dollarParamName = dollarParamName, filterDollarType = filterDollarType) + + return when (localVarResponse.responseType) { + ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String + ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") + ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") + ResponseType.ClientError -> { + val localVarError = localVarResponse as ClientError<*> + throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) + } + ResponseType.ServerError -> { + val localVarError = localVarResponse as ServerError<*> + throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()} ${localVarError.body}", localVarError.statusCode, localVarResponse) + } + } + } + + /** + * GET /echo/string-escaping/{$paramName} + * Test $-in-path-param escaping + * Tests that path params with $dollar, backslash \\ and quote \" are properly escaped + * @param dollarParamName + * @param filterDollarType Filter with $dollar in description and comment-close *_/ (optional, default to "default$Value with \\ and \"") + * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception + */ + @Suppress("UNCHECKED_CAST") + @Throws(IllegalStateException::class, IOException::class) + fun testsEchoStringEscapingParamNameWithHttpInfo(dollarParamName: kotlin.String, filterDollarType: kotlin.String?) : ApiResponse { + val localVariableConfig = testsEchoStringEscapingParamNameRequestConfig(dollarParamName = dollarParamName, filterDollarType = filterDollarType) + + return request( + localVariableConfig + ) + } + + /** + * To obtain the request config of the operation testsEchoStringEscapingParamName + * + * @param dollarParamName + * @param filterDollarType Filter with $dollar in description and comment-close *_/ (optional, default to "default$Value with \\ and \"") + * @return RequestConfig + */ + fun testsEchoStringEscapingParamNameRequestConfig(dollarParamName: kotlin.String, filterDollarType: kotlin.String?) : RequestConfig { + val localVariableBody = null + val localVariableQuery: MultiValueMap = mutableMapOf>() + .apply { + if (filterDollarType != null) { + put("filter\$Type", listOf(filterDollarType.toString())) + } + } + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "text/plain" + + return RequestConfig( + method = RequestMethod.GET, + path = "/echo/string-escaping/{\$paramName}".replace("{"+"\$paramName"+"}", encodeURIComponent(dollarParamName.toString())), + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + + + private fun encodeURIComponent(uriComponent: kotlin.String): kotlin.String = + HttpUrl.Builder().scheme("http").host("localhost").addPathSegment(uriComponent).build().encodedPathSegments[0] +} diff --git a/samples/client/echo_api/kotlin-jvm-okhttp/src/main/kotlin/org/openapitools/client/models/ApiStringEscapingEdgeCases.kt b/samples/client/echo_api/kotlin-jvm-okhttp/src/main/kotlin/org/openapitools/client/models/ApiStringEscapingEdgeCases.kt new file mode 100644 index 000000000000..5709b8170d2a --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-okhttp/src/main/kotlin/org/openapitools/client/models/ApiStringEscapingEdgeCases.kt @@ -0,0 +1,52 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.models + + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +/** + * Model to test: $dollar, backslash \\, quote \", comment-close *_/ + * + * @param dollarDefault A string whose default has $dollar, backslash \\, quote \" and comment-close *_/ + * @param regularProp Regular property for baseline comparison + */ + + +data class ApiStringEscapingEdgeCases ( + + /* A string whose default has $dollar, backslash \\, quote \" and comment-close *_/ */ + @Json(name = "dollarDefault") + val dollarDefault: kotlin.String? = "hello \$world, backslash=\\, quote=\", end */", + + /* Regular property for baseline comparison */ + @Json(name = "regularProp") + val regularProp: kotlin.String? = null + +) { + + +} + diff --git a/samples/client/echo_api/kotlin-jvm-okhttp/src/test/kotlin/org/openapitools/client/apis/EchoApiTest.kt b/samples/client/echo_api/kotlin-jvm-okhttp/src/test/kotlin/org/openapitools/client/apis/EchoApiTest.kt new file mode 100644 index 000000000000..f0f08d55a94b --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-okhttp/src/test/kotlin/org/openapitools/client/apis/EchoApiTest.kt @@ -0,0 +1,46 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.apis + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.apis.EchoApi + +class EchoApiTest : ShouldSpec() { + init { + // uncomment below to create an instance of EchoApi + //val apiInstance = EchoApi() + + // to test testsEchoStringEscapingParamName + should("test testsEchoStringEscapingParamName") { + // uncomment below to test testsEchoStringEscapingParamName + //val dollarParamName : kotlin.String = dollarParamName_example // kotlin.String | + //val filterDollarType : kotlin.String = filterDollarType_example // kotlin.String | Filter with $dollar in description and comment-close *_/ + //val result : kotlin.String = apiInstance.testsEchoStringEscapingParamName(dollarParamName, filterDollarType) + //result shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-okhttp/src/test/kotlin/org/openapitools/client/models/StringEscapingEdgeCasesTest.kt b/samples/client/echo_api/kotlin-jvm-okhttp/src/test/kotlin/org/openapitools/client/models/StringEscapingEdgeCasesTest.kt new file mode 100644 index 000000000000..6cfaf10ce897 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-okhttp/src/test/kotlin/org/openapitools/client/models/StringEscapingEdgeCasesTest.kt @@ -0,0 +1,49 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.ApiStringEscapingEdgeCases + +class ApiStringEscapingEdgeCasesTest : ShouldSpec() { + init { + // uncomment below to create an instance of ApiStringEscapingEdgeCases + //val modelInstance = ApiStringEscapingEdgeCases() + + // to test the property `dollarDefault` - A string whose default has $dollar, backslash \\, quote \" and comment-close *_/ + should("test dollarDefault") { + // uncomment below to test the property + //modelInstance.dollarDefault shouldBe ("TODO") + } + + // to test the property `regularProp` - Regular property for baseline comparison + should("test regularProp") { + // uncomment below to test the property + //modelInstance.regularProp shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/.openapi-generator/FILES b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/.openapi-generator/FILES index 4d6a5844ccea..6df32f7ebb42 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/.openapi-generator/FILES +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/.openapi-generator/FILES @@ -5,6 +5,7 @@ docs/Bird.md docs/BodyApi.md docs/Category.md docs/DefaultValue.md +docs/EchoApi.md docs/FormApi.md docs/HeaderApi.md docs/NumberPropertiesOnly.md @@ -13,6 +14,7 @@ docs/Pet.md docs/Query.md docs/QueryApi.md docs/StringEnumRef.md +docs/StringEscapingEdgeCases.md docs/Tag.md docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md gradle/wrapper/gradle-wrapper.jar @@ -22,6 +24,7 @@ gradlew.bat settings.gradle src/main/kotlin/org/openapitools/client/apis/AuthApi.kt src/main/kotlin/org/openapitools/client/apis/BodyApi.kt +src/main/kotlin/org/openapitools/client/apis/EchoApi.kt src/main/kotlin/org/openapitools/client/apis/FormApi.kt src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt src/main/kotlin/org/openapitools/client/apis/PathApi.kt @@ -39,5 +42,6 @@ src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Query.kt src/main/kotlin/org/openapitools/client/models/StringEnumRef.kt +src/main/kotlin/org/openapitools/client/models/StringEscapingEdgeCases.kt src/main/kotlin/org/openapitools/client/models/Tag.kt src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/README.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/README.md index 90764f9ce373..410680801bff 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/README.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/README.md @@ -55,6 +55,7 @@ All URIs are relative to *http://localhost:3000* | *BodyApi* | [**testEchoBodyPet**](docs/BodyApi.md#testechobodypet) | **POST** /echo/body/Pet | Test body parameter(s) | | *BodyApi* | [**testEchoBodyPetResponseString**](docs/BodyApi.md#testechobodypetresponsestring) | **POST** /echo/body/Pet/response_string | Test empty response body | | *BodyApi* | [**testEchoBodyTagResponseString**](docs/BodyApi.md#testechobodytagresponsestring) | **POST** /echo/body/Tag/response_string | Test empty json (request body) | +| *EchoApi* | [**testsEchoStringEscapingParamName**](docs/EchoApi.md#testsechostringescapingparamname) | **GET** /echo/string-escaping/{$paramName} | Test $-in-path-param escaping | | *FormApi* | [**testFormIntegerBooleanString**](docs/FormApi.md#testformintegerbooleanstring) | **POST** /form/integer/boolean/string | Test form parameter(s) | | *FormApi* | [**testFormOneof**](docs/FormApi.md#testformoneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema | | *HeaderApi* | [**testHeaderIntegerBooleanStringEnums**](docs/HeaderApi.md#testheaderintegerbooleanstringenums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s) | @@ -77,6 +78,7 @@ All URIs are relative to *http://localhost:3000* - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Query](docs/Query.md) - [org.openapitools.client.models.StringEnumRef](docs/StringEnumRef.md) + - [org.openapitools.client.models.StringEscapingEdgeCases](docs/StringEscapingEdgeCases.md) - [org.openapitools.client.models.Tag](docs/Tag.md) - [org.openapitools.client.models.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md) diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/EchoApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/EchoApi.md new file mode 100644 index 000000000000..99314ea19281 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/EchoApi.md @@ -0,0 +1,57 @@ +# EchoApi + +All URIs are relative to *http://localhost:3000* + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**testsEchoStringEscapingParamName**](EchoApi.md#testsEchoStringEscapingParamName) | **GET** /echo/string-escaping/{$paramName} | Test \$-in-path-param escaping | + + + +# **testsEchoStringEscapingParamName** +> kotlin.String testsEchoStringEscapingParamName(dollarParamName, filterDollarType) + +Test \$-in-path-param escaping + +Tests that path params with \$dollar, backslash \\ and quote " are properly escaped + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = EchoApi() +val dollarParamName : kotlin.String = dollarParamName_example // kotlin.String | +val filterDollarType : kotlin.String = filterDollarType_example // kotlin.String | Filter with $dollar in description and comment-close */ +try { + val result : kotlin.String = apiInstance.testsEchoStringEscapingParamName(dollarParamName, filterDollarType) + println(result) +} catch (e: ClientException) { + println("4xx response calling EchoApi#testsEchoStringEscapingParamName") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling EchoApi#testsEchoStringEscapingParamName") + e.printStackTrace() +} +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **dollarParamName** | **kotlin.String**| | | +| **filterDollarType** | **kotlin.String**| Filter with \$dollar in description and comment-close */ | [optional] [default to "default\$Value with \\\\ and \\""] | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/FormApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/FormApi.md index 5d229c127758..79e5916a75f8 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/FormApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/FormApi.md @@ -39,10 +39,10 @@ try { ``` ### Parameters -| **integerForm** | **kotlin.Int**| | [optional] | -| **booleanForm** | **kotlin.Boolean**| | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **integerForm** | **kotlin.Int**| | [optional] | +| **booleanForm** | **kotlin.Boolean**| | [optional] | | **stringForm** | **kotlin.String**| | [optional] | ### Return type @@ -92,13 +92,13 @@ try { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **form1** | **kotlin.String**| | [optional] | | **form2** | **kotlin.Int**| | [optional] | | **form3** | **kotlin.String**| | [optional] | | **form4** | **kotlin.Boolean**| | [optional] | | **id** | **kotlin.Long**| | [optional] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **name** | **kotlin.String**| | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/HeaderApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/HeaderApi.md index 8a1687ff9901..b8dd0f382c12 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/HeaderApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/HeaderApi.md @@ -40,12 +40,12 @@ try { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **integerHeader** | **kotlin.Int**| | [optional] | | **booleanHeader** | **kotlin.Boolean**| | [optional] | | **stringHeader** | **kotlin.String**| | [optional] | | **enumNonrefStringHeader** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **enumRefStringHeader** | [**StringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/PathApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/PathApi.md index d2e44d75aba6..8c5cbcbbec16 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/PathApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/PathApi.md @@ -39,11 +39,11 @@ try { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **pathString** | **kotlin.String**| | | | **pathInteger** | **kotlin.Int**| | | | **enumNonrefStringPath** | **kotlin.String**| | [enum: success, failure, unclassified] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **enumRefStringPath** | [**StringEnumRef**](.md)| | [enum: success, failure, unclassified] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/QueryApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/QueryApi.md index 3ac1823f5d70..1d29efac53f9 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/QueryApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/QueryApi.md @@ -42,9 +42,9 @@ try { ``` ### Parameters -| **enumNonrefStringQuery** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **enumNonrefStringQuery** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | | **enumRefStringQuery** | [**StringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] | ### Return type @@ -91,10 +91,10 @@ try { ``` ### Parameters -| **datetimeQuery** | **java.time.OffsetDateTime**| | [optional] | -| **dateQuery** | **java.time.LocalDate**| | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **datetimeQuery** | **java.time.OffsetDateTime**| | [optional] | +| **dateQuery** | **java.time.LocalDate**| | [optional] | | **stringQuery** | **kotlin.String**| | [optional] | ### Return type @@ -141,10 +141,10 @@ try { ``` ### Parameters -| **integerQuery** | **kotlin.Int**| | [optional] | -| **booleanQuery** | **kotlin.Boolean**| | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **integerQuery** | **kotlin.Int**| | [optional] | +| **booleanQuery** | **kotlin.Boolean**| | [optional] | | **stringQuery** | **kotlin.String**| | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/StringEscapingEdgeCases.md b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/StringEscapingEdgeCases.md new file mode 100644 index 000000000000..b65c95da692d --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/docs/StringEscapingEdgeCases.md @@ -0,0 +1,11 @@ + +# StringEscapingEdgeCases + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **dollarDefault** | **kotlin.String** | A string whose default has \$dollar, backslash \\, quote " and comment-close */ | [optional] | +| **regularProp** | **kotlin.String** | Regular property for baseline comparison | [optional] | + + + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/EchoApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/EchoApi.kt new file mode 100644 index 000000000000..0cb8df76916d --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/EchoApi.kt @@ -0,0 +1,87 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.apis + +import com.fasterxml.jackson.annotation.JsonProperty + +import org.springframework.web.client.RestClient +import org.springframework.web.client.RestClientResponseException + +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter +import org.springframework.http.ResponseEntity +import org.springframework.http.MediaType + + +import org.openapitools.client.infrastructure.* + +open class EchoApi(client: RestClient) : ApiClient(client) { + + constructor(baseUrl: String) : this(RestClient.builder() + .baseUrl(baseUrl) + .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .build() + ) + + + @Throws(RestClientResponseException::class) + fun testsEchoStringEscapingParamName(dollarParamName: kotlin.String, filterDollarType: kotlin.String? = "default\$Value with \\ and \""): kotlin.String { + val result = testsEchoStringEscapingParamNameWithHttpInfo(dollarParamName = dollarParamName, filterDollarType = filterDollarType) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testsEchoStringEscapingParamNameWithHttpInfo(dollarParamName: kotlin.String, filterDollarType: kotlin.String? = "default\$Value with \\ and \""): ResponseEntity { + val localVariableConfig = testsEchoStringEscapingParamNameRequestConfig(dollarParamName = dollarParamName, filterDollarType = filterDollarType) + return request( + localVariableConfig + ) + } + + fun testsEchoStringEscapingParamNameRequestConfig(dollarParamName: kotlin.String, filterDollarType: kotlin.String? = "default\$Value with \\ and \"") : RequestConfig { + val localVariableBody = null + val localVariableQuery = mutableMapOf>() + .apply { + if (filterDollarType != null) { + put("filter\$Type", listOf(filterDollarType.toString())) + } + } + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + "\$paramName" to dollarParamName, + ) + + return RequestConfig( + method = RequestMethod.GET, + path = "/echo/string-escaping/{\$paramName}", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/StringEscapingEdgeCases.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/StringEscapingEdgeCases.kt new file mode 100644 index 000000000000..05ee371d5913 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/models/StringEscapingEdgeCases.kt @@ -0,0 +1,52 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonEnumDefaultValue +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * Model to test: $dollar, backslash \\, quote \", comment-close *_/ + * + * @param dollarDefault A string whose default has $dollar, backslash \\, quote \" and comment-close *_/ + * @param regularProp Regular property for baseline comparison + */ + + +data class StringEscapingEdgeCases ( + + /* A string whose default has $dollar, backslash \\, quote \" and comment-close *_/ */ + @get:JsonProperty("dollarDefault") + val dollarDefault: kotlin.String? = "hello \$world, backslash=\\, quote=\", end */", + + /* Regular property for baseline comparison */ + @get:JsonProperty("regularProp") + val regularProp: kotlin.String? = null + +) { + + +} + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/test/kotlin/org/openapitools/client/apis/EchoApiTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/test/kotlin/org/openapitools/client/apis/EchoApiTest.kt new file mode 100644 index 000000000000..f0f08d55a94b --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/test/kotlin/org/openapitools/client/apis/EchoApiTest.kt @@ -0,0 +1,46 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.apis + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.apis.EchoApi + +class EchoApiTest : ShouldSpec() { + init { + // uncomment below to create an instance of EchoApi + //val apiInstance = EchoApi() + + // to test testsEchoStringEscapingParamName + should("test testsEchoStringEscapingParamName") { + // uncomment below to test testsEchoStringEscapingParamName + //val dollarParamName : kotlin.String = dollarParamName_example // kotlin.String | + //val filterDollarType : kotlin.String = filterDollarType_example // kotlin.String | Filter with $dollar in description and comment-close *_/ + //val result : kotlin.String = apiInstance.testsEchoStringEscapingParamName(dollarParamName, filterDollarType) + //result shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/test/kotlin/org/openapitools/client/models/StringEscapingEdgeCasesTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/test/kotlin/org/openapitools/client/models/StringEscapingEdgeCasesTest.kt new file mode 100644 index 000000000000..40a3db7282e1 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/test/kotlin/org/openapitools/client/models/StringEscapingEdgeCasesTest.kt @@ -0,0 +1,49 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.StringEscapingEdgeCases + +class StringEscapingEdgeCasesTest : ShouldSpec() { + init { + // uncomment below to create an instance of StringEscapingEdgeCases + //val modelInstance = StringEscapingEdgeCases() + + // to test the property `dollarDefault` - A string whose default has $dollar, backslash \\, quote \" and comment-close *_/ + should("test dollarDefault") { + // uncomment below to test the property + //modelInstance.dollarDefault shouldBe ("TODO") + } + + // to test the property `regularProp` - Regular property for baseline comparison + should("test regularProp") { + // uncomment below to test the property + //modelInstance.regularProp shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/.openapi-generator/FILES b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/.openapi-generator/FILES index 4d6a5844ccea..6df32f7ebb42 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/.openapi-generator/FILES +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/.openapi-generator/FILES @@ -5,6 +5,7 @@ docs/Bird.md docs/BodyApi.md docs/Category.md docs/DefaultValue.md +docs/EchoApi.md docs/FormApi.md docs/HeaderApi.md docs/NumberPropertiesOnly.md @@ -13,6 +14,7 @@ docs/Pet.md docs/Query.md docs/QueryApi.md docs/StringEnumRef.md +docs/StringEscapingEdgeCases.md docs/Tag.md docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md gradle/wrapper/gradle-wrapper.jar @@ -22,6 +24,7 @@ gradlew.bat settings.gradle src/main/kotlin/org/openapitools/client/apis/AuthApi.kt src/main/kotlin/org/openapitools/client/apis/BodyApi.kt +src/main/kotlin/org/openapitools/client/apis/EchoApi.kt src/main/kotlin/org/openapitools/client/apis/FormApi.kt src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt src/main/kotlin/org/openapitools/client/apis/PathApi.kt @@ -39,5 +42,6 @@ src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Query.kt src/main/kotlin/org/openapitools/client/models/StringEnumRef.kt +src/main/kotlin/org/openapitools/client/models/StringEscapingEdgeCases.kt src/main/kotlin/org/openapitools/client/models/Tag.kt src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/README.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/README.md index 90764f9ce373..410680801bff 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/README.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/README.md @@ -55,6 +55,7 @@ All URIs are relative to *http://localhost:3000* | *BodyApi* | [**testEchoBodyPet**](docs/BodyApi.md#testechobodypet) | **POST** /echo/body/Pet | Test body parameter(s) | | *BodyApi* | [**testEchoBodyPetResponseString**](docs/BodyApi.md#testechobodypetresponsestring) | **POST** /echo/body/Pet/response_string | Test empty response body | | *BodyApi* | [**testEchoBodyTagResponseString**](docs/BodyApi.md#testechobodytagresponsestring) | **POST** /echo/body/Tag/response_string | Test empty json (request body) | +| *EchoApi* | [**testsEchoStringEscapingParamName**](docs/EchoApi.md#testsechostringescapingparamname) | **GET** /echo/string-escaping/{$paramName} | Test $-in-path-param escaping | | *FormApi* | [**testFormIntegerBooleanString**](docs/FormApi.md#testformintegerbooleanstring) | **POST** /form/integer/boolean/string | Test form parameter(s) | | *FormApi* | [**testFormOneof**](docs/FormApi.md#testformoneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema | | *HeaderApi* | [**testHeaderIntegerBooleanStringEnums**](docs/HeaderApi.md#testheaderintegerbooleanstringenums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s) | @@ -77,6 +78,7 @@ All URIs are relative to *http://localhost:3000* - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Query](docs/Query.md) - [org.openapitools.client.models.StringEnumRef](docs/StringEnumRef.md) + - [org.openapitools.client.models.StringEscapingEdgeCases](docs/StringEscapingEdgeCases.md) - [org.openapitools.client.models.Tag](docs/Tag.md) - [org.openapitools.client.models.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md) diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/EchoApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/EchoApi.md new file mode 100644 index 000000000000..99314ea19281 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/EchoApi.md @@ -0,0 +1,57 @@ +# EchoApi + +All URIs are relative to *http://localhost:3000* + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**testsEchoStringEscapingParamName**](EchoApi.md#testsEchoStringEscapingParamName) | **GET** /echo/string-escaping/{$paramName} | Test \$-in-path-param escaping | + + + +# **testsEchoStringEscapingParamName** +> kotlin.String testsEchoStringEscapingParamName(dollarParamName, filterDollarType) + +Test \$-in-path-param escaping + +Tests that path params with \$dollar, backslash \\ and quote " are properly escaped + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = EchoApi() +val dollarParamName : kotlin.String = dollarParamName_example // kotlin.String | +val filterDollarType : kotlin.String = filterDollarType_example // kotlin.String | Filter with $dollar in description and comment-close */ +try { + val result : kotlin.String = apiInstance.testsEchoStringEscapingParamName(dollarParamName, filterDollarType) + println(result) +} catch (e: ClientException) { + println("4xx response calling EchoApi#testsEchoStringEscapingParamName") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling EchoApi#testsEchoStringEscapingParamName") + e.printStackTrace() +} +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **dollarParamName** | **kotlin.String**| | | +| **filterDollarType** | **kotlin.String**| Filter with \$dollar in description and comment-close */ | [optional] [default to "default\$Value with \\\\ and \\""] | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/FormApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/FormApi.md index 5d229c127758..79e5916a75f8 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/FormApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/FormApi.md @@ -39,10 +39,10 @@ try { ``` ### Parameters -| **integerForm** | **kotlin.Int**| | [optional] | -| **booleanForm** | **kotlin.Boolean**| | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **integerForm** | **kotlin.Int**| | [optional] | +| **booleanForm** | **kotlin.Boolean**| | [optional] | | **stringForm** | **kotlin.String**| | [optional] | ### Return type @@ -92,13 +92,13 @@ try { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **form1** | **kotlin.String**| | [optional] | | **form2** | **kotlin.Int**| | [optional] | | **form3** | **kotlin.String**| | [optional] | | **form4** | **kotlin.Boolean**| | [optional] | | **id** | **kotlin.Long**| | [optional] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **name** | **kotlin.String**| | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/HeaderApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/HeaderApi.md index 8a1687ff9901..b8dd0f382c12 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/HeaderApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/HeaderApi.md @@ -40,12 +40,12 @@ try { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **integerHeader** | **kotlin.Int**| | [optional] | | **booleanHeader** | **kotlin.Boolean**| | [optional] | | **stringHeader** | **kotlin.String**| | [optional] | | **enumNonrefStringHeader** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **enumRefStringHeader** | [**StringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/PathApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/PathApi.md index d2e44d75aba6..8c5cbcbbec16 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/PathApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/PathApi.md @@ -39,11 +39,11 @@ try { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **pathString** | **kotlin.String**| | | | **pathInteger** | **kotlin.Int**| | | | **enumNonrefStringPath** | **kotlin.String**| | [enum: success, failure, unclassified] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **enumRefStringPath** | [**StringEnumRef**](.md)| | [enum: success, failure, unclassified] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/QueryApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/QueryApi.md index 3ac1823f5d70..1d29efac53f9 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/QueryApi.md +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/QueryApi.md @@ -42,9 +42,9 @@ try { ``` ### Parameters -| **enumNonrefStringQuery** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **enumNonrefStringQuery** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | | **enumRefStringQuery** | [**StringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] | ### Return type @@ -91,10 +91,10 @@ try { ``` ### Parameters -| **datetimeQuery** | **java.time.OffsetDateTime**| | [optional] | -| **dateQuery** | **java.time.LocalDate**| | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **datetimeQuery** | **java.time.OffsetDateTime**| | [optional] | +| **dateQuery** | **java.time.LocalDate**| | [optional] | | **stringQuery** | **kotlin.String**| | [optional] | ### Return type @@ -141,10 +141,10 @@ try { ``` ### Parameters -| **integerQuery** | **kotlin.Int**| | [optional] | -| **booleanQuery** | **kotlin.Boolean**| | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **integerQuery** | **kotlin.Int**| | [optional] | +| **booleanQuery** | **kotlin.Boolean**| | [optional] | | **stringQuery** | **kotlin.String**| | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/StringEscapingEdgeCases.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/StringEscapingEdgeCases.md new file mode 100644 index 000000000000..b65c95da692d --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/StringEscapingEdgeCases.md @@ -0,0 +1,11 @@ + +# StringEscapingEdgeCases + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **dollarDefault** | **kotlin.String** | A string whose default has \$dollar, backslash \\, quote " and comment-close */ | [optional] | +| **regularProp** | **kotlin.String** | Regular property for baseline comparison | [optional] | + + + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/EchoApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/EchoApi.kt new file mode 100644 index 000000000000..18ef83e11f13 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/EchoApi.kt @@ -0,0 +1,91 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.apis + +import com.fasterxml.jackson.annotation.JsonProperty + +import org.springframework.web.reactive.function.client.WebClient +import org.springframework.web.reactive.function.client.WebClientResponseException +import org.springframework.http.codec.json.Jackson2JsonDecoder +import org.springframework.http.codec.json.Jackson2JsonEncoder +import org.springframework.http.ResponseEntity +import org.springframework.http.MediaType +import reactor.core.publisher.Mono +import org.springframework.util.LinkedMultiValueMap + +import org.openapitools.client.infrastructure.* + +open class EchoApi(client: WebClient) : ApiClient(client) { + + constructor(baseUrl: String) : this(WebClient.builder() + .baseUrl(baseUrl) + .codecs { + it.defaultCodecs().jackson2JsonEncoder(Jackson2JsonEncoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + it.defaultCodecs().jackson2JsonDecoder(Jackson2JsonDecoder(Serializer.jacksonObjectMapper, MediaType.APPLICATION_JSON)) + } + .build() + ) + + + @Throws(WebClientResponseException::class) + fun testsEchoStringEscapingParamName(dollarParamName: kotlin.String, filterDollarType: kotlin.String? = "default\$Value with \\ and \""): Mono { + return testsEchoStringEscapingParamNameWithHttpInfo(dollarParamName = dollarParamName, filterDollarType = filterDollarType) + .map { it.body!! } + } + + @Throws(WebClientResponseException::class) + fun testsEchoStringEscapingParamNameWithHttpInfo(dollarParamName: kotlin.String, filterDollarType: kotlin.String? = "default\$Value with \\ and \""): Mono> { + val localVariableConfig = testsEchoStringEscapingParamNameRequestConfig(dollarParamName = dollarParamName, filterDollarType = filterDollarType) + return request( + localVariableConfig + ) + } + + fun testsEchoStringEscapingParamNameRequestConfig(dollarParamName: kotlin.String, filterDollarType: kotlin.String? = "default\$Value with \\ and \"") : RequestConfig { + val localVariableBody = null + val localVariableQuery = mutableMapOf>() + .apply { + if (filterDollarType != null) { + put("filter\$Type", listOf(filterDollarType.toString())) + } + } + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + "\$paramName" to dollarParamName, + ) + + return RequestConfig( + method = RequestMethod.GET, + path = "/echo/string-escaping/{\$paramName}", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/StringEscapingEdgeCases.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/StringEscapingEdgeCases.kt new file mode 100644 index 000000000000..05ee371d5913 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/StringEscapingEdgeCases.kt @@ -0,0 +1,52 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonEnumDefaultValue +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * Model to test: $dollar, backslash \\, quote \", comment-close *_/ + * + * @param dollarDefault A string whose default has $dollar, backslash \\, quote \" and comment-close *_/ + * @param regularProp Regular property for baseline comparison + */ + + +data class StringEscapingEdgeCases ( + + /* A string whose default has $dollar, backslash \\, quote \" and comment-close *_/ */ + @get:JsonProperty("dollarDefault") + val dollarDefault: kotlin.String? = "hello \$world, backslash=\\, quote=\", end */", + + /* Regular property for baseline comparison */ + @get:JsonProperty("regularProp") + val regularProp: kotlin.String? = null + +) { + + +} + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/EchoApiTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/EchoApiTest.kt new file mode 100644 index 000000000000..f0f08d55a94b --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/EchoApiTest.kt @@ -0,0 +1,46 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.apis + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.apis.EchoApi + +class EchoApiTest : ShouldSpec() { + init { + // uncomment below to create an instance of EchoApi + //val apiInstance = EchoApi() + + // to test testsEchoStringEscapingParamName + should("test testsEchoStringEscapingParamName") { + // uncomment below to test testsEchoStringEscapingParamName + //val dollarParamName : kotlin.String = dollarParamName_example // kotlin.String | + //val filterDollarType : kotlin.String = filterDollarType_example // kotlin.String | Filter with $dollar in description and comment-close *_/ + //val result : kotlin.String = apiInstance.testsEchoStringEscapingParamName(dollarParamName, filterDollarType) + //result shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/StringEscapingEdgeCasesTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/StringEscapingEdgeCasesTest.kt new file mode 100644 index 000000000000..40a3db7282e1 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/StringEscapingEdgeCasesTest.kt @@ -0,0 +1,49 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.StringEscapingEdgeCases + +class StringEscapingEdgeCasesTest : ShouldSpec() { + init { + // uncomment below to create an instance of StringEscapingEdgeCases + //val modelInstance = StringEscapingEdgeCases() + + // to test the property `dollarDefault` - A string whose default has $dollar, backslash \\, quote \" and comment-close *_/ + should("test dollarDefault") { + // uncomment below to test the property + //modelInstance.dollarDefault shouldBe ("TODO") + } + + // to test the property `regularProp` - Regular property for baseline comparison + should("test regularProp") { + // uncomment below to test the property + //modelInstance.regularProp shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/.openapi-generator/FILES b/samples/client/echo_api/kotlin-model-prefix-type-mappings/.openapi-generator/FILES index f0ac80519da4..145e6840cf19 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/.openapi-generator/FILES +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/.openapi-generator/FILES @@ -5,6 +5,7 @@ docs/Bird.md docs/BodyApi.md docs/Category.md docs/DefaultValue.md +docs/EchoApi.md docs/FormApi.md docs/HeaderApi.md docs/NumberPropertiesOnly.md @@ -13,6 +14,7 @@ docs/Pet.md docs/Query.md docs/QueryApi.md docs/StringEnumRef.md +docs/StringEscapingEdgeCases.md docs/Tag.md docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md gradle/wrapper/gradle-wrapper.jar @@ -22,6 +24,7 @@ gradlew.bat settings.gradle src/main/kotlin/org/openapitools/client/apis/AuthApi.kt src/main/kotlin/org/openapitools/client/apis/BodyApi.kt +src/main/kotlin/org/openapitools/client/apis/EchoApi.kt src/main/kotlin/org/openapitools/client/apis/FormApi.kt src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt src/main/kotlin/org/openapitools/client/apis/PathApi.kt @@ -43,5 +46,6 @@ src/main/kotlin/org/openapitools/client/models/ApiNumberPropertiesOnly.kt src/main/kotlin/org/openapitools/client/models/ApiPet.kt src/main/kotlin/org/openapitools/client/models/ApiQuery.kt src/main/kotlin/org/openapitools/client/models/ApiStringEnumRef.kt +src/main/kotlin/org/openapitools/client/models/ApiStringEscapingEdgeCases.kt src/main/kotlin/org/openapitools/client/models/ApiTag.kt src/main/kotlin/org/openapitools/client/models/ApiTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/README.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/README.md index 3654294d0212..8554b2a03adf 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/README.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/README.md @@ -55,6 +55,7 @@ All URIs are relative to *http://localhost:3000* | *BodyApi* | [**testEchoBodyPet**](docs/BodyApi.md#testechobodypet) | **POST** echo/body/Pet | Test body parameter(s) | | *BodyApi* | [**testEchoBodyPetResponseString**](docs/BodyApi.md#testechobodypetresponsestring) | **POST** echo/body/Pet/response_string | Test empty response body | | *BodyApi* | [**testEchoBodyTagResponseString**](docs/BodyApi.md#testechobodytagresponsestring) | **POST** echo/body/Tag/response_string | Test empty json (request body) | +| *EchoApi* | [**testsEchoStringEscapingParamName**](docs/EchoApi.md#testsechostringescapingparamname) | **GET** echo/string-escaping/{dollarParamName} | Test $-in-path-param escaping | | *FormApi* | [**testFormIntegerBooleanString**](docs/FormApi.md#testformintegerbooleanstring) | **POST** form/integer/boolean/string | Test form parameter(s) | | *FormApi* | [**testFormOneof**](docs/FormApi.md#testformoneof) | **POST** form/oneof | Test form parameter(s) for oneOf schema | | *HeaderApi* | [**testHeaderIntegerBooleanStringEnums**](docs/HeaderApi.md#testheaderintegerbooleanstringenums) | **GET** header/integer/boolean/string/enums | Test header parameter(s) | @@ -77,6 +78,7 @@ All URIs are relative to *http://localhost:3000* - [org.openapitools.client.models.ApiPet](docs/ApiPet.md) - [org.openapitools.client.models.ApiQuery](docs/ApiQuery.md) - [org.openapitools.client.models.ApiStringEnumRef](docs/ApiStringEnumRef.md) + - [org.openapitools.client.models.ApiStringEscapingEdgeCases](docs/ApiStringEscapingEdgeCases.md) - [org.openapitools.client.models.ApiTag](docs/ApiTag.md) - [org.openapitools.client.models.ApiTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/ApiTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md) diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/EchoApi.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/EchoApi.md new file mode 100644 index 000000000000..0a697932dad3 --- /dev/null +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/EchoApi.md @@ -0,0 +1,50 @@ +# EchoApi + +All URIs are relative to *http://localhost:3000* + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**testsEchoStringEscapingParamName**](EchoApi.md#testsEchoStringEscapingParamName) | **GET** echo/string-escaping/{dollarParamName} | Test \$-in-path-param escaping | + + + +Test \$-in-path-param escaping + +Tests that path params with \$dollar, backslash \\ and quote " are properly escaped + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(EchoApi::class.java) +val dollarParamName : kotlin.String = dollarParamName_example // kotlin.String | +val filterDollarType : kotlin.String = filterDollarType_example // kotlin.String | Filter with $dollar in description and comment-close */ + +launch(Dispatchers.IO) { + val result : kotlin.String = webService.testsEchoStringEscapingParamName(dollarParamName, filterDollarType) +} +``` + +### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **dollarParamName** | **kotlin.String**| | | +| **filterDollarType** | **kotlin.String**| Filter with \$dollar in description and comment-close */ | [optional] [default to "default\$Value with \\\\ and \\""] | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/FormApi.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/FormApi.md index fbc8495e9d05..04748ea34458 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/FormApi.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/FormApi.md @@ -32,10 +32,10 @@ launch(Dispatchers.IO) { ``` ### Parameters -| **integerForm** | **kotlin.Int**| | [optional] | -| **booleanForm** | **kotlin.Boolean**| | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **integerForm** | **kotlin.Int**| | [optional] | +| **booleanForm** | **kotlin.Boolean**| | [optional] | | **stringForm** | **kotlin.String**| | [optional] | ### Return type @@ -78,13 +78,13 @@ launch(Dispatchers.IO) { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **form1** | **kotlin.String**| | [optional] | | **form2** | **kotlin.Int**| | [optional] | | **form3** | **kotlin.String**| | [optional] | | **form4** | **kotlin.Boolean**| | [optional] | | **id** | **kotlin.Long**| | [optional] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **name** | **kotlin.String**| | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/HeaderApi.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/HeaderApi.md index bb03570a9501..87ef60eb823d 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/HeaderApi.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/HeaderApi.md @@ -33,12 +33,12 @@ launch(Dispatchers.IO) { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **integerHeader** | **kotlin.Int**| | [optional] | | **booleanHeader** | **kotlin.Boolean**| | [optional] | | **stringHeader** | **kotlin.String**| | [optional] | | **enumNonrefStringHeader** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **enumRefStringHeader** | [**ApiStringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] | ### Return type diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/PathApi.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/PathApi.md index c3ca570ecc2b..8e922e102e9c 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/PathApi.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/PathApi.md @@ -32,11 +32,11 @@ launch(Dispatchers.IO) { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **pathString** | **kotlin.String**| | | | **pathInteger** | **kotlin.Int**| | | | **enumNonrefStringPath** | **kotlin.String**| | [enum: success, failure, unclassified] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **enumRefStringPath** | [**ApiStringEnumRef**](.md)| | [enum: success, failure, unclassified] | ### Return type diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/QueryApi.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/QueryApi.md index a2714d03fa80..52646b1dc1eb 100644 --- a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/QueryApi.md +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/QueryApi.md @@ -35,9 +35,9 @@ launch(Dispatchers.IO) { ``` ### Parameters -| **enumNonrefStringQuery** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **enumNonrefStringQuery** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] | | **enumRefStringQuery** | [**ApiStringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] | ### Return type @@ -77,10 +77,10 @@ launch(Dispatchers.IO) { ``` ### Parameters -| **datetimeQuery** | **java.time.OffsetDateTime**| | [optional] | -| **dateQuery** | **java.time.LocalDate**| | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **datetimeQuery** | **java.time.OffsetDateTime**| | [optional] | +| **dateQuery** | **java.time.LocalDate**| | [optional] | | **stringQuery** | **kotlin.String**| | [optional] | ### Return type @@ -120,10 +120,10 @@ launch(Dispatchers.IO) { ``` ### Parameters -| **integerQuery** | **kotlin.Int**| | [optional] | -| **booleanQuery** | **kotlin.Boolean**| | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **integerQuery** | **kotlin.Int**| | [optional] | +| **booleanQuery** | **kotlin.Boolean**| | [optional] | | **stringQuery** | **kotlin.String**| | [optional] | ### Return type diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/StringEscapingEdgeCases.md b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/StringEscapingEdgeCases.md new file mode 100644 index 000000000000..e49f8e50da00 --- /dev/null +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/docs/StringEscapingEdgeCases.md @@ -0,0 +1,11 @@ + +# ApiStringEscapingEdgeCases + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **dollarDefault** | **kotlin.String** | A string whose default has \$dollar, backslash \\, quote " and comment-close */ | [optional] | +| **regularProp** | **kotlin.String** | Regular property for baseline comparison | [optional] | + + + diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/apis/EchoApi.kt b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/apis/EchoApi.kt new file mode 100644 index 000000000000..db02fc13f7f6 --- /dev/null +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/apis/EchoApi.kt @@ -0,0 +1,25 @@ +package org.openapitools.client.apis + +import org.openapitools.client.infrastructure.CollectionFormats.* +import retrofit2.http.* +import retrofit2.Response +import okhttp3.RequestBody +import com.google.gson.annotations.SerializedName + + +interface EchoApi { + /** + * GET echo/string-escaping/{dollarParamName} + * Test $-in-path-param escaping + * Tests that path params with $dollar, backslash \\ and quote \" are properly escaped + * Responses: + * - 200: ok + * + * @param dollarParamName + * @param filterDollarType Filter with $dollar in description and comment-close *_/ (optional, default to "default\$Value with \\\\ and \\"") + * @return [kotlin.String] + */ + @GET("echo/string-escaping/{dollarParamName}") + suspend fun testsEchoStringEscapingParamName(@Path("dollarParamName") dollarParamName: kotlin.String, @Query("filter\$Type") filterDollarType: kotlin.String? = "default\$Value with \\ and \""): Response + +} diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiStringEscapingEdgeCases.kt b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiStringEscapingEdgeCases.kt new file mode 100644 index 000000000000..e9d6cecc3821 --- /dev/null +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiStringEscapingEdgeCases.kt @@ -0,0 +1,51 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** + * Model to test: $dollar, backslash \\, quote \", comment-close *_/ + * + * @param dollarDefault A string whose default has $dollar, backslash \\, quote \" and comment-close *_/ + * @param regularProp Regular property for baseline comparison + */ + + +data class ApiStringEscapingEdgeCases ( + + /* A string whose default has $dollar, backslash \\, quote \" and comment-close *_/ */ + @SerializedName("dollarDefault") + val dollarDefault: kotlin.String? = "hello \$world, backslash=\\, quote=\", end */", + + /* Regular property for baseline comparison */ + @SerializedName("regularProp") + val regularProp: kotlin.String? = null + +) { + + +} + diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/apis/EchoApiTest.kt b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/apis/EchoApiTest.kt new file mode 100644 index 000000000000..f0f08d55a94b --- /dev/null +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/apis/EchoApiTest.kt @@ -0,0 +1,46 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.apis + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.apis.EchoApi + +class EchoApiTest : ShouldSpec() { + init { + // uncomment below to create an instance of EchoApi + //val apiInstance = EchoApi() + + // to test testsEchoStringEscapingParamName + should("test testsEchoStringEscapingParamName") { + // uncomment below to test testsEchoStringEscapingParamName + //val dollarParamName : kotlin.String = dollarParamName_example // kotlin.String | + //val filterDollarType : kotlin.String = filterDollarType_example // kotlin.String | Filter with $dollar in description and comment-close *_/ + //val result : kotlin.String = apiInstance.testsEchoStringEscapingParamName(dollarParamName, filterDollarType) + //result shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/StringEscapingEdgeCasesTest.kt b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/StringEscapingEdgeCasesTest.kt new file mode 100644 index 000000000000..6cfaf10ce897 --- /dev/null +++ b/samples/client/echo_api/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/StringEscapingEdgeCasesTest.kt @@ -0,0 +1,49 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.ApiStringEscapingEdgeCases + +class ApiStringEscapingEdgeCasesTest : ShouldSpec() { + init { + // uncomment below to create an instance of ApiStringEscapingEdgeCases + //val modelInstance = ApiStringEscapingEdgeCases() + + // to test the property `dollarDefault` - A string whose default has $dollar, backslash \\, quote \" and comment-close *_/ + should("test dollarDefault") { + // uncomment below to test the property + //modelInstance.dollarDefault shouldBe ("TODO") + } + + // to test the property `regularProp` - Regular property for baseline comparison + should("test regularProp") { + // uncomment below to test the property + //modelInstance.regularProp shouldBe ("TODO") + } + + } +} diff --git a/samples/client/others/kotlin-jvm-okhttp-non-ascii-headers/docs/PetApi.md b/samples/client/others/kotlin-jvm-okhttp-non-ascii-headers/docs/PetApi.md index e0bf879c9a65..b063e869b3ff 100644 --- a/samples/client/others/kotlin-jvm-okhttp-non-ascii-headers/docs/PetApi.md +++ b/samples/client/others/kotlin-jvm-okhttp-non-ascii-headers/docs/PetApi.md @@ -91,9 +91,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -334,10 +334,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -386,10 +386,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/others/kotlin-jvm-okhttp-non-ascii-headers/docs/StoreApi.md b/samples/client/others/kotlin-jvm-okhttp-non-ascii-headers/docs/StoreApi.md index bfbf6c75d797..c8cd9c416773 100644 --- a/samples/client/others/kotlin-jvm-okhttp-non-ascii-headers/docs/StoreApi.md +++ b/samples/client/others/kotlin-jvm-okhttp-non-ascii-headers/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/others/kotlin-jvm-okhttp-non-ascii-headers/docs/UserApi.md b/samples/client/others/kotlin-jvm-okhttp-non-ascii-headers/docs/UserApi.md index fb5bfa6c7a44..1a61b0b068ac 100644 --- a/samples/client/others/kotlin-jvm-okhttp-non-ascii-headers/docs/UserApi.md +++ b/samples/client/others/kotlin-jvm-okhttp-non-ascii-headers/docs/UserApi.md @@ -282,9 +282,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -374,9 +374,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/docs/DefaultApi.md b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/docs/DefaultApi.md index d492f8228f40..b1c17358b519 100644 --- a/samples/client/others/kotlin-jvm-okhttp-parameter-tests/docs/DefaultApi.md +++ b/samples/client/others/kotlin-jvm-okhttp-parameter-tests/docs/DefaultApi.md @@ -49,22 +49,22 @@ try { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **pathDefault** | **kotlin.String**| path default | | | **pathNullable** | **kotlin.String**| path_nullable | | -| **queryDefault** | **kotlin.String**| query default | [optional] [default to "available"] | +| **queryDefault** | **kotlin.String**| query default | [optional] [default to "available"] | | **queryDefaultEnum** | **kotlin.String**| query default enum | [optional] [default to QueryDefaultEnum.B] [enum: A, B, C] | | **queryDefaultInt** | **java.math.BigDecimal**| query default int | [optional] [default to 3] | -| **headerDefault** | **kotlin.String**| header default | [optional] [default to "available"] | +| **headerDefault** | **kotlin.String**| header default | [optional] [default to "available"] | | **headerDefaultEnum** | **kotlin.String**| header default enum | [optional] [default to HeaderDefaultEnum.B] [enum: A, B, C] | | **headerDefaultInt** | **java.math.BigDecimal**| header default int | [optional] [default to 3] | -| **cookieDefault** | **kotlin.String**| cookie default | [optional] [default to "available"] | +| **cookieDefault** | **kotlin.String**| cookie default | [optional] [default to "available"] | | **cookieDefaultEnum** | **kotlin.String**| cookie default enum | [optional] [default to CookieDefaultEnum.B] [enum: A, B, C] | | **cookieDefaultInt** | **java.math.BigDecimal**| cookie default int | [optional] [default to 3] | | **queryNullable** | **kotlin.String**| query nullable | [optional] | | **headerNullable** | **kotlin.String**| header nullable | [optional] | | **cookieNullable** | **kotlin.String**| cookie_nullable | [optional] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **dollarQueryDollarDollarSign** | **kotlin.String**| query parameter with dollar sign | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-allOf-discriminator-kotlinx-serialization/docs/BirdApi.md b/samples/client/petstore/kotlin-allOf-discriminator-kotlinx-serialization/docs/BirdApi.md index 4422300d940d..af8ca0eb3dea 100644 --- a/samples/client/petstore/kotlin-allOf-discriminator-kotlinx-serialization/docs/BirdApi.md +++ b/samples/client/petstore/kotlin-allOf-discriminator-kotlinx-serialization/docs/BirdApi.md @@ -80,9 +80,9 @@ try { ``` ### Parameters -| **metadata** | [**Bird**](Bird.md)| | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **metadata** | [**Bird**](Bird.md)| | | | **file** | **java.io.File**| | | ### Return type diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/docs/Apa.md b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/docs/Apa.md index c83f71851c20..2b414b6ca1f4 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/docs/Apa.md +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/docs/Apa.md @@ -8,6 +8,7 @@ | **n0** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | | | **i1** | **kotlin.Int** | | [optional] | | **n1** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] | +| **s0** | **kotlin.String** | String property with \$dollar, backslash, quote, comment-close in default | [optional] | diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/docs/DefaultApi.md b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/docs/DefaultApi.md index dd1534cf92fc..442d6798bc70 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/docs/DefaultApi.md +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/docs/DefaultApi.md @@ -9,7 +9,7 @@ All URIs are relative to *http://localhost* # **test** -> test(pi0, pi1, pn0, pn1, qi0, qi1, qi2, qi3, qn0, qn1, qn2, qn3, hi0, hi1, hi2, hi3, hn0, hn1, hn2, hn3, fi0, fi1, fi2, fi3, fn0, fn1, fn2, fn3, fn4) +> test(pi0, pi1, pn0, pn1, qi0, qi1, qi2, qi3, qn0, qn1, qn2, qn3, hi0, hi1, hi2, hi3, hn0, hn1, hn2, hn3, qs0, fi0, fi1, fi2, fi3, fn0, fn1, fn2, fn3, fn4) Tests default values @@ -42,6 +42,7 @@ val hn0 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | val hn1 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | val hn2 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | val hn3 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | +val qs0 : kotlin.String = qs0_example // kotlin.String | String with $dollar, backslash, quote, comment-close in default val fi0 : kotlin.Int = 56 // kotlin.Int | val fi1 : kotlin.Int = 56 // kotlin.Int | val fi2 : kotlin.Int = 56 // kotlin.Int | @@ -52,7 +53,7 @@ val fn2 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | val fn3 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | val fn4 : kotlin.collections.List = // kotlin.collections.List | try { - apiInstance.test(pi0, pi1, pn0, pn1, qi0, qi1, qi2, qi3, qn0, qn1, qn2, qn3, hi0, hi1, hi2, hi3, hn0, hn1, hn2, hn3, fi0, fi1, fi2, fi3, fn0, fn1, fn2, fn3, fn4) + apiInstance.test(pi0, pi1, pn0, pn1, qi0, qi1, qi2, qi3, qn0, qn1, qn2, qn3, hi0, hi1, hi2, hi3, hn0, hn1, hn2, hn3, qs0, fi0, fi1, fi2, fi3, fn0, fn1, fn2, fn3, fn4) } catch (e: ClientException) { println("4xx response calling DefaultApi#test") e.printStackTrace() @@ -63,6 +64,8 @@ try { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **pi0** | **kotlin.Int**| | [default to 10] | | **pi1** | **kotlin.Int**| | | | **pn0** | **java.math.BigDecimal**| | [default to 10.0] | @@ -83,6 +86,7 @@ try { | **hn1** | **java.math.BigDecimal**| | [default to 71.0] | | **hn2** | **java.math.BigDecimal**| | [optional] | | **hn3** | **java.math.BigDecimal**| | | +| **qs0** | **kotlin.String**| String with \$dollar, backslash, quote, comment-close in default | [optional] [default to "hello \$world, backslash=\\\\, quote=\\", end *_/"] | | **fi0** | **kotlin.Int**| | [optional] [default to 10] | | **fi1** | **kotlin.Int**| | [default to 71] | | **fi2** | **kotlin.Int**| | [optional] | @@ -91,8 +95,6 @@ try { | **fn1** | **java.math.BigDecimal**| | [default to 71.0] | | **fn2** | **java.math.BigDecimal**| | [optional] | | **fn3** | **java.math.BigDecimal**| | | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **fn4** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | | ### Return type diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 7a217ce1246b..eaa2027bd058 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -76,6 +76,7 @@ open class DefaultApi(basePath: kotlin.String = defaultBasePath, client: Call.Fa * @param hn1 (default to 71.0) * @param hn2 (optional) * @param hn3 + * @param qs0 String with $dollar, backslash, quote, comment-close in default (optional, default to "hello $world, backslash=\\, quote=\", end *_/") * @param fi0 (optional, default to 10) * @param fi1 (default to 71) * @param fi2 (optional) @@ -93,8 +94,8 @@ open class DefaultApi(basePath: kotlin.String = defaultBasePath, client: Call.Fa * @throws ServerException If the API returns a server error response */ @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun test(pi0: kotlin.Int = 10, pi1: kotlin.Int, pn0: java.math.BigDecimal = java.math.BigDecimal("10.0"), pn1: java.math.BigDecimal, qi0: kotlin.Int? = 10, qi1: kotlin.Int = 71, qi2: kotlin.Int? = null, qi3: kotlin.Int, qn0: java.math.BigDecimal? = java.math.BigDecimal("10.0"), qn1: java.math.BigDecimal = java.math.BigDecimal("71.0"), qn2: java.math.BigDecimal? = null, qn3: java.math.BigDecimal, hi0: kotlin.Int? = 10, hi1: kotlin.Int = 71, hi2: kotlin.Int? = null, hi3: kotlin.Int, hn0: java.math.BigDecimal? = java.math.BigDecimal("10.0"), hn1: java.math.BigDecimal = java.math.BigDecimal("71.0"), hn2: java.math.BigDecimal? = null, hn3: java.math.BigDecimal, fi0: kotlin.Int? = 10, fi1: kotlin.Int = 71, fi2: kotlin.Int? = null, fi3: kotlin.Int, fn0: java.math.BigDecimal? = java.math.BigDecimal("10.0"), fn1: java.math.BigDecimal = java.math.BigDecimal("71.0"), fn2: java.math.BigDecimal? = null, fn3: java.math.BigDecimal, fn4: kotlin.collections.List) : Unit { - val localVarResponse = testWithHttpInfo(pi0 = pi0, pi1 = pi1, pn0 = pn0, pn1 = pn1, qi0 = qi0, qi1 = qi1, qi2 = qi2, qi3 = qi3, qn0 = qn0, qn1 = qn1, qn2 = qn2, qn3 = qn3, hi0 = hi0, hi1 = hi1, hi2 = hi2, hi3 = hi3, hn0 = hn0, hn1 = hn1, hn2 = hn2, hn3 = hn3, fi0 = fi0, fi1 = fi1, fi2 = fi2, fi3 = fi3, fn0 = fn0, fn1 = fn1, fn2 = fn2, fn3 = fn3, fn4 = fn4) + fun test(pi0: kotlin.Int = 10, pi1: kotlin.Int, pn0: java.math.BigDecimal = java.math.BigDecimal("10.0"), pn1: java.math.BigDecimal, qi0: kotlin.Int? = 10, qi1: kotlin.Int = 71, qi2: kotlin.Int? = null, qi3: kotlin.Int, qn0: java.math.BigDecimal? = java.math.BigDecimal("10.0"), qn1: java.math.BigDecimal = java.math.BigDecimal("71.0"), qn2: java.math.BigDecimal? = null, qn3: java.math.BigDecimal, hi0: kotlin.Int? = 10, hi1: kotlin.Int = 71, hi2: kotlin.Int? = null, hi3: kotlin.Int, hn0: java.math.BigDecimal? = java.math.BigDecimal("10.0"), hn1: java.math.BigDecimal = java.math.BigDecimal("71.0"), hn2: java.math.BigDecimal? = null, hn3: java.math.BigDecimal, qs0: kotlin.String? = "hello \$world, backslash=\\, quote=\", end */", fi0: kotlin.Int? = 10, fi1: kotlin.Int = 71, fi2: kotlin.Int? = null, fi3: kotlin.Int, fn0: java.math.BigDecimal? = java.math.BigDecimal("10.0"), fn1: java.math.BigDecimal = java.math.BigDecimal("71.0"), fn2: java.math.BigDecimal? = null, fn3: java.math.BigDecimal, fn4: kotlin.collections.List) : Unit { + val localVarResponse = testWithHttpInfo(pi0 = pi0, pi1 = pi1, pn0 = pn0, pn1 = pn1, qi0 = qi0, qi1 = qi1, qi2 = qi2, qi3 = qi3, qn0 = qn0, qn1 = qn1, qn2 = qn2, qn3 = qn3, hi0 = hi0, hi1 = hi1, hi2 = hi2, hi3 = hi3, hn0 = hn0, hn1 = hn1, hn2 = hn2, hn3 = hn3, qs0 = qs0, fi0 = fi0, fi1 = fi1, fi2 = fi2, fi3 = fi3, fn0 = fn0, fn1 = fn1, fn2 = fn2, fn3 = fn3, fn4 = fn4) return when (localVarResponse.responseType) { ResponseType.Success -> Unit @@ -135,6 +136,7 @@ open class DefaultApi(basePath: kotlin.String = defaultBasePath, client: Call.Fa * @param hn1 (default to 71.0) * @param hn2 (optional) * @param hn3 + * @param qs0 String with $dollar, backslash, quote, comment-close in default (optional, default to "hello $world, backslash=\\, quote=\", end *_/") * @param fi0 (optional, default to 10) * @param fi1 (default to 71) * @param fi2 (optional) @@ -149,8 +151,8 @@ open class DefaultApi(basePath: kotlin.String = defaultBasePath, client: Call.Fa * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun testWithHttpInfo(pi0: kotlin.Int, pi1: kotlin.Int, pn0: java.math.BigDecimal, pn1: java.math.BigDecimal, qi0: kotlin.Int?, qi1: kotlin.Int, qi2: kotlin.Int?, qi3: kotlin.Int, qn0: java.math.BigDecimal?, qn1: java.math.BigDecimal, qn2: java.math.BigDecimal?, qn3: java.math.BigDecimal, hi0: kotlin.Int?, hi1: kotlin.Int, hi2: kotlin.Int?, hi3: kotlin.Int, hn0: java.math.BigDecimal?, hn1: java.math.BigDecimal, hn2: java.math.BigDecimal?, hn3: java.math.BigDecimal, fi0: kotlin.Int?, fi1: kotlin.Int, fi2: kotlin.Int?, fi3: kotlin.Int, fn0: java.math.BigDecimal?, fn1: java.math.BigDecimal, fn2: java.math.BigDecimal?, fn3: java.math.BigDecimal, fn4: kotlin.collections.List) : ApiResponse { - val localVariableConfig = testRequestConfig(pi0 = pi0, pi1 = pi1, pn0 = pn0, pn1 = pn1, qi0 = qi0, qi1 = qi1, qi2 = qi2, qi3 = qi3, qn0 = qn0, qn1 = qn1, qn2 = qn2, qn3 = qn3, hi0 = hi0, hi1 = hi1, hi2 = hi2, hi3 = hi3, hn0 = hn0, hn1 = hn1, hn2 = hn2, hn3 = hn3, fi0 = fi0, fi1 = fi1, fi2 = fi2, fi3 = fi3, fn0 = fn0, fn1 = fn1, fn2 = fn2, fn3 = fn3, fn4 = fn4) + fun testWithHttpInfo(pi0: kotlin.Int, pi1: kotlin.Int, pn0: java.math.BigDecimal, pn1: java.math.BigDecimal, qi0: kotlin.Int?, qi1: kotlin.Int, qi2: kotlin.Int?, qi3: kotlin.Int, qn0: java.math.BigDecimal?, qn1: java.math.BigDecimal, qn2: java.math.BigDecimal?, qn3: java.math.BigDecimal, hi0: kotlin.Int?, hi1: kotlin.Int, hi2: kotlin.Int?, hi3: kotlin.Int, hn0: java.math.BigDecimal?, hn1: java.math.BigDecimal, hn2: java.math.BigDecimal?, hn3: java.math.BigDecimal, qs0: kotlin.String?, fi0: kotlin.Int?, fi1: kotlin.Int, fi2: kotlin.Int?, fi3: kotlin.Int, fn0: java.math.BigDecimal?, fn1: java.math.BigDecimal, fn2: java.math.BigDecimal?, fn3: java.math.BigDecimal, fn4: kotlin.collections.List) : ApiResponse { + val localVariableConfig = testRequestConfig(pi0 = pi0, pi1 = pi1, pn0 = pn0, pn1 = pn1, qi0 = qi0, qi1 = qi1, qi2 = qi2, qi3 = qi3, qn0 = qn0, qn1 = qn1, qn2 = qn2, qn3 = qn3, hi0 = hi0, hi1 = hi1, hi2 = hi2, hi3 = hi3, hn0 = hn0, hn1 = hn1, hn2 = hn2, hn3 = hn3, qs0 = qs0, fi0 = fi0, fi1 = fi1, fi2 = fi2, fi3 = fi3, fn0 = fn0, fn1 = fn1, fn2 = fn2, fn3 = fn3, fn4 = fn4) return request>, Unit>( localVariableConfig @@ -180,6 +182,7 @@ open class DefaultApi(basePath: kotlin.String = defaultBasePath, client: Call.Fa * @param hn1 (default to 71.0) * @param hn2 (optional) * @param hn3 + * @param qs0 String with $dollar, backslash, quote, comment-close in default (optional, default to "hello $world, backslash=\\, quote=\", end *_/") * @param fi0 (optional, default to 10) * @param fi1 (default to 71) * @param fi2 (optional) @@ -191,7 +194,7 @@ open class DefaultApi(basePath: kotlin.String = defaultBasePath, client: Call.Fa * @param fn4 * @return RequestConfig */ - fun testRequestConfig(pi0: kotlin.Int, pi1: kotlin.Int, pn0: java.math.BigDecimal, pn1: java.math.BigDecimal, qi0: kotlin.Int?, qi1: kotlin.Int, qi2: kotlin.Int?, qi3: kotlin.Int, qn0: java.math.BigDecimal?, qn1: java.math.BigDecimal, qn2: java.math.BigDecimal?, qn3: java.math.BigDecimal, hi0: kotlin.Int?, hi1: kotlin.Int, hi2: kotlin.Int?, hi3: kotlin.Int, hn0: java.math.BigDecimal?, hn1: java.math.BigDecimal, hn2: java.math.BigDecimal?, hn3: java.math.BigDecimal, fi0: kotlin.Int?, fi1: kotlin.Int, fi2: kotlin.Int?, fi3: kotlin.Int, fn0: java.math.BigDecimal?, fn1: java.math.BigDecimal, fn2: java.math.BigDecimal?, fn3: java.math.BigDecimal, fn4: kotlin.collections.List) : RequestConfig>> { + fun testRequestConfig(pi0: kotlin.Int, pi1: kotlin.Int, pn0: java.math.BigDecimal, pn1: java.math.BigDecimal, qi0: kotlin.Int?, qi1: kotlin.Int, qi2: kotlin.Int?, qi3: kotlin.Int, qn0: java.math.BigDecimal?, qn1: java.math.BigDecimal, qn2: java.math.BigDecimal?, qn3: java.math.BigDecimal, hi0: kotlin.Int?, hi1: kotlin.Int, hi2: kotlin.Int?, hi3: kotlin.Int, hn0: java.math.BigDecimal?, hn1: java.math.BigDecimal, hn2: java.math.BigDecimal?, hn3: java.math.BigDecimal, qs0: kotlin.String?, fi0: kotlin.Int?, fi1: kotlin.Int, fi2: kotlin.Int?, fi3: kotlin.Int, fn0: java.math.BigDecimal?, fn1: java.math.BigDecimal, fn2: java.math.BigDecimal?, fn3: java.math.BigDecimal, fn4: kotlin.collections.List) : RequestConfig>> { val localVariableBody = mapOf( "fi0" to PartConfig(body = fi0, headers = mutableMapOf()), "fi1" to PartConfig(body = fi1, headers = mutableMapOf()), @@ -220,6 +223,9 @@ open class DefaultApi(basePath: kotlin.String = defaultBasePath, client: Call.Fa put("qn2", listOf(qn2.toString())) } put("qn3", listOf(qn3.toString())) + if (qs0 != null) { + put("qs0", listOf(qs0.toString())) + } } val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") hi0?.apply { localVariableHeaders["hi0"] = this.toString() } diff --git a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt index fdf64fda9a24..99483aa9ba69 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-okhttp4/src/main/kotlin/org/openapitools/client/models/Apa.kt @@ -34,6 +34,7 @@ import com.squareup.moshi.JsonClass * @param n0 * @param i1 * @param n1 + * @param s0 String property with $dollar, backslash, quote, comment-close in default */ @@ -49,7 +50,11 @@ data class Apa ( val i1: kotlin.Int? = null, @Json(name = "n1") - val n1: java.math.BigDecimal? = null + val n1: java.math.BigDecimal? = null, + + /* String property with $dollar, backslash, quote, comment-close in default */ + @Json(name = "s0") + val s0: kotlin.String? = "hello \$world, backslash=\\, quote=\", end */" ) { diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/docs/Apa.md b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/docs/Apa.md index c83f71851c20..2b414b6ca1f4 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/docs/Apa.md +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/docs/Apa.md @@ -8,6 +8,7 @@ | **n0** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | | | **i1** | **kotlin.Int** | | [optional] | | **n1** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] | +| **s0** | **kotlin.String** | String property with \$dollar, backslash, quote, comment-close in default | [optional] | diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/docs/DefaultApi.md b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/docs/DefaultApi.md index 0545066c005b..5b119a710fc3 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/docs/DefaultApi.md +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/docs/DefaultApi.md @@ -41,6 +41,7 @@ val hn0 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | val hn1 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | val hn2 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | val hn3 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | +val qs0 : kotlin.String = qs0_example // kotlin.String | String with $dollar, backslash, quote, comment-close in default val fi0 : kotlin.Int = 56 // kotlin.Int | val fi1 : kotlin.Int = 56 // kotlin.Int | val fi2 : kotlin.Int = 56 // kotlin.Int | @@ -51,10 +52,12 @@ val fn2 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | val fn3 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | val fn4 : kotlin.collections.List = // kotlin.collections.List | -webService.test(pi0, pi1, pn0, pn1, qi0, qi1, qi2, qi3, qn0, qn1, qn2, qn3, hi0, hi1, hi2, hi3, hn0, hn1, hn2, hn3, fi0, fi1, fi2, fi3, fn0, fn1, fn2, fn3, fn4) +webService.test(pi0, pi1, pn0, pn1, qi0, qi1, qi2, qi3, qn0, qn1, qn2, qn3, hi0, hi1, hi2, hi3, hn0, hn1, hn2, hn3, qs0, fi0, fi1, fi2, fi3, fn0, fn1, fn2, fn3, fn4) ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **pi0** | **kotlin.Int**| | [default to 10] | | **pi1** | **kotlin.Int**| | | | **pn0** | **java.math.BigDecimal**| | [default to 10.0] | @@ -75,6 +78,7 @@ webService.test(pi0, pi1, pn0, pn1, qi0, qi1, qi2, qi3, qn0, qn1, qn2, qn3, hi0, | **hn1** | **java.math.BigDecimal**| | [default to 71.0] | | **hn2** | **java.math.BigDecimal**| | [optional] | | **hn3** | **java.math.BigDecimal**| | | +| **qs0** | **kotlin.String**| String with \$dollar, backslash, quote, comment-close in default | [optional] [default to "hello \$world, backslash=\\\\, quote=\\", end *_/"] | | **fi0** | **kotlin.Int**| | [optional] [default to 10] | | **fi1** | **kotlin.Int**| | [default to 71] | | **fi2** | **kotlin.Int**| | [optional] | @@ -83,8 +87,6 @@ webService.test(pi0, pi1, pn0, pn1, qi0, qi1, qi2, qi3, qn0, qn1, qn2, qn3, hi0, | **fn1** | **java.math.BigDecimal**| | [default to 71.0] | | **fn2** | **java.math.BigDecimal**| | [optional] | | **fn3** | **java.math.BigDecimal**| | | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **fn4** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | | ### Return type diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index cb37c7fc44ce..960b7f7a1458 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -35,6 +35,7 @@ interface DefaultApi { * @param hn1 (default to 71.0) * @param hn2 (optional) * @param hn3 + * @param qs0 String with $dollar, backslash, quote, comment-close in default (optional, default to "hello \$world, backslash=\\\\, quote=\\", end *_/") * @param fi0 (optional, default to 10) * @param fi1 (default to 71) * @param fi2 (optional) @@ -48,6 +49,6 @@ interface DefaultApi { */ @Multipart @POST("test") - fun test(@Path("pi0") pi0: kotlin.Int = 10, @Path("pi1") pi1: kotlin.Int, @Path("pn0") pn0: java.math.BigDecimal = java.math.BigDecimal("10.0"), @Path("pn1") pn1: java.math.BigDecimal, @Query("qi0") qi0: kotlin.Int? = 10, @Query("qi1") qi1: kotlin.Int = 71, @Query("qi2") qi2: kotlin.Int? = null, @Query("qi3") qi3: kotlin.Int, @Query("qn0") qn0: java.math.BigDecimal? = java.math.BigDecimal("10.0"), @Query("qn1") qn1: java.math.BigDecimal = java.math.BigDecimal("71.0"), @Query("qn2") qn2: java.math.BigDecimal? = null, @Query("qn3") qn3: java.math.BigDecimal, @Header("hi0") hi0: kotlin.Int? = 10, @Header("hi1") hi1: kotlin.Int = 71, @Header("hi2") hi2: kotlin.Int? = null, @Header("hi3") hi3: kotlin.Int, @Header("hn0") hn0: java.math.BigDecimal? = java.math.BigDecimal("10.0"), @Header("hn1") hn1: java.math.BigDecimal = java.math.BigDecimal("71.0"), @Header("hn2") hn2: java.math.BigDecimal? = null, @Header("hn3") hn3: java.math.BigDecimal, @Part("fi0") fi0: kotlin.Int? = 10, @Part("fi1") fi1: kotlin.Int = 71, @Part("fi2") fi2: kotlin.Int? = null, @Part("fi3") fi3: kotlin.Int, @Part("fn0") fn0: java.math.BigDecimal? = java.math.BigDecimal("10.0"), @Part("fn1") fn1: java.math.BigDecimal = java.math.BigDecimal("71.0"), @Part("fn2") fn2: java.math.BigDecimal? = null, @Part("fn3") fn3: java.math.BigDecimal, @Part("fn4") fn4: kotlin.collections.List): Call + fun test(@Path("pi0") pi0: kotlin.Int = 10, @Path("pi1") pi1: kotlin.Int, @Path("pn0") pn0: java.math.BigDecimal = java.math.BigDecimal("10.0"), @Path("pn1") pn1: java.math.BigDecimal, @Query("qi0") qi0: kotlin.Int? = 10, @Query("qi1") qi1: kotlin.Int = 71, @Query("qi2") qi2: kotlin.Int? = null, @Query("qi3") qi3: kotlin.Int, @Query("qn0") qn0: java.math.BigDecimal? = java.math.BigDecimal("10.0"), @Query("qn1") qn1: java.math.BigDecimal = java.math.BigDecimal("71.0"), @Query("qn2") qn2: java.math.BigDecimal? = null, @Query("qn3") qn3: java.math.BigDecimal, @Header("hi0") hi0: kotlin.Int? = 10, @Header("hi1") hi1: kotlin.Int = 71, @Header("hi2") hi2: kotlin.Int? = null, @Header("hi3") hi3: kotlin.Int, @Header("hn0") hn0: java.math.BigDecimal? = java.math.BigDecimal("10.0"), @Header("hn1") hn1: java.math.BigDecimal = java.math.BigDecimal("71.0"), @Header("hn2") hn2: java.math.BigDecimal? = null, @Header("hn3") hn3: java.math.BigDecimal, @Query("qs0") qs0: kotlin.String? = "hello \$world, backslash=\\, quote=\", end */", @Part("fi0") fi0: kotlin.Int? = 10, @Part("fi1") fi1: kotlin.Int = 71, @Part("fi2") fi2: kotlin.Int? = null, @Part("fi3") fi3: kotlin.Int, @Part("fn0") fn0: java.math.BigDecimal? = java.math.BigDecimal("10.0"), @Part("fn1") fn1: java.math.BigDecimal = java.math.BigDecimal("71.0"), @Part("fn2") fn2: java.math.BigDecimal? = null, @Part("fn3") fn3: java.math.BigDecimal, @Part("fn4") fn4: kotlin.collections.List): Call } diff --git a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/models/Apa.kt index fdf64fda9a24..99483aa9ba69 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/models/Apa.kt +++ b/samples/client/petstore/kotlin-default-values-jvm-retrofit2/src/main/kotlin/org/openapitools/client/models/Apa.kt @@ -34,6 +34,7 @@ import com.squareup.moshi.JsonClass * @param n0 * @param i1 * @param n1 + * @param s0 String property with $dollar, backslash, quote, comment-close in default */ @@ -49,7 +50,11 @@ data class Apa ( val i1: kotlin.Int? = null, @Json(name = "n1") - val n1: java.math.BigDecimal? = null + val n1: java.math.BigDecimal? = null, + + /* String property with $dollar, backslash, quote, comment-close in default */ + @Json(name = "s0") + val s0: kotlin.String? = "hello \$world, backslash=\\, quote=\", end */" ) { diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/docs/Apa.md b/samples/client/petstore/kotlin-default-values-multiplatform/docs/Apa.md index 078a27310550..7c271b8aa036 100644 --- a/samples/client/petstore/kotlin-default-values-multiplatform/docs/Apa.md +++ b/samples/client/petstore/kotlin-default-values-multiplatform/docs/Apa.md @@ -8,6 +8,7 @@ | **n0** | **kotlin.Double** | | | | **i1** | **kotlin.Int** | | [optional] | | **n1** | **kotlin.Double** | | [optional] | +| **s0** | **kotlin.String** | String property with \$dollar, backslash, quote, comment-close in default | [optional] | diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/docs/DefaultApi.md b/samples/client/petstore/kotlin-default-values-multiplatform/docs/DefaultApi.md index 65928b193472..2584fbcfb8b9 100644 --- a/samples/client/petstore/kotlin-default-values-multiplatform/docs/DefaultApi.md +++ b/samples/client/petstore/kotlin-default-values-multiplatform/docs/DefaultApi.md @@ -9,7 +9,7 @@ All URIs are relative to *http://localhost* # **test** -> test(pi0, pi1, pn0, pn1, qi0, qi1, qi2, qi3, qn0, qn1, qn2, qn3, hi0, hi1, hi2, hi3, hn0, hn1, hn2, hn3, fi0, fi1, fi2, fi3, fn0, fn1, fn2, fn3, fn4) +> test(pi0, pi1, pn0, pn1, qi0, qi1, qi2, qi3, qn0, qn1, qn2, qn3, hi0, hi1, hi2, hi3, hn0, hn1, hn2, hn3, qs0, fi0, fi1, fi2, fi3, fn0, fn1, fn2, fn3, fn4) Tests default values @@ -42,6 +42,7 @@ val hn0 : kotlin.Double = 8.14 // kotlin.Double | val hn1 : kotlin.Double = 8.14 // kotlin.Double | val hn2 : kotlin.Double = 8.14 // kotlin.Double | val hn3 : kotlin.Double = 8.14 // kotlin.Double | +val qs0 : kotlin.String = qs0_example // kotlin.String | String with $dollar, backslash, quote, comment-close in default val fi0 : kotlin.Int = 56 // kotlin.Int | val fi1 : kotlin.Int = 56 // kotlin.Int | val fi2 : kotlin.Int = 56 // kotlin.Int | @@ -52,7 +53,7 @@ val fn2 : kotlin.Double = 8.14 // kotlin.Double | val fn3 : kotlin.Double = 8.14 // kotlin.Double | val fn4 : kotlin.collections.List = // kotlin.collections.List | try { - apiInstance.test(pi0, pi1, pn0, pn1, qi0, qi1, qi2, qi3, qn0, qn1, qn2, qn3, hi0, hi1, hi2, hi3, hn0, hn1, hn2, hn3, fi0, fi1, fi2, fi3, fn0, fn1, fn2, fn3, fn4) + apiInstance.test(pi0, pi1, pn0, pn1, qi0, qi1, qi2, qi3, qn0, qn1, qn2, qn3, hi0, hi1, hi2, hi3, hn0, hn1, hn2, hn3, qs0, fi0, fi1, fi2, fi3, fn0, fn1, fn2, fn3, fn4) } catch (e: ClientException) { println("4xx response calling DefaultApi#test") e.printStackTrace() @@ -63,6 +64,8 @@ try { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **pi0** | **kotlin.Int**| | [default to 10] | | **pi1** | **kotlin.Int**| | | | **pn0** | **kotlin.Double**| | [default to 10.0] | @@ -83,6 +86,7 @@ try { | **hn1** | **kotlin.Double**| | [default to 71.0] | | **hn2** | **kotlin.Double**| | [optional] | | **hn3** | **kotlin.Double**| | | +| **qs0** | **kotlin.String**| String with \$dollar, backslash, quote, comment-close in default | [optional] [default to "hello \$world, backslash=\\\\, quote=\\", end *_/"] | | **fi0** | **kotlin.Int**| | [optional] [default to 10] | | **fi1** | **kotlin.Int**| | [default to 71] | | **fi2** | **kotlin.Int**| | [optional] | @@ -91,8 +95,6 @@ try { | **fn1** | **kotlin.Double**| | [default to 71.0] | | **fn2** | **kotlin.Double**| | [optional] | | **fn3** | **kotlin.Double**| | | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **fn4** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| | | ### Return type diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt index d921fa3929d6..f3c7f4f7a1b1 100644 --- a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -76,6 +76,7 @@ open class DefaultApi : ApiClient { * @param hn1 (default to 71.0) * @param hn2 (optional) * @param hn3 + * @param qs0 String with $dollar, backslash, quote, comment-close in default (optional, default to "hello $world, backslash=\\, quote=\", end *_/") * @param fi0 (optional, default to 10) * @param fi1 (default to 71) * @param fi2 (optional) @@ -87,7 +88,7 @@ open class DefaultApi : ApiClient { * @param fn4 * @return void */ - open suspend fun test(pi0: kotlin.Int = 10, pi1: kotlin.Int, pn0: kotlin.Double = 10.0.toDouble(), pn1: kotlin.Double, qi0: kotlin.Int? = 10, qi1: kotlin.Int = 71, qi2: kotlin.Int? = null, qi3: kotlin.Int, qn0: kotlin.Double? = 10.0.toDouble(), qn1: kotlin.Double = 71.0.toDouble(), qn2: kotlin.Double? = null, qn3: kotlin.Double, hi0: kotlin.Int? = 10, hi1: kotlin.Int = 71, hi2: kotlin.Int? = null, hi3: kotlin.Int, hn0: kotlin.Double? = 10.0.toDouble(), hn1: kotlin.Double = 71.0.toDouble(), hn2: kotlin.Double? = null, hn3: kotlin.Double, fi0: kotlin.Int? = 10, fi1: kotlin.Int = 71, fi2: kotlin.Int? = null, fi3: kotlin.Int, fn0: kotlin.Double? = 10.0.toDouble(), fn1: kotlin.Double = 71.0.toDouble(), fn2: kotlin.Double? = null, fn3: kotlin.Double, fn4: kotlin.collections.List): HttpResponse { + open suspend fun test(pi0: kotlin.Int = 10, pi1: kotlin.Int, pn0: kotlin.Double = 10.0.toDouble(), pn1: kotlin.Double, qi0: kotlin.Int? = 10, qi1: kotlin.Int = 71, qi2: kotlin.Int? = null, qi3: kotlin.Int, qn0: kotlin.Double? = 10.0.toDouble(), qn1: kotlin.Double = 71.0.toDouble(), qn2: kotlin.Double? = null, qn3: kotlin.Double, hi0: kotlin.Int? = 10, hi1: kotlin.Int = 71, hi2: kotlin.Int? = null, hi3: kotlin.Int, hn0: kotlin.Double? = 10.0.toDouble(), hn1: kotlin.Double = 71.0.toDouble(), hn2: kotlin.Double? = null, hn3: kotlin.Double, qs0: kotlin.String? = "hello \$world, backslash=\\, quote=\", end */", fi0: kotlin.Int? = 10, fi1: kotlin.Int = 71, fi2: kotlin.Int? = null, fi3: kotlin.Int, fn0: kotlin.Double? = 10.0.toDouble(), fn1: kotlin.Double = 71.0.toDouble(), fn2: kotlin.Double? = null, fn3: kotlin.Double, fn4: kotlin.collections.List): HttpResponse { val localVariableAuthNames = listOf() @@ -115,6 +116,7 @@ open class DefaultApi : ApiClient { qn1?.apply { localVariableQuery["qn1"] = listOf("$qn1") } qn2?.apply { localVariableQuery["qn2"] = listOf("$qn2") } qn3?.apply { localVariableQuery["qn3"] = listOf("$qn3") } + qs0?.apply { localVariableQuery["qs0"] = listOf("$qs0") } val localVariableHeaders = mutableMapOf() hi0?.apply { localVariableHeaders["hi0"] = this.toString() } hi1?.apply { localVariableHeaders["hi1"] = this.toString() } diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt index b637884e85c9..302d967d4267 100644 --- a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt @@ -35,6 +35,7 @@ import kotlinx.serialization.encoding.* * @param n0 * @param i1 * @param n1 + * @param s0 String property with $dollar, backslash, quote, comment-close in default */ @Serializable @@ -46,7 +47,10 @@ data class Apa ( @SerialName(value = "i1") val i1: kotlin.Int? = null, - @SerialName(value = "n1") val n1: kotlin.Double? = null + @SerialName(value = "n1") val n1: kotlin.Double? = null, + + /* String property with $dollar, backslash, quote, comment-close in default */ + @SerialName(value = "s0") val s0: kotlin.String? = "hello \$world, backslash=\\, quote=\", end */" ) { diff --git a/samples/client/petstore/kotlin-explicit/docs/PetApi.md b/samples/client/petstore/kotlin-explicit/docs/PetApi.md index 6856ea516dab..01b4ba0c63fd 100644 --- a/samples/client/petstore/kotlin-explicit/docs/PetApi.md +++ b/samples/client/petstore/kotlin-explicit/docs/PetApi.md @@ -86,9 +86,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -324,10 +324,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -374,10 +374,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-explicit/docs/StoreApi.md b/samples/client/petstore/kotlin-explicit/docs/StoreApi.md index 53ff17b16676..b19af1a400ef 100644 --- a/samples/client/petstore/kotlin-explicit/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-explicit/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-explicit/docs/UserApi.md b/samples/client/petstore/kotlin-explicit/docs/UserApi.md index 82c8d6060276..60f2a26559de 100644 --- a/samples/client/petstore/kotlin-explicit/docs/UserApi.md +++ b/samples/client/petstore/kotlin-explicit/docs/UserApi.md @@ -262,9 +262,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -349,9 +349,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-gson/docs/PetApi.md b/samples/client/petstore/kotlin-gson/docs/PetApi.md index e0bf879c9a65..b063e869b3ff 100644 --- a/samples/client/petstore/kotlin-gson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-gson/docs/PetApi.md @@ -91,9 +91,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -334,10 +334,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -386,10 +386,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-gson/docs/StoreApi.md b/samples/client/petstore/kotlin-gson/docs/StoreApi.md index bfbf6c75d797..c8cd9c416773 100644 --- a/samples/client/petstore/kotlin-gson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-gson/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-gson/docs/UserApi.md b/samples/client/petstore/kotlin-gson/docs/UserApi.md index fb5bfa6c7a44..1a61b0b068ac 100644 --- a/samples/client/petstore/kotlin-gson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-gson/docs/UserApi.md @@ -282,9 +282,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -374,9 +374,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jackson/docs/PetApi.md b/samples/client/petstore/kotlin-jackson/docs/PetApi.md index 6856ea516dab..01b4ba0c63fd 100644 --- a/samples/client/petstore/kotlin-jackson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jackson/docs/PetApi.md @@ -86,9 +86,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -324,10 +324,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -374,10 +374,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jackson/docs/StoreApi.md b/samples/client/petstore/kotlin-jackson/docs/StoreApi.md index 53ff17b16676..b19af1a400ef 100644 --- a/samples/client/petstore/kotlin-jackson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jackson/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-jackson/docs/UserApi.md b/samples/client/petstore/kotlin-jackson/docs/UserApi.md index 82c8d6060276..60f2a26559de 100644 --- a/samples/client/petstore/kotlin-jackson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jackson/docs/UserApi.md @@ -262,9 +262,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -349,9 +349,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md b/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md index 318ca7c9e1e9..fac865b313fa 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md @@ -86,9 +86,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -322,10 +322,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -372,10 +372,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-json-request-string/docs/StoreApi.md b/samples/client/petstore/kotlin-json-request-string/docs/StoreApi.md index 53ff17b16676..b19af1a400ef 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-json-request-string/docs/UserApi.md b/samples/client/petstore/kotlin-json-request-string/docs/UserApi.md index 82c8d6060276..60f2a26559de 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/UserApi.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/UserApi.md @@ -262,9 +262,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -349,9 +349,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-jackson/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-jackson/docs/PetApi.md index 01ad4cac6196..4cfaaaa72a8d 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-jackson/docs/PetApi.md @@ -72,9 +72,9 @@ webService.deletePet(petId, apiKey) ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -260,10 +260,10 @@ webService.updatePetWithForm(petId, name, status) ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -301,10 +301,10 @@ val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-jackson/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-jackson/docs/StoreApi.md index 34b0e0700a72..6448b963dc71 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-jackson/docs/StoreApi.md @@ -84,7 +84,7 @@ This endpoint does not need any parameter. Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-jvm-jackson/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-jackson/docs/UserApi.md index 20a1ac7703b4..040d8c29ebd7 100644 --- a/samples/client/petstore/kotlin-jvm-jackson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-jackson/docs/UserApi.md @@ -220,9 +220,9 @@ val result : kotlin.String = webService.loginUser(username, password) ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -293,9 +293,9 @@ webService.updateUser(username, user) ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/.openapi-generator/FILES b/samples/client/petstore/kotlin-jvm-ktor-gson/.openapi-generator/FILES index 1b45f7fe9a51..43f9908db67c 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/.openapi-generator/FILES @@ -9,6 +9,7 @@ docs/FakeApi.md docs/Order.md docs/Pet.md docs/PetApi.md +docs/PetWithSpecialProps.md docs/StoreApi.md docs/Tag.md docs/User.md @@ -41,6 +42,7 @@ src/main/kotlin/org/openapitools/client/models/Category.kt src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt +src/main/kotlin/org/openapitools/client/models/PetWithSpecialProps.kt src/main/kotlin/org/openapitools/client/models/Tag.kt src/main/kotlin/org/openapitools/client/models/User.kt src/main/kotlin/org/openapitools/client/models/UserOrPet.kt diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/README.md b/samples/client/petstore/kotlin-jvm-ktor-gson/README.md index 91f2aaef0496..0af9818c3d26 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/README.md +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/README.md @@ -79,6 +79,7 @@ All URIs are relative to *http://petstore.swagger.io/v2* - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.PetWithSpecialProps](docs/PetWithSpecialProps.md) - [org.openapitools.client.models.Tag](docs/Tag.md) - [org.openapitools.client.models.User](docs/User.md) - [org.openapitools.client.models.UserOrPet](docs/UserOrPet.md) diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/FakeApi.md b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/FakeApi.md index 5d6e47a6f2b3..1feb66aa8768 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/FakeApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/FakeApi.md @@ -82,11 +82,11 @@ try { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **petId** | **kotlin.Long**| ID of pet that needs to be updated | | | **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.Int**| integer type | [optional] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **status2** | **java.math.BigDecimal**| number type | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/PetApi.md index 0a13a8fa8ce3..4a37a0f36320 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/PetApi.md @@ -91,9 +91,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -334,10 +334,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -386,10 +386,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **io.ktor.client.request.forms.FormPart<io.ktor.client.request.forms.InputProvider>**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/PetWithSpecialProps.md b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/PetWithSpecialProps.md new file mode 100644 index 000000000000..53fe36ec810a --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/PetWithSpecialProps.md @@ -0,0 +1,11 @@ + +# PetWithSpecialProps + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **dollarId** | **kotlin.String** | Property with \$-prefix in name; default has \$dollar and backslash \\ | [optional] | +| **nameDollarSuffix** | **kotlin.String** | Property with \$ mid-name; description has backslash \\ and quote " | [optional] | + + + diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/StoreApi.md index aac02408ec79..091727af5301 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/UserApi.md index 055b9506b4d2..2f6624a3e34a 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-gson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/docs/UserApi.md @@ -282,9 +282,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -374,9 +374,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/PetWithSpecialProps.kt b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/PetWithSpecialProps.kt new file mode 100644 index 000000000000..f02ff8067716 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/src/main/kotlin/org/openapitools/client/models/PetWithSpecialProps.kt @@ -0,0 +1,51 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName + +/** + * Model with $-prefixed property names for escaping tests (Issue 20502) + * + * @param dollarId Property with $-prefix in name; default has $dollar and backslash \\ + * @param nameDollarSuffix Property with $ mid-name; description has backslash \\ and quote \" + */ + + +data class PetWithSpecialProps ( + + /* Property with $-prefix in name; default has $dollar and backslash \\ */ + @SerializedName("\$id") + val dollarId: kotlin.String? = "hello \$world", + + /* Property with $ mid-name; description has backslash \\ and quote \" */ + @SerializedName("name\$Suffix") + val nameDollarSuffix: kotlin.String? = null + +) { + + +} + diff --git a/samples/client/petstore/kotlin-jvm-ktor-gson/src/test/kotlin/org/openapitools/client/models/PetWithSpecialPropsTest.kt b/samples/client/petstore/kotlin-jvm-ktor-gson/src/test/kotlin/org/openapitools/client/models/PetWithSpecialPropsTest.kt new file mode 100644 index 000000000000..ba24493a7f26 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-ktor-gson/src/test/kotlin/org/openapitools/client/models/PetWithSpecialPropsTest.kt @@ -0,0 +1,49 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.PetWithSpecialProps + +class PetWithSpecialPropsTest : ShouldSpec() { + init { + // uncomment below to create an instance of PetWithSpecialProps + //val modelInstance = PetWithSpecialProps() + + // to test the property `dollarId` - Property with $-prefix in name; default has $dollar and backslash \\ + should("test dollarId") { + // uncomment below to test the property + //modelInstance.dollarId shouldBe ("TODO") + } + + // to test the property `nameDollarSuffix` - Property with $ mid-name; description has backslash \\ and quote \" + should("test nameDollarSuffix") { + // uncomment below to test the property + //modelInstance.nameDollarSuffix shouldBe ("TODO") + } + + } +} diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/PetApi.md index 0b928e328e60..7ff44b2b42e1 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/PetApi.md @@ -86,9 +86,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -324,10 +324,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -374,10 +374,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **io.ktor.client.request.forms.FormPart<io.ktor.client.request.forms.InputProvider>**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/StoreApi.md index 27694e9e7100..d6f7e52c88ab 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/UserApi.md index 6a4403972b4d..65848260626b 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-jackson/docs/UserApi.md @@ -262,9 +262,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -349,9 +349,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/PetApi.md index 0a13a8fa8ce3..4a37a0f36320 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/PetApi.md @@ -91,9 +91,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -334,10 +334,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -386,10 +386,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **io.ktor.client.request.forms.FormPart<io.ktor.client.request.forms.InputProvider>**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/StoreApi.md index aac02408ec79..091727af5301 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/UserApi.md index 055b9506b4d2..2f6624a3e34a 100644 --- a/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-ktor-kotlinx_serialization/docs/UserApi.md @@ -282,9 +282,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -374,9 +374,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md index 6856ea516dab..01b4ba0c63fd 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md @@ -86,9 +86,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -324,10 +324,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -374,10 +374,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md index 53ff17b16676..b19af1a400ef 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md index 82c8d6060276..60f2a26559de 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md @@ -262,9 +262,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -349,9 +349,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/PetApi.md index bf8668b04061..88589011a3df 100644 --- a/samples/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/PetApi.md @@ -76,9 +76,9 @@ launch(Dispatchers.IO) { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -274,10 +274,10 @@ launch(Dispatchers.IO) { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -317,10 +317,10 @@ launch(Dispatchers.IO) { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/StoreApi.md index bbc53bb2f774..dd4ba6708459 100644 --- a/samples/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/StoreApi.md @@ -88,7 +88,7 @@ This endpoint does not need any parameter. Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/UserApi.md index 063d54bbcb50..f0d2e229efb3 100644 --- a/samples/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-retrofit2-coroutines/docs/UserApi.md @@ -232,9 +232,9 @@ launch(Dispatchers.IO) { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -309,9 +309,9 @@ launch(Dispatchers.IO) { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/PetApi.md index 9eb15f0e7013..44ddf2bd9f44 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/PetApi.md @@ -91,9 +91,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -334,10 +334,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -386,10 +386,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/StoreApi.md index aac02408ec79..091727af5301 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/UserApi.md index 055b9506b4d2..2f6624a3e34a 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/docs/UserApi.md @@ -282,9 +282,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -374,9 +374,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/PetApi.md index 9eb15f0e7013..44ddf2bd9f44 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/PetApi.md @@ -91,9 +91,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -334,10 +334,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -386,10 +386,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/StoreApi.md index aac02408ec79..091727af5301 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/UserApi.md index 055b9506b4d2..2f6624a3e34a 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/docs/UserApi.md @@ -282,9 +282,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -374,9 +374,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/PetApi.md index 9eb15f0e7013..44ddf2bd9f44 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/PetApi.md @@ -91,9 +91,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -334,10 +334,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -386,10 +386,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/StoreApi.md index aac02408ec79..091727af5301 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/UserApi.md index 055b9506b4d2..2f6624a3e34a 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/docs/UserApi.md @@ -282,9 +282,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -374,9 +374,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/PetApi.md index 9eb15f0e7013..44ddf2bd9f44 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/PetApi.md @@ -91,9 +91,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -334,10 +334,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -386,10 +386,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/StoreApi.md index aac02408ec79..091727af5301 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/UserApi.md index 055b9506b4d2..2f6624a3e34a 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-gson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-gson/docs/UserApi.md @@ -282,9 +282,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -374,9 +374,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/PetApi.md index 9eb15f0e7013..44ddf2bd9f44 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/PetApi.md @@ -91,9 +91,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -334,10 +334,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -386,10 +386,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/StoreApi.md index aac02408ec79..091727af5301 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/UserApi.md index 055b9506b4d2..2f6624a3e34a 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson-coroutines/docs/UserApi.md @@ -282,9 +282,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -374,9 +374,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/PetApi.md index 9eb15f0e7013..44ddf2bd9f44 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/PetApi.md @@ -91,9 +91,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -334,10 +334,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -386,10 +386,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/StoreApi.md index aac02408ec79..091727af5301 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/UserApi.md index 055b9506b4d2..2f6624a3e34a 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-jackson/docs/UserApi.md @@ -282,9 +282,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -374,9 +374,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/PetApi.md index 9eb15f0e7013..44ddf2bd9f44 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/PetApi.md @@ -91,9 +91,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -334,10 +334,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -386,10 +386,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/StoreApi.md index aac02408ec79..091727af5301 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/UserApi.md index 055b9506b4d2..2f6624a3e34a 100644 --- a/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-vertx-moshi/docs/UserApi.md @@ -282,9 +282,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -374,9 +374,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/docs/PetApi.md b/samples/client/petstore/kotlin-kotlinx-datetime/docs/PetApi.md index 6856ea516dab..01b4ba0c63fd 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/docs/PetApi.md +++ b/samples/client/petstore/kotlin-kotlinx-datetime/docs/PetApi.md @@ -86,9 +86,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -324,10 +324,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -374,10 +374,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/docs/StoreApi.md b/samples/client/petstore/kotlin-kotlinx-datetime/docs/StoreApi.md index 53ff17b16676..b19af1a400ef 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-kotlinx-datetime/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-kotlinx-datetime/docs/UserApi.md b/samples/client/petstore/kotlin-kotlinx-datetime/docs/UserApi.md index 82c8d6060276..60f2a26559de 100644 --- a/samples/client/petstore/kotlin-kotlinx-datetime/docs/UserApi.md +++ b/samples/client/petstore/kotlin-kotlinx-datetime/docs/UserApi.md @@ -262,9 +262,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -349,9 +349,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/.openapi-generator/FILES b/samples/client/petstore/kotlin-model-prefix-type-mappings/.openapi-generator/FILES index 2b66c25862d7..346027c8e906 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/.openapi-generator/FILES @@ -9,6 +9,7 @@ docs/FakeApi.md docs/Order.md docs/Pet.md docs/PetApi.md +docs/PetWithSpecialProps.md docs/StoreApi.md docs/Tag.md docs/User.md @@ -43,6 +44,7 @@ src/main/kotlin/org/openapitools/client/models/ApiApiResponse.kt src/main/kotlin/org/openapitools/client/models/ApiCategory.kt src/main/kotlin/org/openapitools/client/models/ApiOrder.kt src/main/kotlin/org/openapitools/client/models/ApiPet.kt +src/main/kotlin/org/openapitools/client/models/ApiPetWithSpecialProps.kt src/main/kotlin/org/openapitools/client/models/ApiTag.kt src/main/kotlin/org/openapitools/client/models/ApiUser.kt src/main/kotlin/org/openapitools/client/models/ApiUserOrPet.kt diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/README.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/README.md index 4df15b93200e..429aaf68d771 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/README.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/README.md @@ -79,6 +79,7 @@ All URIs are relative to *http://petstore.swagger.io/v2* - [org.openapitools.client.models.ApiCategory](docs/ApiCategory.md) - [org.openapitools.client.models.ApiOrder](docs/ApiOrder.md) - [org.openapitools.client.models.ApiPet](docs/ApiPet.md) + - [org.openapitools.client.models.ApiPetWithSpecialProps](docs/ApiPetWithSpecialProps.md) - [org.openapitools.client.models.ApiTag](docs/ApiTag.md) - [org.openapitools.client.models.ApiUser](docs/ApiUser.md) - [org.openapitools.client.models.ApiUserOrPet](docs/ApiUserOrPet.md) diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/FakeApi.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/FakeApi.md index 86d58dbcdbff..f536bc0e9216 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/FakeApi.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/FakeApi.md @@ -70,11 +70,11 @@ launch(Dispatchers.IO) { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **petId** | **kotlin.Long**| ID of pet that needs to be updated | | | **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.Int**| integer type | [optional] | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **status2** | **java.math.BigDecimal**| number type | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/PetApi.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/PetApi.md index 39e16a953bc5..b6be418a6da2 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/PetApi.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/PetApi.md @@ -76,9 +76,9 @@ launch(Dispatchers.IO) { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -274,10 +274,10 @@ launch(Dispatchers.IO) { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -317,10 +317,10 @@ launch(Dispatchers.IO) { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **RequestBody**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/PetWithSpecialProps.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/PetWithSpecialProps.md new file mode 100644 index 000000000000..6ea7aeb3180d --- /dev/null +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/PetWithSpecialProps.md @@ -0,0 +1,11 @@ + +# ApiPetWithSpecialProps + +## Properties +| Name | Type | Description | Notes | +| ------------ | ------------- | ------------- | ------------- | +| **dollarId** | **kotlin.String** | Property with \$-prefix in name; default has \$dollar and backslash \\ | [optional] | +| **nameDollarSuffix** | **kotlin.String** | Property with \$ mid-name; description has backslash \\ and quote " | [optional] | + + + diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/StoreApi.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/StoreApi.md index 53388dff3032..185f1ce4e3c7 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/StoreApi.md @@ -88,7 +88,7 @@ This endpoint does not need any parameter. Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/UserApi.md b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/UserApi.md index 758eb5efcedd..9e2abc50e558 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/UserApi.md +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/docs/UserApi.md @@ -232,9 +232,9 @@ launch(Dispatchers.IO) { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -309,9 +309,9 @@ launch(Dispatchers.IO) { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **apiUser** | [**ApiUser**](ApiUser.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 085e5e1fe1e2..61812e3b4a54 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -71,7 +71,7 @@ class ApiClient( okHttpClientBuilder: OkHttpClient.Builder? = null, serializerBuilder: GsonBuilder = Serializer.gsonBuilder, authNames: Array - ) : this(baseUrl, okHttpClientBuilder, serializerBuilder) { + ) : this(baseUrl, okHttpClientBuilder, registerTypeAdapterFactoryForAllModels(serializerBuilder)) { authNames.forEach { authName -> val auth: Interceptor? = when (authName) { "petstore_auth" -> OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets") @@ -84,17 +84,6 @@ class ApiClient( addAuthorization(authName, auth) } } - serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiAnnotation.CustomTypeAdapterFactory()) - serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiAnyOfUserOrPet.CustomTypeAdapterFactory()) - serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiAnyOfUserOrPetOrArrayString.CustomTypeAdapterFactory()) - serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiApiResponse.CustomTypeAdapterFactory()) - serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiCategory.CustomTypeAdapterFactory()) - serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiOrder.CustomTypeAdapterFactory()) - serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiPet.CustomTypeAdapterFactory()) - serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiTag.CustomTypeAdapterFactory()) - serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiUser.CustomTypeAdapterFactory()) - serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiUserOrPet.CustomTypeAdapterFactory()) - serializerBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiUserOrPetOrArrayString.CustomTypeAdapterFactory()) } constructor( @@ -259,6 +248,7 @@ fun registerTypeAdapterFactoryForAllModels(gsonBuilder: GsonBuilder): GsonBuilde gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiCategory.CustomTypeAdapterFactory()) gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiOrder.CustomTypeAdapterFactory()) gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiPet.CustomTypeAdapterFactory()) + gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiPetWithSpecialProps.CustomTypeAdapterFactory()) gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiTag.CustomTypeAdapterFactory()) gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiUser.CustomTypeAdapterFactory()) gsonBuilder.registerTypeAdapterFactory(org.openapitools.client.models.ApiUserOrPet.CustomTypeAdapterFactory()) diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index 1426926f13fc..1b94e3943802 100644 --- a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -21,6 +21,7 @@ object Serializer { .registerTypeAdapterFactory(org.openapitools.client.models.ApiCategory.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(org.openapitools.client.models.ApiOrder.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(org.openapitools.client.models.ApiPet.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(org.openapitools.client.models.ApiPetWithSpecialProps.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(org.openapitools.client.models.ApiTag.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(org.openapitools.client.models.ApiUser.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(org.openapitools.client.models.ApiUserOrPet.CustomTypeAdapterFactory()) diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiPetWithSpecialProps.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiPetWithSpecialProps.kt new file mode 100644 index 000000000000..bece1d3997aa --- /dev/null +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/main/kotlin/org/openapitools/client/models/ApiPetWithSpecialProps.kt @@ -0,0 +1,124 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.models + + +import com.google.gson.Gson +import com.google.gson.JsonElement +import com.google.gson.TypeAdapter +import com.google.gson.TypeAdapterFactory +import com.google.gson.reflect.TypeToken +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.annotations.JsonAdapter +import java.io.IOException +import com.google.gson.annotations.SerializedName + +/** + * Model with $-prefixed property names for escaping tests (Issue 20502) + * + * @param dollarId Property with $-prefix in name; default has $dollar and backslash \\ + * @param nameDollarSuffix Property with $ mid-name; description has backslash \\ and quote \" + */ + + +data class ApiPetWithSpecialProps ( + + /* Property with $-prefix in name; default has $dollar and backslash \\ */ + @SerializedName("\$id") + val dollarId: kotlin.String? = "hello \$world", + + /* Property with $ mid-name; description has backslash \\ and quote \" */ + @SerializedName("name\$Suffix") + val nameDollarSuffix: kotlin.String? = null + +) { + + + class CustomTypeAdapterFactory : TypeAdapterFactory { + override fun create(gson: Gson, type: TypeToken): TypeAdapter? { + if (!ApiPetWithSpecialProps::class.java.isAssignableFrom(type.rawType)) { + return null // this class only serializes 'ApiPetWithSpecialProps' and its subtypes + } + val elementAdapter = gson.getAdapter(JsonElement::class.java) + val thisAdapter = gson.getDelegateAdapter(this, TypeToken.get(ApiPetWithSpecialProps::class.java)) + + @Suppress("UNCHECKED_CAST") + return object : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter, value: ApiPetWithSpecialProps) { + val obj = thisAdapter.toJsonTree(value).getAsJsonObject() + elementAdapter.write(out, obj) + } + + @Throws(IOException::class) + override fun read(jsonReader: JsonReader): ApiPetWithSpecialProps { + val jsonElement = elementAdapter.read(jsonReader) + validateJsonElement(jsonElement) + return thisAdapter.fromJsonTree(jsonElement) + } + }.nullSafe() as TypeAdapter + } + } + + companion object { + var openapiFields = HashSet() + var openapiRequiredFields = HashSet() + + init { + // a set of all properties/fields (JSON key names) + openapiFields.add("\$id") + openapiFields.add("name\$Suffix") + + } + + /** + * Validates the JSON Element and throws an exception if issues found + * + * @param jsonElement JSON Element + * @throws IOException if the JSON Element is invalid with respect to ApiPetWithSpecialProps + */ + @Throws(IOException::class) + fun validateJsonElement(jsonElement: JsonElement?) { + if (jsonElement == null) { + require(openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + String.format("The required field(s) %s in ApiPetWithSpecialProps is not found in the empty JSON string", ApiPetWithSpecialProps.openapiRequiredFields.toString()) + } + } + val jsonObj = jsonElement!!.getAsJsonObject() + if (jsonObj["\$id"] != null && !jsonObj["\$id"].isJsonNull) { + require(jsonObj.get("\$id").isJsonPrimitive) { + String.format("Expected the field `\$id` to be a primitive type in the JSON string but got `%s`", jsonObj["\$id"].toString()) + } + } + if (jsonObj["name\$Suffix"] != null && !jsonObj["name\$Suffix"].isJsonNull) { + require(jsonObj.get("name\$Suffix").isJsonPrimitive) { + String.format("Expected the field `name\$Suffix` to be a primitive type in the JSON string but got `%s`", jsonObj["name\$Suffix"].toString()) + } + } + } + } + +} + diff --git a/samples/client/petstore/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/PetWithSpecialPropsTest.kt b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/PetWithSpecialPropsTest.kt new file mode 100644 index 000000000000..e345bb576354 --- /dev/null +++ b/samples/client/petstore/kotlin-model-prefix-type-mappings/src/test/kotlin/org/openapitools/client/models/PetWithSpecialPropsTest.kt @@ -0,0 +1,49 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "DuplicatedCode", + "EnumEntryName", + "RemoveRedundantQualifierName", + "RemoveRedundantCallsOfConversionMethods", + "REDUNDANT_CALL_OF_CONVERSION_METHOD", + "RedundantUnitReturnType", + "RemoveEmptyClassBody", + "UnnecessaryVariable", + "UnusedImport", + "UnnecessaryVariable", + "unused" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.ApiPetWithSpecialProps + +class ApiPetWithSpecialPropsTest : ShouldSpec() { + init { + // uncomment below to create an instance of ApiPetWithSpecialProps + //val modelInstance = ApiPetWithSpecialProps() + + // to test the property `dollarId` - Property with $-prefix in name; default has $dollar and backslash \\ + should("test dollarId") { + // uncomment below to test the property + //modelInstance.dollarId shouldBe ("TODO") + } + + // to test the property `nameDollarSuffix` - Property with $ mid-name; description has backslash \\ and quote \" + should("test nameDollarSuffix") { + // uncomment below to test the property + //modelInstance.nameDollarSuffix shouldBe ("TODO") + } + + } +} diff --git a/samples/client/petstore/kotlin-modelMutable/docs/PetApi.md b/samples/client/petstore/kotlin-modelMutable/docs/PetApi.md index e385754514fb..bf37d588f62e 100644 --- a/samples/client/petstore/kotlin-modelMutable/docs/PetApi.md +++ b/samples/client/petstore/kotlin-modelMutable/docs/PetApi.md @@ -86,9 +86,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -324,10 +324,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -374,10 +374,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-modelMutable/docs/StoreApi.md b/samples/client/petstore/kotlin-modelMutable/docs/StoreApi.md index 9d9f4c673e6f..44d1a3b65b33 100644 --- a/samples/client/petstore/kotlin-modelMutable/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-modelMutable/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-modelMutable/docs/UserApi.md b/samples/client/petstore/kotlin-modelMutable/docs/UserApi.md index b13c0b7f4d78..7ea8319001e9 100644 --- a/samples/client/petstore/kotlin-modelMutable/docs/UserApi.md +++ b/samples/client/petstore/kotlin-modelMutable/docs/UserApi.md @@ -262,9 +262,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -349,9 +349,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md b/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md index 6856ea516dab..01b4ba0c63fd 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md @@ -86,9 +86,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -324,10 +324,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -374,10 +374,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/StoreApi.md b/samples/client/petstore/kotlin-moshi-codegen/docs/StoreApi.md index 53ff17b16676..b19af1a400ef 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/UserApi.md b/samples/client/petstore/kotlin-moshi-codegen/docs/UserApi.md index 82c8d6060276..60f2a26559de 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/UserApi.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/UserApi.md @@ -262,9 +262,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -349,9 +349,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-multiplatform-allOf-discriminator/docs/BirdApi.md b/samples/client/petstore/kotlin-multiplatform-allOf-discriminator/docs/BirdApi.md index af920447b8c4..0a62db6b1bf2 100644 --- a/samples/client/petstore/kotlin-multiplatform-allOf-discriminator/docs/BirdApi.md +++ b/samples/client/petstore/kotlin-multiplatform-allOf-discriminator/docs/BirdApi.md @@ -80,9 +80,9 @@ try { ``` ### Parameters -| **metadata** | [**Bird**](Bird.md)| | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **metadata** | [**Bird**](Bird.md)| | | | **file** | **io.ktor.client.request.forms.FormPart<io.ktor.client.request.forms.InputProvider>**| | | ### Return type diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/PetApi.md b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/PetApi.md index 0b928e328e60..7ff44b2b42e1 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/PetApi.md +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/PetApi.md @@ -86,9 +86,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -324,10 +324,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -374,10 +374,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **io.ktor.client.request.forms.FormPart<io.ktor.client.request.forms.InputProvider>**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/StoreApi.md b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/StoreApi.md index 27694e9e7100..d6f7e52c88ab 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/UserApi.md b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/UserApi.md index 6a4403972b4d..65848260626b 100644 --- a/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/UserApi.md +++ b/samples/client/petstore/kotlin-multiplatform-kotlinx-datetime/docs/UserApi.md @@ -262,9 +262,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -349,9 +349,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md b/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md index 0b928e328e60..7ff44b2b42e1 100644 --- a/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md +++ b/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md @@ -86,9 +86,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -324,10 +324,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -374,10 +374,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **io.ktor.client.request.forms.FormPart<io.ktor.client.request.forms.InputProvider>**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-multiplatform/docs/StoreApi.md b/samples/client/petstore/kotlin-multiplatform/docs/StoreApi.md index 27694e9e7100..d6f7e52c88ab 100644 --- a/samples/client/petstore/kotlin-multiplatform/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-multiplatform/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-multiplatform/docs/UserApi.md b/samples/client/petstore/kotlin-multiplatform/docs/UserApi.md index 6a4403972b4d..65848260626b 100644 --- a/samples/client/petstore/kotlin-multiplatform/docs/UserApi.md +++ b/samples/client/petstore/kotlin-multiplatform/docs/UserApi.md @@ -262,9 +262,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -349,9 +349,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-name-parameter-mappings/docs/FakeApi.md b/samples/client/petstore/kotlin-name-parameter-mappings/docs/FakeApi.md index 42a6f3a9551b..42b0584b85fb 100644 --- a/samples/client/petstore/kotlin-name-parameter-mappings/docs/FakeApi.md +++ b/samples/client/petstore/kotlin-name-parameter-mappings/docs/FakeApi.md @@ -37,11 +37,11 @@ try { ``` ### Parameters +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | | **underscoreType** | **kotlin.Long**| _type | | | **type** | **kotlin.String**| type | | | **typeWithUnderscore** | **kotlin.String**| type_ | | -| Name | Type | Description | Notes | -| ------------- | ------------- | ------------- | ------------- | | **httpDebugOption** | **kotlin.String**| http debug option (to test parameter naming option) | | ### Return type diff --git a/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md b/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md index 6856ea516dab..01b4ba0c63fd 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md @@ -86,9 +86,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -324,10 +324,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -374,10 +374,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-nonpublic/docs/StoreApi.md b/samples/client/petstore/kotlin-nonpublic/docs/StoreApi.md index 53ff17b16676..b19af1a400ef 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-nonpublic/docs/UserApi.md b/samples/client/petstore/kotlin-nonpublic/docs/UserApi.md index 82c8d6060276..60f2a26559de 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/UserApi.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/UserApi.md @@ -262,9 +262,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -349,9 +349,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-nullable/docs/PetApi.md b/samples/client/petstore/kotlin-nullable/docs/PetApi.md index c34fce5f4a46..ffd7840858ee 100644 --- a/samples/client/petstore/kotlin-nullable/docs/PetApi.md +++ b/samples/client/petstore/kotlin-nullable/docs/PetApi.md @@ -86,9 +86,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -324,10 +324,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -374,10 +374,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-nullable/docs/StoreApi.md b/samples/client/petstore/kotlin-nullable/docs/StoreApi.md index 7a65eab968d3..69663a68eff2 100644 --- a/samples/client/petstore/kotlin-nullable/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-nullable/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-nullable/docs/UserApi.md b/samples/client/petstore/kotlin-nullable/docs/UserApi.md index 9f71f2df6933..5efced49d01b 100644 --- a/samples/client/petstore/kotlin-nullable/docs/UserApi.md +++ b/samples/client/petstore/kotlin-nullable/docs/UserApi.md @@ -262,9 +262,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -349,9 +349,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/docs/PetApi.md b/samples/client/petstore/kotlin-retrofit2-jackson/docs/PetApi.md index 01ad4cac6196..4cfaaaa72a8d 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-retrofit2-jackson/docs/PetApi.md @@ -72,9 +72,9 @@ webService.deletePet(petId, apiKey) ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -260,10 +260,10 @@ webService.updatePetWithForm(petId, name, status) ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -301,10 +301,10 @@ val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/docs/StoreApi.md b/samples/client/petstore/kotlin-retrofit2-jackson/docs/StoreApi.md index 34b0e0700a72..6448b963dc71 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-retrofit2-jackson/docs/StoreApi.md @@ -84,7 +84,7 @@ This endpoint does not need any parameter. Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-retrofit2-jackson/docs/UserApi.md b/samples/client/petstore/kotlin-retrofit2-jackson/docs/UserApi.md index 20a1ac7703b4..040d8c29ebd7 100644 --- a/samples/client/petstore/kotlin-retrofit2-jackson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-retrofit2-jackson/docs/UserApi.md @@ -220,9 +220,9 @@ val result : kotlin.String = webService.loginUser(username, password) ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -293,9 +293,9 @@ webService.updateUser(username, user) ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **user** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/PetApi.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/PetApi.md index 7325e9a54129..c7daeadece1a 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/PetApi.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/PetApi.md @@ -68,9 +68,9 @@ webService.deletePet(petId, apiKey) ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -252,10 +252,10 @@ webService.updatePetWithForm(petId, name, status) ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -291,10 +291,10 @@ val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/StoreApi.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/StoreApi.md index 18640563db31..ded29cf05361 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/StoreApi.md @@ -84,7 +84,7 @@ This endpoint does not need any parameter. Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/UserApi.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/UserApi.md index ccd41ae2a462..26dca483feae 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/UserApi.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/UserApi.md @@ -212,9 +212,9 @@ val result : kotlin.String = webService.loginUser(username, password) ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -283,9 +283,9 @@ webService.updateUser(username, body) ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/docs/PetApi.md b/samples/client/petstore/kotlin-retrofit2-rx3/docs/PetApi.md index 7325e9a54129..c7daeadece1a 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/docs/PetApi.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/docs/PetApi.md @@ -68,9 +68,9 @@ webService.deletePet(petId, apiKey) ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -252,10 +252,10 @@ webService.updatePetWithForm(petId, name, status) ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -291,10 +291,10 @@ val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/docs/StoreApi.md b/samples/client/petstore/kotlin-retrofit2-rx3/docs/StoreApi.md index 18640563db31..ded29cf05361 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/docs/StoreApi.md @@ -84,7 +84,7 @@ This endpoint does not need any parameter. Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/docs/UserApi.md b/samples/client/petstore/kotlin-retrofit2-rx3/docs/UserApi.md index ccd41ae2a462..26dca483feae 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/docs/UserApi.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/docs/UserApi.md @@ -212,9 +212,9 @@ val result : kotlin.String = webService.loginUser(username, password) ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -283,9 +283,9 @@ webService.updateUser(username, body) ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2/docs/PetApi.md b/samples/client/petstore/kotlin-retrofit2/docs/PetApi.md index 7325e9a54129..c7daeadece1a 100644 --- a/samples/client/petstore/kotlin-retrofit2/docs/PetApi.md +++ b/samples/client/petstore/kotlin-retrofit2/docs/PetApi.md @@ -68,9 +68,9 @@ webService.deletePet(petId, apiKey) ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -252,10 +252,10 @@ webService.updatePetWithForm(petId, name, status) ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -291,10 +291,10 @@ val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-retrofit2/docs/StoreApi.md b/samples/client/petstore/kotlin-retrofit2/docs/StoreApi.md index 18640563db31..ded29cf05361 100644 --- a/samples/client/petstore/kotlin-retrofit2/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-retrofit2/docs/StoreApi.md @@ -84,7 +84,7 @@ This endpoint does not need any parameter. Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-retrofit2/docs/UserApi.md b/samples/client/petstore/kotlin-retrofit2/docs/UserApi.md index ccd41ae2a462..26dca483feae 100644 --- a/samples/client/petstore/kotlin-retrofit2/docs/UserApi.md +++ b/samples/client/petstore/kotlin-retrofit2/docs/UserApi.md @@ -212,9 +212,9 @@ val result : kotlin.String = webService.loginUser(username, password) ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -283,9 +283,9 @@ webService.updateUser(username, body) ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-string/docs/PetApi.md b/samples/client/petstore/kotlin-string/docs/PetApi.md index ea42a0d82f60..7f7f2c672157 100644 --- a/samples/client/petstore/kotlin-string/docs/PetApi.md +++ b/samples/client/petstore/kotlin-string/docs/PetApi.md @@ -86,9 +86,9 @@ try { ``` ### Parameters -| **apiKey** | **kotlin.String**| | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **apiKey** | **kotlin.String**| | [optional] | | **petId** | **kotlin.Long**| Pet id to delete | | ### Return type @@ -324,10 +324,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -374,10 +374,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **kotlin.ByteArray**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-string/docs/StoreApi.md b/samples/client/petstore/kotlin-string/docs/StoreApi.md index 53ff17b16676..b19af1a400ef 100644 --- a/samples/client/petstore/kotlin-string/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-string/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-string/docs/UserApi.md b/samples/client/petstore/kotlin-string/docs/UserApi.md index 82c8d6060276..60f2a26559de 100644 --- a/samples/client/petstore/kotlin-string/docs/UserApi.md +++ b/samples/client/petstore/kotlin-string/docs/UserApi.md @@ -262,9 +262,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -349,9 +349,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md b/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md index 6856ea516dab..01b4ba0c63fd 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md @@ -86,9 +86,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -324,10 +324,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -374,10 +374,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md b/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md index 53ff17b16676..b19af1a400ef 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md b/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md index 82c8d6060276..60f2a26559de 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md @@ -262,9 +262,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -349,9 +349,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/client/petstore/kotlin/docs/PetApi.md b/samples/client/petstore/kotlin/docs/PetApi.md index 6856ea516dab..01b4ba0c63fd 100644 --- a/samples/client/petstore/kotlin/docs/PetApi.md +++ b/samples/client/petstore/kotlin/docs/PetApi.md @@ -86,9 +86,9 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| Pet id to delete | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| Pet id to delete | | | **apiKey** | **kotlin.String**| | [optional] | ### Return type @@ -324,10 +324,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | -| **name** | **kotlin.String**| Updated name of the pet | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet that needs to be updated | | +| **name** | **kotlin.String**| Updated name of the pet | [optional] | | **status** | **kotlin.String**| Updated status of the pet | [optional] | ### Return type @@ -374,10 +374,10 @@ try { ``` ### Parameters -| **petId** | **kotlin.Long**| ID of pet to update | | -| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **petId** | **kotlin.Long**| ID of pet to update | | +| **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] | | **file** | **java.io.File**| file to upload | [optional] | ### Return type diff --git a/samples/client/petstore/kotlin/docs/StoreApi.md b/samples/client/petstore/kotlin/docs/StoreApi.md index 53ff17b16676..b19af1a400ef 100644 --- a/samples/client/petstore/kotlin/docs/StoreApi.md +++ b/samples/client/petstore/kotlin/docs/StoreApi.md @@ -107,7 +107,7 @@ Configure api_key: Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/client/petstore/kotlin/docs/UserApi.md b/samples/client/petstore/kotlin/docs/UserApi.md index 82c8d6060276..60f2a26559de 100644 --- a/samples/client/petstore/kotlin/docs/UserApi.md +++ b/samples/client/petstore/kotlin/docs/UserApi.md @@ -262,9 +262,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| The user name for login | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| The user name for login | | | **password** | **kotlin.String**| The password for login in clear text | | ### Return type @@ -349,9 +349,9 @@ try { ``` ### Parameters -| **username** | **kotlin.String**| name that need to be deleted | | | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | +| **username** | **kotlin.String**| name that need to be deleted | | | **body** | [**User**](User.md)| Updated user object | | ### Return type diff --git a/samples/documentation/html/index.html b/samples/documentation/html/index.html index 81a6253d5e79..e97c154c4269 100644 --- a/samples/documentation/html/index.html +++ b/samples/documentation/html/index.html @@ -248,7 +248,7 @@

Request body

Pet Pet (required)
-
Body Parameter
+
Body Parameter — Pet object that needs to be added to the store
@@ -663,7 +663,7 @@

Request body

Pet Pet (required)
-
Body Parameter
+
Body Parameter — Pet object that needs to be added to the store
@@ -992,7 +992,7 @@

Request body

Order Order (required)
-
Body Parameter
+
Body Parameter — order placed for purchasing the pet
@@ -1064,7 +1064,7 @@

Request body

User User (required)
-
Body Parameter
+
Body Parameter — Created user object
@@ -1100,7 +1100,7 @@

Request body

User array[User] (required)
-
Body Parameter
+
Body Parameter — List of user object
@@ -1136,7 +1136,7 @@

Request body

User array[User] (required)
-
Body Parameter
+
Body Parameter — List of user object
@@ -1354,7 +1354,7 @@

Request body

User User (required)
-
Body Parameter
+
Body Parameter — Updated user object
diff --git a/samples/documentation/html2/index.html b/samples/documentation/html2/index.html index defce7cd6ce2..d74b2161a56e 100644 --- a/samples/documentation/html2/index.html +++ b/samples/documentation/html2/index.html @@ -1216,7 +1216,7 @@

Usage and SDK Samples

// Create an instance of the API class PetApi apiInstance = new PetApi(); - Pet pet = ; // Pet | + Pet pet = ; // Pet | Pet object that needs to be added to the store try { Pet result = apiInstance.addPet(pet); @@ -1235,7 +1235,7 @@

Usage and SDK Samples

final api_instance = DefaultApi(); -final Pet pet = new Pet(); // Pet | +final Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { final result = await api_instance.addPet(pet); @@ -1253,7 +1253,7 @@

Usage and SDK Samples

public class PetApiExample { public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet pet = ; // Pet | + Pet pet = ; // Pet | Pet object that needs to be added to the store try { Pet result = apiInstance.addPet(pet); @@ -1278,7 +1278,7 @@

Usage and SDK Samples

// Create an instance of the API class PetApi *apiInstance = [[PetApi alloc] init]; -Pet *pet = ; // +Pet *pet = ; // Pet object that needs to be added to the store // Add a new pet to the store [apiInstance addPetWith:pet @@ -1303,7 +1303,7 @@

Usage and SDK Samples

// Create an instance of the API class var api = new OpenApiPetstore.PetApi() -var pet = ; // {Pet} +var pet = ; // {Pet} Pet object that needs to be added to the store var callback = function(error, data, response) { if (error) { @@ -1337,7 +1337,7 @@

Usage and SDK Samples

// Create an instance of the API class var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | + var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { // Add a new pet to the store @@ -1361,7 +1361,7 @@

Usage and SDK Samples

// Create an instance of the API class $api_instance = new OpenAPITools\Client\Api\PetApi(); -$pet = ; // Pet | +$pet = ; // Pet | Pet object that needs to be added to the store try { $result = $api_instance->addPet($pet); @@ -1382,7 +1382,7 @@

Usage and SDK Samples

# Create an instance of the API class my $api_instance = WWW::OPenAPIClient::PetApi->new(); -my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | +my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store eval { my $result = $api_instance->addPet(pet => $pet); @@ -1405,7 +1405,7 @@

Usage and SDK Samples

# Create an instance of the API class api_instance = openapi_client.PetApi() -pet = # Pet | +pet = # Pet | Pet object that needs to be added to the store try: # Add a new pet to the store @@ -3668,7 +3668,7 @@

Usage and SDK Samples

// Create an instance of the API class PetApi apiInstance = new PetApi(); - Pet pet = ; // Pet | + Pet pet = ; // Pet | Pet object that needs to be added to the store try { Pet result = apiInstance.updatePet(pet); @@ -3687,7 +3687,7 @@

Usage and SDK Samples

final api_instance = DefaultApi(); -final Pet pet = new Pet(); // Pet | +final Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { final result = await api_instance.updatePet(pet); @@ -3705,7 +3705,7 @@

Usage and SDK Samples

public class PetApiExample { public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet pet = ; // Pet | + Pet pet = ; // Pet | Pet object that needs to be added to the store try { Pet result = apiInstance.updatePet(pet); @@ -3730,7 +3730,7 @@

Usage and SDK Samples

// Create an instance of the API class PetApi *apiInstance = [[PetApi alloc] init]; -Pet *pet = ; // +Pet *pet = ; // Pet object that needs to be added to the store // Update an existing pet [apiInstance updatePetWith:pet @@ -3755,7 +3755,7 @@

Usage and SDK Samples

// Create an instance of the API class var api = new OpenApiPetstore.PetApi() -var pet = ; // {Pet} +var pet = ; // {Pet} Pet object that needs to be added to the store var callback = function(error, data, response) { if (error) { @@ -3789,7 +3789,7 @@

Usage and SDK Samples

// Create an instance of the API class var apiInstance = new PetApi(); - var pet = new Pet(); // Pet | + var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { // Update an existing pet @@ -3813,7 +3813,7 @@

Usage and SDK Samples

// Create an instance of the API class $api_instance = new OpenAPITools\Client\Api\PetApi(); -$pet = ; // Pet | +$pet = ; // Pet | Pet object that needs to be added to the store try { $result = $api_instance->updatePet($pet); @@ -3834,7 +3834,7 @@

Usage and SDK Samples

# Create an instance of the API class my $api_instance = WWW::OPenAPIClient::PetApi->new(); -my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | +my $pet = WWW::OPenAPIClient::Object::Pet->new(); # Pet | Pet object that needs to be added to the store eval { my $result = $api_instance->updatePet(pet => $pet); @@ -3857,7 +3857,7 @@

Usage and SDK Samples

# Create an instance of the API class api_instance = openapi_client.PetApi() -pet = # Pet | +pet = # Pet | Pet object that needs to be added to the store try: # Update an existing pet @@ -6529,7 +6529,7 @@

Usage and SDK Samples

// Create an instance of the API class StoreApi apiInstance = new StoreApi(); - Order order = ; // Order | + Order order = ; // Order | order placed for purchasing the pet try { Order result = apiInstance.placeOrder(order); @@ -6548,7 +6548,7 @@

Usage and SDK Samples

final api_instance = DefaultApi(); -final Order order = new Order(); // Order | +final Order order = new Order(); // Order | order placed for purchasing the pet try { final result = await api_instance.placeOrder(order); @@ -6566,7 +6566,7 @@

Usage and SDK Samples

public class StoreApiExample { public static void main(String[] args) { StoreApi apiInstance = new StoreApi(); - Order order = ; // Order | + Order order = ; // Order | order placed for purchasing the pet try { Order result = apiInstance.placeOrder(order); @@ -6587,7 +6587,7 @@

Usage and SDK Samples

// Create an instance of the API class StoreApi *apiInstance = [[StoreApi alloc] init]; -Order *order = ; // +Order *order = ; // order placed for purchasing the pet // Place an order for a pet [apiInstance placeOrderWith:order @@ -6607,7 +6607,7 @@

Usage and SDK Samples

// Create an instance of the API class var api = new OpenApiPetstore.StoreApi() -var order = ; // {Order} +var order = ; // {Order} order placed for purchasing the pet var callback = function(error, data, response) { if (error) { @@ -6639,7 +6639,7 @@

Usage and SDK Samples

// Create an instance of the API class var apiInstance = new StoreApi(); - var order = new Order(); // Order | + var order = new Order(); // Order | order placed for purchasing the pet try { // Place an order for a pet @@ -6660,7 +6660,7 @@

Usage and SDK Samples

// Create an instance of the API class $api_instance = new OpenAPITools\Client\Api\StoreApi(); -$order = ; // Order | +$order = ; // Order | order placed for purchasing the pet try { $result = $api_instance->placeOrder($order); @@ -6678,7 +6678,7 @@

Usage and SDK Samples

# Create an instance of the API class my $api_instance = WWW::OPenAPIClient::StoreApi->new(); -my $order = WWW::OPenAPIClient::Object::Order->new(); # Order | +my $order = WWW::OPenAPIClient::Object::Order->new(); # Order | order placed for purchasing the pet eval { my $result = $api_instance->placeOrder(order => $order); @@ -6698,7 +6698,7 @@

Usage and SDK Samples

# Create an instance of the API class api_instance = openapi_client.StoreApi() -order = # Order | +order = # Order | order placed for purchasing the pet try: # Place an order for a pet @@ -7007,7 +7007,7 @@

Usage and SDK Samples

// Create an instance of the API class UserApi apiInstance = new UserApi(); - User user = ; // User | + User user = ; // User | Created user object try { apiInstance.createUser(user); @@ -7025,7 +7025,7 @@

Usage and SDK Samples

final api_instance = DefaultApi(); -final User user = new User(); // User | +final User user = new User(); // User | Created user object try { final result = await api_instance.createUser(user); @@ -7043,7 +7043,7 @@

Usage and SDK Samples

public class UserApiExample { public static void main(String[] args) { UserApi apiInstance = new UserApi(); - User user = ; // User | + User user = ; // User | Created user object try { apiInstance.createUser(user); @@ -7069,7 +7069,7 @@

Usage and SDK Samples

// Create an instance of the API class UserApi *apiInstance = [[UserApi alloc] init]; -User *user = ; // +User *user = ; // Created user object // Create user [apiInstance createUserWith:user @@ -7093,7 +7093,7 @@

Usage and SDK Samples

// Create an instance of the API class var api = new OpenApiPetstore.UserApi() -var user = ; // {User} +var user = ; // {User} Created user object var callback = function(error, data, response) { if (error) { @@ -7129,7 +7129,7 @@

Usage and SDK Samples

// Create an instance of the API class var apiInstance = new UserApi(); - var user = new User(); // User | + var user = new User(); // User | Created user object try { // Create user @@ -7154,7 +7154,7 @@

Usage and SDK Samples

// Create an instance of the API class $api_instance = new OpenAPITools\Client\Api\UserApi(); -$user = ; // User | +$user = ; // User | Created user object try { $api_instance->createUser($user); @@ -7176,7 +7176,7 @@

Usage and SDK Samples

# Create an instance of the API class my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $user = WWW::OPenAPIClient::Object::User->new(); # User | +my $user = WWW::OPenAPIClient::Object::User->new(); # User | Created user object eval { $api_instance->createUser(user => $user); @@ -7200,7 +7200,7 @@

Usage and SDK Samples

# Create an instance of the API class api_instance = openapi_client.UserApi() -user = # User | +user = # User | Created user object try: # Create user @@ -7424,7 +7424,7 @@

Usage and SDK Samples

// Create an instance of the API class UserApi apiInstance = new UserApi(); - array[User] user = ; // array[User] | + array[User] user = ; // array[User] | List of user object try { apiInstance.createUsersWithArrayInput(user); @@ -7442,7 +7442,7 @@

Usage and SDK Samples

final api_instance = DefaultApi(); -final array[User] user = new array[User](); // array[User] | +final array[User] user = new array[User](); // array[User] | List of user object try { final result = await api_instance.createUsersWithArrayInput(user); @@ -7460,7 +7460,7 @@

Usage and SDK Samples

public class UserApiExample { public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] user = ; // array[User] | + array[User] user = ; // array[User] | List of user object try { apiInstance.createUsersWithArrayInput(user); @@ -7486,7 +7486,7 @@

Usage and SDK Samples

// Create an instance of the API class UserApi *apiInstance = [[UserApi alloc] init]; -array[User] *user = ; // +array[User] *user = ; // List of user object // Creates list of users with given input array [apiInstance createUsersWithArrayInputWith:user @@ -7510,7 +7510,7 @@

Usage and SDK Samples

// Create an instance of the API class var api = new OpenApiPetstore.UserApi() -var user = ; // {array[User]} +var user = ; // {array[User]} List of user object var callback = function(error, data, response) { if (error) { @@ -7546,7 +7546,7 @@

Usage and SDK Samples

// Create an instance of the API class var apiInstance = new UserApi(); - var user = new array[User](); // array[User] | + var user = new array[User](); // array[User] | List of user object try { // Creates list of users with given input array @@ -7571,7 +7571,7 @@

Usage and SDK Samples

// Create an instance of the API class $api_instance = new OpenAPITools\Client\Api\UserApi(); -$user = ; // array[User] | +$user = ; // array[User] | List of user object try { $api_instance->createUsersWithArrayInput($user); @@ -7593,7 +7593,7 @@

Usage and SDK Samples

# Create an instance of the API class my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | +my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | List of user object eval { $api_instance->createUsersWithArrayInput(user => $user); @@ -7617,7 +7617,7 @@

Usage and SDK Samples

# Create an instance of the API class api_instance = openapi_client.UserApi() -user = # array[User] | +user = # array[User] | List of user object try: # Creates list of users with given input array @@ -7844,7 +7844,7 @@

Usage and SDK Samples

// Create an instance of the API class UserApi apiInstance = new UserApi(); - array[User] user = ; // array[User] | + array[User] user = ; // array[User] | List of user object try { apiInstance.createUsersWithListInput(user); @@ -7862,7 +7862,7 @@

Usage and SDK Samples

final api_instance = DefaultApi(); -final array[User] user = new array[User](); // array[User] | +final array[User] user = new array[User](); // array[User] | List of user object try { final result = await api_instance.createUsersWithListInput(user); @@ -7880,7 +7880,7 @@

Usage and SDK Samples

public class UserApiExample { public static void main(String[] args) { UserApi apiInstance = new UserApi(); - array[User] user = ; // array[User] | + array[User] user = ; // array[User] | List of user object try { apiInstance.createUsersWithListInput(user); @@ -7906,7 +7906,7 @@

Usage and SDK Samples

// Create an instance of the API class UserApi *apiInstance = [[UserApi alloc] init]; -array[User] *user = ; // +array[User] *user = ; // List of user object // Creates list of users with given input array [apiInstance createUsersWithListInputWith:user @@ -7930,7 +7930,7 @@

Usage and SDK Samples

// Create an instance of the API class var api = new OpenApiPetstore.UserApi() -var user = ; // {array[User]} +var user = ; // {array[User]} List of user object var callback = function(error, data, response) { if (error) { @@ -7966,7 +7966,7 @@

Usage and SDK Samples

// Create an instance of the API class var apiInstance = new UserApi(); - var user = new array[User](); // array[User] | + var user = new array[User](); // array[User] | List of user object try { // Creates list of users with given input array @@ -7991,7 +7991,7 @@

Usage and SDK Samples

// Create an instance of the API class $api_instance = new OpenAPITools\Client\Api\UserApi(); -$user = ; // array[User] | +$user = ; // array[User] | List of user object try { $api_instance->createUsersWithListInput($user); @@ -8013,7 +8013,7 @@

Usage and SDK Samples

# Create an instance of the API class my $api_instance = WWW::OPenAPIClient::UserApi->new(); -my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | +my $user = [WWW::OPenAPIClient::Object::array[User]->new()]; # array[User] | List of user object eval { $api_instance->createUsersWithListInput(user => $user); @@ -8037,7 +8037,7 @@

Usage and SDK Samples

# Create an instance of the API class api_instance = openapi_client.UserApi() -user = # array[User] | +user = # array[User] | List of user object try: # Creates list of users with given input array @@ -10096,7 +10096,7 @@

Usage and SDK Samples

// Create an instance of the API class UserApi apiInstance = new UserApi(); String username = username_example; // String | name that need to be deleted - User user = ; // User | + User user = ; // User | Updated user object try { apiInstance.updateUser(username, user); @@ -10115,7 +10115,7 @@

Usage and SDK Samples

final api_instance = DefaultApi(); final String username = new String(); // String | name that need to be deleted -final User user = new User(); // User | +final User user = new User(); // User | Updated user object try { final result = await api_instance.updateUser(username, user); @@ -10134,7 +10134,7 @@

Usage and SDK Samples

public static void main(String[] args) { UserApi apiInstance = new UserApi(); String username = username_example; // String | name that need to be deleted - User user = ; // User | + User user = ; // User | Updated user object try { apiInstance.updateUser(username, user); @@ -10161,7 +10161,7 @@

Usage and SDK Samples

// Create an instance of the API class UserApi *apiInstance = [[UserApi alloc] init]; String *username = username_example; // name that need to be deleted (default to null) -User *user = ; // +User *user = ; // Updated user object // Updated user [apiInstance updateUserWith:username @@ -10187,7 +10187,7 @@

Usage and SDK Samples

// Create an instance of the API class var api = new OpenApiPetstore.UserApi() var username = username_example; // {String} name that need to be deleted -var user = ; // {User} +var user = ; // {User} Updated user object var callback = function(error, data, response) { if (error) { @@ -10224,7 +10224,7 @@

Usage and SDK Samples

// Create an instance of the API class var apiInstance = new UserApi(); var username = username_example; // String | name that need to be deleted (default to null) - var user = new User(); // User | + var user = new User(); // User | Updated user object try { // Updated user @@ -10250,7 +10250,7 @@

Usage and SDK Samples

// Create an instance of the API class $api_instance = new OpenAPITools\Client\Api\UserApi(); $username = username_example; // String | name that need to be deleted -$user = ; // User | +$user = ; // User | Updated user object try { $api_instance->updateUser($username, $user); @@ -10273,7 +10273,7 @@

Usage and SDK Samples

# Create an instance of the API class my $api_instance = WWW::OPenAPIClient::UserApi->new(); my $username = username_example; # String | name that need to be deleted -my $user = WWW::OPenAPIClient::Object::User->new(); # User | +my $user = WWW::OPenAPIClient::Object::User->new(); # User | Updated user object eval { $api_instance->updateUser(username => $username, user => $user); @@ -10298,7 +10298,7 @@

Usage and SDK Samples

# Create an instance of the API class api_instance = openapi_client.UserApi() username = username_example # String | name that need to be deleted (default to null) -user = # User | +user = # User | Updated user object try: # Updated user diff --git a/samples/server/echo_api/kotlin-wiremock/.openapi-generator/FILES b/samples/server/echo_api/kotlin-wiremock/.openapi-generator/FILES index 762b52754833..6a523b2d684d 100644 --- a/samples/server/echo_api/kotlin-wiremock/.openapi-generator/FILES +++ b/samples/server/echo_api/kotlin-wiremock/.openapi-generator/FILES @@ -10,6 +10,8 @@ src/main/kotlin/org/openapitools/apis/AuthApiStubBuilders.kt src/main/kotlin/org/openapitools/apis/AuthApiStubs.kt src/main/kotlin/org/openapitools/apis/BodyApiStubBuilders.kt src/main/kotlin/org/openapitools/apis/BodyApiStubs.kt +src/main/kotlin/org/openapitools/apis/EchoApiStubBuilders.kt +src/main/kotlin/org/openapitools/apis/EchoApiStubs.kt src/main/kotlin/org/openapitools/apis/FormApiStubBuilders.kt src/main/kotlin/org/openapitools/apis/FormApiStubs.kt src/main/kotlin/org/openapitools/apis/HeaderApiStubBuilders.kt @@ -25,5 +27,6 @@ src/main/kotlin/org/openapitools/models/NumberPropertiesOnly.kt src/main/kotlin/org/openapitools/models/Pet.kt src/main/kotlin/org/openapitools/models/Query.kt src/main/kotlin/org/openapitools/models/StringEnumRef.kt +src/main/kotlin/org/openapitools/models/StringEscapingEdgeCases.kt src/main/kotlin/org/openapitools/models/Tag.kt src/main/kotlin/org/openapitools/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/EchoApiStubBuilders.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/EchoApiStubBuilders.kt new file mode 100644 index 000000000000..f8909ad27e79 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/EchoApiStubBuilders.kt @@ -0,0 +1,63 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * Builder for WireMock stubs of operation testsEchoStringEscapingParamName. + */ +class TestsEchoStringEscapingParamNameStubBuilder internal constructor(private val objectMapper: ObjectMapper, private val stub: MappingBuilder) { + + /** + * Let the stub for testsEchoStringEscapingParamName respond with HTTP status code 200. + * + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith200( + body: kotlin.String, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this }, + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(200) + .withHeader("Content-Type", "application/json") + .withBody(objectMapper.writeValueAsString(body)) + .configurer() + ) + + /** + * Let the stub for testsEchoStringEscapingParamName respond with HTTP status code [code]. + * + * @param code the response code. + * @param body response body for the [MappingBuilder]. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return a [MappingBuilder] to be registered with a WireMock instance. + */ + fun respondWith( + code: Int, + body: Any? = null, + configurer: ResponseDefinitionBuilder.() -> ResponseDefinitionBuilder = { this } + ): MappingBuilder = + stub.willReturn(aResponse() + .withStatus(code) + .apply { + body?.let { + withHeader("Content-Type", "application/json") + withBody(objectMapper.writeValueAsString(it)) + } + } + .configurer() + ) +} + diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/EchoApiStubs.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/EchoApiStubs.kt new file mode 100644 index 000000000000..e49d15cc9941 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/apis/EchoApiStubs.kt @@ -0,0 +1,35 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "UnusedImport", + "unused", +) + +package org.openapitools.apis + +import com.fasterxml.jackson.databind.ObjectMapper +import com.github.tomakehurst.wiremock.client.MappingBuilder +import com.github.tomakehurst.wiremock.client.ResponseDefinitionBuilder +import com.github.tomakehurst.wiremock.client.WireMock.* +import com.github.tomakehurst.wiremock.matching.StringValuePattern +import org.openapitools.models.* + +/** + * WireMock stub request builder. + */ +open class EchoApiStubs(private val objectMapper: ObjectMapper) { + + /** + * Construct a stub for the operation testsEchoStringEscapingParamName. + * + * @param dollarParamName path parameter dollarParamName pattern. + * @param filterDollarType query parameter filterDollarType pattern. + * @param configurer configurer for the [MappingBuilder], allowing for arbitrary changes. + * @return A [TestsEchoStringEscapingParamNameStubBuilder] to configure the response, and the final [MappingBuilder]. + */ + fun testsEchoStringEscapingParamName(dollarParamName: StringValuePattern, filterDollarType: StringValuePattern? = null, configurer: MappingBuilder.() -> MappingBuilder = { this }): TestsEchoStringEscapingParamNameStubBuilder = + TestsEchoStringEscapingParamNameStubBuilder(objectMapper, get(urlPathTemplate("/echo/string-escaping/{\$paramName}")) + .withPathParam("\$paramName", dollarParamName) + .apply { filterDollarType?.let { withQueryParam("filter\$Type", it) } } + .configurer() + ) +} diff --git a/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/StringEscapingEdgeCases.kt b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/StringEscapingEdgeCases.kt new file mode 100644 index 000000000000..15499fb02a19 --- /dev/null +++ b/samples/server/echo_api/kotlin-wiremock/src/main/kotlin/org/openapitools/models/StringEscapingEdgeCases.kt @@ -0,0 +1,17 @@ +@file:Suppress( + "RemoveRedundantQualifierName", + "unused", +) + +package org.openapitools.models + +import com.fasterxml.jackson.annotation.JsonProperty + +data class StringEscapingEdgeCases( + @field:JsonProperty("dollarDefault") + val dollarDefault: kotlin.String? = "hello \$world, backslash=\\, quote=\", end */", + + @field:JsonProperty("regularProp") + val regularProp: kotlin.String? = null, + +) 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 d5faaeaaa5fe..be5e15e99f21 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 @@ -574,13 +574,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='{ + *

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.', unescapedDefaultValue='null', 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, 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, isOptional=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, hasSanitizedName=true, 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, 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, isOptional=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, hasSanitizedName=true, 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', unescapedDefaultValue='null', 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, 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, isOptional=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, hasSanitizedName=true, 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, 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, isOptional=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, hasSanitizedName=true, 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', unescapedDefaultValue='null', 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, 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, isOptional=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, hasSanitizedName=true, requiredVarsMap=null, ref=null, schemaIsFromAdditionalProperties=false, isBooleanSchemaTrue=false, isBooleanSchemaFalse=false, format=date-time, dependentRequired=null, contains=null}]

diff --git a/samples/server/petstore/kotlin-misk-config/.openapi-generator/FILES b/samples/server/petstore/kotlin-misk-config/.openapi-generator/FILES index 594e5efd5ba2..9ef76d5d361c 100644 --- a/samples/server/petstore/kotlin-misk-config/.openapi-generator/FILES +++ b/samples/server/petstore/kotlin-misk-config/.openapi-generator/FILES @@ -2,6 +2,7 @@ README.md build.gradle.kts docs/ApiResponse.md docs/Category.md +docs/EscapingEdgeCases.md docs/Order.md docs/Pet.md docs/PetApi.md @@ -15,6 +16,7 @@ src/main/kotlin/org/openapitools/server/api/api/PetStoreModule.kt src/main/kotlin/org/openapitools/server/api/api/StoreApiAction.kt src/main/kotlin/org/openapitools/server/api/api/UserApiAction.kt src/main/kotlin/org/openapitools/server/api/model/Category.kt +src/main/kotlin/org/openapitools/server/api/model/EscapingEdgeCases.kt src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt src/main/kotlin/org/openapitools/server/api/model/Order.kt src/main/kotlin/org/openapitools/server/api/model/Pet.kt diff --git a/samples/server/petstore/kotlin-misk-config/README.md b/samples/server/petstore/kotlin-misk-config/README.md index 8fc27a719a91..a681a02dae40 100644 --- a/samples/server/petstore/kotlin-misk-config/README.md +++ b/samples/server/petstore/kotlin-misk-config/README.md @@ -11,6 +11,7 @@ *PetApi* | [**deletePet**](Apis/docs/PetApi.md#deletepet) | **Delete** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](Apis/docs/PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status *PetApi* | [**findPetsByTags**](Apis/docs/PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags + *PetApi* | [**getEscapingEdgeCases**](Apis/docs/PetApi.md#getescapingedgecases) | **Get** /pet/escaping | Test escaping: $dollar, backslash \\ and quote \" *PetApi* | [**getPetById**](Apis/docs/PetApi.md#getpetbyid) | **Get** /pet/{petId} | Find pet by ID *PetApi* | [**updatePet**](Apis/docs/PetApi.md#updatepet) | **Put** /pet | Update an existing pet *PetApi* | [**updatePetWithForm**](Apis/docs/PetApi.md#updatepetwithform) | **Post** /pet/{petId} | Updates a pet in the store with form data @@ -33,6 +34,7 @@ ## Documentation for Models - [org.openapitools.server.api.model.Category](Models/docs/Category.md) + - [org.openapitools.server.api.model.EscapingEdgeCases](Models/docs/EscapingEdgeCases.md) - [org.openapitools.server.api.model.ModelApiResponse](Models/docs/ModelApiResponse.md) - [org.openapitools.server.api.model.Order](Models/docs/Order.md) - [org.openapitools.server.api.model.Pet](Models/docs/Pet.md) diff --git a/samples/server/petstore/kotlin-misk-config/docs/EscapingEdgeCases.md b/samples/server/petstore/kotlin-misk-config/docs/EscapingEdgeCases.md new file mode 100644 index 000000000000..4ab2399cccc8 --- /dev/null +++ b/samples/server/petstore/kotlin-misk-config/docs/EscapingEdgeCases.md @@ -0,0 +1,11 @@ + +# EscapingEdgeCases + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dollarDefault** | **kotlin.String** | A string whose default has \$dollar, backslash \\, quote " and comment-close */ | [optional] +**regularProp** | **kotlin.String** | Regular property for baseline comparison | [optional] + + + diff --git a/samples/server/petstore/kotlin-misk-config/docs/PetApi.md b/samples/server/petstore/kotlin-misk-config/docs/PetApi.md index 99dbe788edb0..5e073104a909 100644 --- a/samples/server/petstore/kotlin-misk-config/docs/PetApi.md +++ b/samples/server/petstore/kotlin-misk-config/docs/PetApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**deletePet**](PetApi.md#deletePet) | **Delete** /pet/{petId} | Deletes a pet [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **Get** /pet/findByStatus | Finds Pets by status [**findPetsByTags**](PetApi.md#findPetsByTags) | **Get** /pet/findByTags | Finds Pets by tags +[**getEscapingEdgeCases**](PetApi.md#getEscapingEdgeCases) | **Get** /pet/escaping | Test escaping: \$dollar, backslash \\ and quote " [**getPetById**](PetApi.md#getPetById) | **Get** /pet/{petId} | Find pet by ID [**updatePet**](PetApi.md#updatePet) | **Put** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **Post** /pet/{petId} | Updates a pet in the store with form data @@ -203,6 +204,49 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: APPLICATION_XML, APPLICATION_JSON + +# **getEscapingEdgeCases** +> EscapingEdgeCases getEscapingEdgeCases() + +Test escaping: \$dollar, backslash \\ and quote " + +Retrieves edge-cases for escaping: \$var, \\, ", */ + +### Example +```kotlin +// Import classes: +//import org.openapitools.infrastructure.* +//import org.openapitools.server.api.model.* + +val apiInstance = PetApi() +try { + val result : EscapingEdgeCases = apiInstance.getEscapingEdgeCases() + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#getEscapingEdgeCases") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#getEscapingEdgeCases") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**EscapingEdgeCases**](EscapingEdgeCases.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: APPLICATION_JSON + # **getPetById** > Pet getPetById(petId) diff --git a/samples/server/petstore/kotlin-misk-config/docs/StoreApi.md b/samples/server/petstore/kotlin-misk-config/docs/StoreApi.md index d3add9f5776a..8170140ea27d 100644 --- a/samples/server/petstore/kotlin-misk-config/docs/StoreApi.md +++ b/samples/server/petstore/kotlin-misk-config/docs/StoreApi.md @@ -105,7 +105,7 @@ This endpoint does not need any parameter. Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt b/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt index f98d5a463e85..611c58b0c9e4 100644 --- a/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt +++ b/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt @@ -28,6 +28,7 @@ import misk.web.RequestHeader import misk.web.Response import misk.web.ResponseContentType import misk.web.mediatype.MediaTypes +import org.openapitools.server.api.model.EscapingEdgeCases import org.openapitools.server.api.model.ModelApiResponse import org.openapitools.server.api.model.Pet @@ -83,6 +84,16 @@ class PetApiAction @Inject constructor( TODO() } + @Get("samplePrefix/pet/escaping") + @Description("Test escaping: \$dollar, backslash \\ and quote \"") + @ResponseContentType(MediaTypes.APPLICATION_JSON) + @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0) + @Suppress("unused") + fun getEscapingEdgeCases( + ): EscapingEdgeCases { + TODO() + } + @Get("samplePrefix/pet/{petId}") @Description("Find pet by ID") @ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON) diff --git a/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/model/EscapingEdgeCases.kt b/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/model/EscapingEdgeCases.kt new file mode 100644 index 000000000000..bdc5d466d1e5 --- /dev/null +++ b/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/model/EscapingEdgeCases.kt @@ -0,0 +1,11 @@ +package org.openapitools.server.api.model + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +data class EscapingEdgeCases( + /** A string whose default has $dollar, backslash \\, quote \" and comment-close *_/ */ + val dollarDefault: kotlin.String? = "hello \$world, backslash=\\, quote=\", end */", + /** Regular property for baseline comparison */ + val regularProp: kotlin.String? = null +) diff --git a/samples/server/petstore/kotlin-misk/.openapi-generator/FILES b/samples/server/petstore/kotlin-misk/.openapi-generator/FILES index 594e5efd5ba2..9ef76d5d361c 100644 --- a/samples/server/petstore/kotlin-misk/.openapi-generator/FILES +++ b/samples/server/petstore/kotlin-misk/.openapi-generator/FILES @@ -2,6 +2,7 @@ README.md build.gradle.kts docs/ApiResponse.md docs/Category.md +docs/EscapingEdgeCases.md docs/Order.md docs/Pet.md docs/PetApi.md @@ -15,6 +16,7 @@ src/main/kotlin/org/openapitools/server/api/api/PetStoreModule.kt src/main/kotlin/org/openapitools/server/api/api/StoreApiAction.kt src/main/kotlin/org/openapitools/server/api/api/UserApiAction.kt src/main/kotlin/org/openapitools/server/api/model/Category.kt +src/main/kotlin/org/openapitools/server/api/model/EscapingEdgeCases.kt src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt src/main/kotlin/org/openapitools/server/api/model/Order.kt src/main/kotlin/org/openapitools/server/api/model/Pet.kt diff --git a/samples/server/petstore/kotlin-misk/README.md b/samples/server/petstore/kotlin-misk/README.md index 8fc27a719a91..a681a02dae40 100644 --- a/samples/server/petstore/kotlin-misk/README.md +++ b/samples/server/petstore/kotlin-misk/README.md @@ -11,6 +11,7 @@ *PetApi* | [**deletePet**](Apis/docs/PetApi.md#deletepet) | **Delete** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](Apis/docs/PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status *PetApi* | [**findPetsByTags**](Apis/docs/PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags + *PetApi* | [**getEscapingEdgeCases**](Apis/docs/PetApi.md#getescapingedgecases) | **Get** /pet/escaping | Test escaping: $dollar, backslash \\ and quote \" *PetApi* | [**getPetById**](Apis/docs/PetApi.md#getpetbyid) | **Get** /pet/{petId} | Find pet by ID *PetApi* | [**updatePet**](Apis/docs/PetApi.md#updatepet) | **Put** /pet | Update an existing pet *PetApi* | [**updatePetWithForm**](Apis/docs/PetApi.md#updatepetwithform) | **Post** /pet/{petId} | Updates a pet in the store with form data @@ -33,6 +34,7 @@ ## Documentation for Models - [org.openapitools.server.api.model.Category](Models/docs/Category.md) + - [org.openapitools.server.api.model.EscapingEdgeCases](Models/docs/EscapingEdgeCases.md) - [org.openapitools.server.api.model.ModelApiResponse](Models/docs/ModelApiResponse.md) - [org.openapitools.server.api.model.Order](Models/docs/Order.md) - [org.openapitools.server.api.model.Pet](Models/docs/Pet.md) diff --git a/samples/server/petstore/kotlin-misk/docs/EscapingEdgeCases.md b/samples/server/petstore/kotlin-misk/docs/EscapingEdgeCases.md new file mode 100644 index 000000000000..4ab2399cccc8 --- /dev/null +++ b/samples/server/petstore/kotlin-misk/docs/EscapingEdgeCases.md @@ -0,0 +1,11 @@ + +# EscapingEdgeCases + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**dollarDefault** | **kotlin.String** | A string whose default has \$dollar, backslash \\, quote " and comment-close */ | [optional] +**regularProp** | **kotlin.String** | Regular property for baseline comparison | [optional] + + + diff --git a/samples/server/petstore/kotlin-misk/docs/PetApi.md b/samples/server/petstore/kotlin-misk/docs/PetApi.md index 99dbe788edb0..5e073104a909 100644 --- a/samples/server/petstore/kotlin-misk/docs/PetApi.md +++ b/samples/server/petstore/kotlin-misk/docs/PetApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**deletePet**](PetApi.md#deletePet) | **Delete** /pet/{petId} | Deletes a pet [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **Get** /pet/findByStatus | Finds Pets by status [**findPetsByTags**](PetApi.md#findPetsByTags) | **Get** /pet/findByTags | Finds Pets by tags +[**getEscapingEdgeCases**](PetApi.md#getEscapingEdgeCases) | **Get** /pet/escaping | Test escaping: \$dollar, backslash \\ and quote " [**getPetById**](PetApi.md#getPetById) | **Get** /pet/{petId} | Find pet by ID [**updatePet**](PetApi.md#updatePet) | **Put** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **Post** /pet/{petId} | Updates a pet in the store with form data @@ -203,6 +204,49 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: APPLICATION_XML, APPLICATION_JSON + +# **getEscapingEdgeCases** +> EscapingEdgeCases getEscapingEdgeCases() + +Test escaping: \$dollar, backslash \\ and quote " + +Retrieves edge-cases for escaping: \$var, \\, ", */ + +### Example +```kotlin +// Import classes: +//import org.openapitools.infrastructure.* +//import org.openapitools.server.api.model.* + +val apiInstance = PetApi() +try { + val result : EscapingEdgeCases = apiInstance.getEscapingEdgeCases() + println(result) +} catch (e: ClientException) { + println("4xx response calling PetApi#getEscapingEdgeCases") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PetApi#getEscapingEdgeCases") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**EscapingEdgeCases**](EscapingEdgeCases.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: APPLICATION_JSON + # **getPetById** > Pet getPetById(petId) diff --git a/samples/server/petstore/kotlin-misk/docs/StoreApi.md b/samples/server/petstore/kotlin-misk/docs/StoreApi.md index d3add9f5776a..8170140ea27d 100644 --- a/samples/server/petstore/kotlin-misk/docs/StoreApi.md +++ b/samples/server/petstore/kotlin-misk/docs/StoreApi.md @@ -105,7 +105,7 @@ This endpoint does not need any parameter. Find purchase order by ID -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions ### Example ```kotlin diff --git a/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt b/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt index 1a8c806566d5..5c9e639ac479 100644 --- a/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt +++ b/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt @@ -28,6 +28,7 @@ import misk.web.RequestHeader import misk.web.Response import misk.web.ResponseContentType import misk.web.mediatype.MediaTypes +import org.openapitools.server.api.model.EscapingEdgeCases import org.openapitools.server.api.model.ModelApiResponse import org.openapitools.server.api.model.Pet @@ -79,6 +80,15 @@ class PetApiAction @Inject constructor( TODO() } + @Get("/pet/escaping") + @Description("Test escaping: \$dollar, backslash \\ and quote \"") + @ResponseContentType(MediaTypes.APPLICATION_JSON) + @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) + fun getEscapingEdgeCases( + ): EscapingEdgeCases { + TODO() + } + @Get("/pet/{petId}") @Description("Find pet by ID") @ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON) diff --git a/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/model/EscapingEdgeCases.kt b/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/model/EscapingEdgeCases.kt new file mode 100644 index 000000000000..bdc5d466d1e5 --- /dev/null +++ b/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/model/EscapingEdgeCases.kt @@ -0,0 +1,11 @@ +package org.openapitools.server.api.model + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +data class EscapingEdgeCases( + /** A string whose default has $dollar, backslash \\, quote \" and comment-close *_/ */ + val dollarDefault: kotlin.String? = "hello \$world, backslash=\\, quote=\", end */", + /** Regular property for baseline comparison */ + val regularProp: kotlin.String? = null +) diff --git a/samples/server/petstore/kotlin-spring-default/.openapi-generator/FILES b/samples/server/petstore/kotlin-spring-default/.openapi-generator/FILES index 98932e549209..6000fcacc452 100644 --- a/samples/server/petstore/kotlin-spring-default/.openapi-generator/FILES +++ b/samples/server/petstore/kotlin-spring-default/.openapi-generator/FILES @@ -22,6 +22,7 @@ src/main/kotlin/org/openapitools/model/Category.kt src/main/kotlin/org/openapitools/model/ModelApiResponse.kt src/main/kotlin/org/openapitools/model/Order.kt src/main/kotlin/org/openapitools/model/Pet.kt +src/main/kotlin/org/openapitools/model/PetWithSpecialProps.kt src/main/kotlin/org/openapitools/model/Tag.kt src/main/kotlin/org/openapitools/model/User.kt src/main/kotlin/org/openapitools/model/UserOrPet.kt diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/PetWithSpecialProps.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/PetWithSpecialProps.kt new file mode 100644 index 000000000000..39a4dba2dd86 --- /dev/null +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/model/PetWithSpecialProps.kt @@ -0,0 +1,31 @@ +package org.openapitools.model + +import java.util.Objects +import com.fasterxml.jackson.annotation.JsonProperty +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Email +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size +import javax.validation.Valid +import io.swagger.v3.oas.annotations.media.Schema + +/** + * Model with $-prefixed property names for escaping tests (Issue 20502) + * @param dollarId Property with $-prefix in name; default has $dollar and backslash \\ + * @param nameDollarSuffix Property with $ mid-name; description has backslash \\ and quote \" + */ +data class PetWithSpecialProps( + + @Schema(example = "null", description = "Property with \$-prefix in name; default has \$dollar and backslash \\") + @get:JsonProperty("\$id") val dollarId: kotlin.String? = "hello \$world", + + @Schema(example = "null", description = "Property with \$ mid-name; description has backslash \\ and quote \"") + @get:JsonProperty("name\$Suffix") val nameDollarSuffix: kotlin.String? = null +) { + +} + diff --git a/samples/server/petstore/kotlin-spring-default/src/main/resources/openapi.yaml b/samples/server/petstore/kotlin-spring-default/src/main/resources/openapi.yaml index 1f2e34812c4b..cba7c9c31e12 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/resources/openapi.yaml +++ b/samples/server/petstore/kotlin-spring-default/src/main/resources/openapi.yaml @@ -856,6 +856,20 @@ components: - items: type: string type: array + PetWithSpecialProps: + description: Model with $-prefixed property names for escaping tests (Issue + 20502) + properties: + $id: + default: hello $world + description: Property with $-prefix in name; default has $dollar and backslash + \ + type: string + name$Suffix: + description: Property with $ mid-name; description has backslash \ and quote + " + type: string + type: object updatePetWithForm_request: properties: name: diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt index 7b43df537880..762f8258eebd 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt @@ -26,11 +26,11 @@ interface PetApiDelegate { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}") + ApiUtil.setExampleResponse(request, "application/json", "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}") break } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou") + ApiUtil.setExampleResponse(request, "application/xml", "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n") break } } @@ -57,11 +57,11 @@ interface PetApiDelegate { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"} ]") + ApiUtil.setExampleResponse(request, "application/json", "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]") break } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou") + ApiUtil.setExampleResponse(request, "application/xml", "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n") break } } @@ -78,11 +78,11 @@ interface PetApiDelegate { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"} ]") + ApiUtil.setExampleResponse(request, "application/json", "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]") break } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou") + ApiUtil.setExampleResponse(request, "application/xml", "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n") break } } @@ -99,11 +99,11 @@ interface PetApiDelegate { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}") + ApiUtil.setExampleResponse(request, "application/json", "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}") break } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou") + ApiUtil.setExampleResponse(request, "application/xml", "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n") break } } @@ -120,11 +120,11 @@ interface PetApiDelegate { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}") + ApiUtil.setExampleResponse(request, "application/json", "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}") break } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou") + ApiUtil.setExampleResponse(request, "application/xml", "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n") break } } @@ -154,7 +154,7 @@ interface PetApiDelegate { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}") + ApiUtil.setExampleResponse(request, "application/json", "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}") break } } diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt index 5470648bd4ee..ffe7f6ac5a94 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt @@ -43,11 +43,11 @@ interface StoreApiDelegate { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}") + ApiUtil.setExampleResponse(request, "application/json", "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}") break } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true") + ApiUtil.setExampleResponse(request, "application/xml", "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n") break } } @@ -64,11 +64,11 @@ interface StoreApiDelegate { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}") + ApiUtil.setExampleResponse(request, "application/json", "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}") break } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true") + ApiUtil.setExampleResponse(request, "application/xml", "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n") break } } diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt index e8033bdf5836..e19f45643c26 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt @@ -61,11 +61,11 @@ interface UserApiDelegate { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}") + ApiUtil.setExampleResponse(request, "application/json", "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}") break } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123") + ApiUtil.setExampleResponse(request, "application/xml", "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n") break } } diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt index 8907dac1a7a7..48a8c679334e 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/PetApiDelegate.kt @@ -43,11 +43,11 @@ interface PetApiDelegate { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"} ]") + ApiUtil.setExampleResponse(request, "application/json", "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]") break } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou") + ApiUtil.setExampleResponse(request, "application/xml", "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n") break } } @@ -64,11 +64,11 @@ interface PetApiDelegate { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"} ]") + ApiUtil.setExampleResponse(request, "application/json", "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]") break } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou") + ApiUtil.setExampleResponse(request, "application/xml", "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n") break } } @@ -85,11 +85,11 @@ interface PetApiDelegate { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}") + ApiUtil.setExampleResponse(request, "application/json", "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}") break } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou") + ApiUtil.setExampleResponse(request, "application/xml", "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n") break } } @@ -128,7 +128,7 @@ interface PetApiDelegate { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}") + ApiUtil.setExampleResponse(request, "application/json", "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}") break } } diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt index 7c9aea227800..5ad88f2b6bce 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/StoreApiDelegate.kt @@ -41,11 +41,11 @@ interface StoreApiDelegate { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}") + ApiUtil.setExampleResponse(request, "application/json", "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}") break } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true") + ApiUtil.setExampleResponse(request, "application/xml", "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n") break } } @@ -62,11 +62,11 @@ interface StoreApiDelegate { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\"}") + ApiUtil.setExampleResponse(request, "application/json", "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}") break } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true") + ApiUtil.setExampleResponse(request, "application/xml", "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n") break } } diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt index 70bfb0eae387..8af5766e9065 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/UserApiDelegate.kt @@ -59,11 +59,11 @@ interface UserApiDelegate { getRequest().ifPresent { request -> for (mediaType in MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - ApiUtil.setExampleResponse(request, "application/json", "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\"}") + ApiUtil.setExampleResponse(request, "application/json", "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}") break } if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - ApiUtil.setExampleResponse(request, "application/xml", " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123") + ApiUtil.setExampleResponse(request, "application/xml", "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n") break } }