diff --git a/.github/workflows/samples-kotlin-client.yaml b/.github/workflows/samples-kotlin-client.yaml index 5de4ae0c0c2..78faf118c19 100644 --- a/.github/workflows/samples-kotlin-client.yaml +++ b/.github/workflows/samples-kotlin-client.yaml @@ -61,6 +61,7 @@ jobs: - samples/client/petstore/kotlin-jvm-vertx-moshi - samples/client/petstore/kotlin-jvm-spring-2-webclient - samples/client/petstore/kotlin-jvm-spring-3-webclient + - samples/client/echo_api/kotlin-jvm-spring-3-webclient - samples/client/petstore/kotlin-jvm-spring-3-restclient - samples/client/echo_api/kotlin-jvm-spring-3-restclient - samples/client/petstore/kotlin-spring-cloud diff --git a/bin/configs/kotlin-jvm-spring-3-webclient-echo-api.yaml b/bin/configs/kotlin-jvm-spring-3-webclient-echo-api.yaml new file mode 100644 index 00000000000..ddafa03ed68 --- /dev/null +++ b/bin/configs/kotlin-jvm-spring-3-webclient-echo-api.yaml @@ -0,0 +1,9 @@ +generatorName: kotlin +outputDir: samples/client/echo_api/kotlin-jvm-spring-3-webclient +library: jvm-spring-restclient +inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/echo_api.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + enumUnknownDefaultCase: true + serializationLibrary: jackson + useSpringBoot3: true 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 97ccfaba394..3224e1cf5c9 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 @@ -609,7 +609,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co } String modified; - if (value.length() == 0) { + if (value.isEmpty()) { modified = "EMPTY"; } else { modified = value; @@ -1044,55 +1044,39 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co } @Override - public String toDefaultValue(Schema schema) { - Schema p = ModelUtils.getReferencedSchema(this.openAPI, schema); - if (ModelUtils.isBooleanSchema(p)) { - if (p.getDefault() != null) { - return p.getDefault().toString(); + public String toDefaultValue(CodegenProperty cp, Schema schema) { + schema = ModelUtils.getReferencedSchema(this.openAPI, schema); + if (ModelUtils.isBooleanSchema(schema)) { + if (schema.getDefault() != null) { + return schema.getDefault().toString(); } - } else if (ModelUtils.isDateSchema(p)) { + } else if (ModelUtils.isDateSchema(schema)) { // TODO return null; - } else if (ModelUtils.isDateTimeSchema(p)) { + } else if (ModelUtils.isDateTimeSchema(schema)) { // TODO return null; - } else if (ModelUtils.isNumberSchema(p)) { - if (p.getDefault() != null) { - return fixNumberValue(p.getDefault().toString(), p); + } else if (ModelUtils.isNumberSchema(schema)) { + if (schema.getDefault() != null) { + return fixNumberValue(schema.getDefault().toString(), schema); } - } else if (ModelUtils.isIntegerSchema(p)) { - if (p.getDefault() != null) { - return fixNumberValue(p.getDefault().toString(), p); + } + else if (ModelUtils.isIntegerSchema(schema)) { + if (schema.getDefault() != null) { + return fixNumberValue(schema.getDefault().toString(), schema); } - } else if (ModelUtils.isURISchema(p)) { - if (p.getDefault() != null) { - return importMapping.get("URI") + ".create(\"" + p.getDefault() + "\")"; + } + else if (ModelUtils.isURISchema(schema)) { + if (schema.getDefault() != null) { + return importMapping.get("URI") + ".create(\"" + schema.getDefault() + "\")"; } - } else if (ModelUtils.isArraySchema(p)) { - if (p.getDefault() != null) { - String arrInstantiationType = ModelUtils.isSet(p) ? "set" : "arrayList"; - - if (!(p.getDefault() instanceof ArrayNode)) { - return null; - } - ArrayNode _default = (ArrayNode) p.getDefault(); - if (_default.isEmpty()) { - return arrInstantiationType + "Of()"; - } - - StringBuilder defaultContent = new StringBuilder(); - Schema itemsSchema = getSchemaItems((ArraySchema) schema); - _default.elements().forEachRemaining((element) -> { - itemsSchema.setDefault(element.asText()); - defaultContent.append(toDefaultValue(itemsSchema)).append(","); - }); - defaultContent.deleteCharAt(defaultContent.length() - 1); // remove trailing comma - return arrInstantiationType + "Of(" + defaultContent + ")"; - } - } else if (ModelUtils.isStringSchema(p)) { - if (p.getDefault() != null) { - String _default = String.valueOf(p.getDefault()); - if (p.getEnum() == null) { + } + else if (ModelUtils.isArraySchema(schema)) { + return toArrayDefaultValue(cp, schema); + } else if (ModelUtils.isStringSchema(schema)) { + if (schema.getDefault() != null) { + String _default = String.valueOf(schema.getDefault()); + if (schema.getEnum() == null) { return "\"" + escapeText(_default) + "\""; } else { // convert to enum var name later in postProcessModels @@ -1100,10 +1084,54 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co } } return null; + } else if (ModelUtils.isObjectSchema(schema)) { + if (schema.getDefault() != null) { + return super.toDefaultValue(schema); + } + return null; } return null; } + private String toArrayDefaultValue(CodegenProperty cp, Schema schema) { + if (schema.getDefault() != null) { + String arrInstantiationType = ModelUtils.isSet(schema) ? "set" : "arrayList"; + + if (!(schema.getDefault() instanceof ArrayNode)) { + return null; + } + ArrayNode _default = (ArrayNode) schema.getDefault(); + if (_default.isEmpty()) { + return arrInstantiationType + "Of()"; + } + + StringBuilder defaultContent = new StringBuilder(); + Schema itemsSchema = getSchemaItems((ArraySchema) schema); + _default.elements().forEachRemaining((element) -> { + String defaultValue = element.asText(); + if (defaultValue != null) { + if (cp.items.getIsEnumOrRef()) { + String className = cp.items.datatypeWithEnum; + String enumVarName = toEnumVarName(defaultValue, cp.items.dataType); + defaultContent.append(className).append(".").append(enumVarName).append(","); + } else { + itemsSchema.setDefault(defaultValue); + defaultValue = toDefaultValue(cp, itemsSchema); + defaultContent.append(defaultValue).append(","); + } + } + }); + defaultContent.deleteCharAt(defaultContent.length() - 1); // remove trailing comma + return arrInstantiationType + "Of(" + defaultContent + ")"; + } + return null; + } + + @Override + public String toDefaultParameterValue(CodegenProperty cp, Schema schema) { + return toDefaultValue(cp, schema); + } + @Override public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.KOTLIN; 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 549d45e94b8..35b33e9d029 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 @@ -36,28 +36,28 @@ import {{packageName}}.infrastructure.* /** * enum for parameter {{paramName}} */ - {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) { - {{^enumUnknownDefaultCase}} - {{#allowableValues}} - {{#enumVars}} - {{#jackson}} - @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}} - {{/jackson}} - {{/enumVars}} - {{/allowableValues}} - {{/enumUnknownDefaultCase}} - {{#enumUnknownDefaultCase}} - {{#allowableValues}} - {{#enumVars}} - {{^-last}} - {{#jackson}} - @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), - {{/jackson}} - {{/-last}} - {{/enumVars}} - {{/allowableValues}} - {{/enumUnknownDefaultCase}} - } + {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) { + {{^enumUnknownDefaultCase}} + {{#allowableValues}} + {{#enumVars}} + {{#jackson}} + @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}} + {{/jackson}} + {{/enumVars}} + {{/allowableValues}} + {{/enumUnknownDefaultCase}} + {{#enumUnknownDefaultCase}} + {{#allowableValues}} + {{#enumVars}} + {{^-last}} + {{#jackson}} + @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/jackson}} + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + {{/enumUnknownDefaultCase}} + } {{/isEnum}} {{/allParams}} @@ -66,7 +66,7 @@ import {{packageName}}.infrastructure.* {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - 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}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}} { + fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}} { val result = {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{#returnType}} return result.body!! @@ -77,7 +77,7 @@ import {{packageName}}.infrastructure.* {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - fun {{operationId}}WithHttpInfo({{#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}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): ResponseEntity<{{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> { + fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): ResponseEntity<{{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> { val localVariableConfig = {{operationId}}RequestConfig({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) return request<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map>{{/hasFormParams}}{{/hasBodyParam}}, {{{returnType}}}{{^returnType}}Unit{{/returnType}}>( localVariableConfig @@ -87,7 +87,7 @@ import {{packageName}}.infrastructure.* {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - fun {{operationId}}RequestConfig({{#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}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map>{{/hasFormParams}}{{/hasBodyParam}}> { + fun {{operationId}}RequestConfig({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map>{{/hasFormParams}}{{/hasBodyParam}}> { val localVariableBody = {{#hasBodyParam}}{{! }}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{! }}{{^hasFormParams}}null{{/hasFormParams}}{{! 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 918be27a2fa..875a0fe7538 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 @@ -40,28 +40,28 @@ import {{packageName}}.infrastructure.* /** * enum for parameter {{paramName}} */ - {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) { - {{^enumUnknownDefaultCase}} - {{#allowableValues}} - {{#enumVars}} - {{#jackson}} - @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}} - {{/jackson}} - {{/enumVars}} - {{/allowableValues}} - {{/enumUnknownDefaultCase}} - {{#enumUnknownDefaultCase}} - {{#allowableValues}} - {{#enumVars}} - {{^-last}} - {{#jackson}} - @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), - {{/jackson}} - {{/-last}} - {{/enumVars}} - {{/allowableValues}} - {{/enumUnknownDefaultCase}} - } + {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{enumName}}{{operationIdCamelCase}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) { + {{^enumUnknownDefaultCase}} + {{#allowableValues}} + {{#enumVars}} + {{#jackson}} + @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}} + {{/jackson}} + {{/enumVars}} + {{/allowableValues}} + {{/enumUnknownDefaultCase}} + {{#enumUnknownDefaultCase}} + {{#allowableValues}} + {{#enumVars}} + {{^-last}} + {{#jackson}} + @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/jackson}} + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + {{/enumUnknownDefaultCase}} + } {{/isEnum}} {{/allParams}} @@ -70,7 +70,7 @@ import {{packageName}}.infrastructure.* {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - 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}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): Mono<{{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> { + fun {{operationId}}({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): Mono<{{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> { return {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) .map { {{#returnType}}it.body{{/returnType}}{{^returnType}}Unit{{/returnType}} } } @@ -79,7 +79,7 @@ import {{packageName}}.infrastructure.* {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - fun {{operationId}}WithHttpInfo({{#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}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): Mono> { + fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): Mono> { val localVariableConfig = {{operationId}}RequestConfig({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) return request<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map>{{/hasFormParams}}{{/hasBodyParam}}, {{{returnType}}}{{^returnType}}Unit{{/returnType}}>( localVariableConfig @@ -89,7 +89,7 @@ import {{packageName}}.infrastructure.* {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - fun {{operationId}}RequestConfig({{#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}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map>{{/hasFormParams}}{{/hasBodyParam}}> { + fun {{operationId}}RequestConfig({{#allParams}}{{{paramName}}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}{{operationIdCamelCase}}>{{/isContainer}}{{^isContainer}}{{enumName}}{{operationIdCamelCase}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{#defaultValue}} = {{>param_default_value}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map>{{/hasFormParams}}{{/hasBodyParam}}> { val localVariableBody = {{#hasBodyParam}}{{! }}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{! }}{{^hasFormParams}}null{{/hasFormParams}}{{! 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 new file mode 100644 index 00000000000..1639fdc5374 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/param_default_value.mustache @@ -0,0 +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 diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt index 515b383f1a3..ce7a48355e8 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt @@ -39,11 +39,11 @@ class HeaderApi(client: RestClient) : ApiClient(client) { /** * enum for parameter enumNonrefStringHeader */ - enum class EnumNonrefStringHeaderTestHeaderIntegerBooleanStringEnums(val value: kotlin.String) { - @JsonProperty(value = "success") success("success"), - @JsonProperty(value = "failure") failure("failure"), - @JsonProperty(value = "unclassified") unclassified("unclassified"), - } + enum class EnumNonrefStringHeaderTestHeaderIntegerBooleanStringEnums(val value: kotlin.String) { + @JsonProperty(value = "success") success("success"), + @JsonProperty(value = "failure") failure("failure"), + @JsonProperty(value = "unclassified") unclassified("unclassified"), + } @Throws(RestClientResponseException::class) diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/PathApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/PathApi.kt index 2b8592609d4..f1af5bd244a 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/PathApi.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/PathApi.kt @@ -39,11 +39,11 @@ class PathApi(client: RestClient) : ApiClient(client) { /** * enum for parameter enumNonrefStringPath */ - enum class EnumNonrefStringPathTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(val value: kotlin.String) { - @JsonProperty(value = "success") success("success"), - @JsonProperty(value = "failure") failure("failure"), - @JsonProperty(value = "unclassified") unclassified("unclassified"), - } + enum class EnumNonrefStringPathTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(val value: kotlin.String) { + @JsonProperty(value = "success") success("success"), + @JsonProperty(value = "failure") failure("failure"), + @JsonProperty(value = "unclassified") unclassified("unclassified"), + } @Throws(RestClientResponseException::class) diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/QueryApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/QueryApi.kt index d7e0a175ed3..3b2b78ffec9 100644 --- a/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/QueryApi.kt +++ b/samples/client/echo_api/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/QueryApi.kt @@ -41,11 +41,11 @@ class QueryApi(client: RestClient) : ApiClient(client) { /** * enum for parameter enumNonrefStringQuery */ - enum class EnumNonrefStringQueryTestEnumRefString(val value: kotlin.String) { - @JsonProperty(value = "success") success("success"), - @JsonProperty(value = "failure") failure("failure"), - @JsonProperty(value = "unclassified") unclassified("unclassified"), - } + enum class EnumNonrefStringQueryTestEnumRefString(val value: kotlin.String) { + @JsonProperty(value = "success") success("success"), + @JsonProperty(value = "failure") failure("failure"), + @JsonProperty(value = "unclassified") unclassified("unclassified"), + } @Throws(RestClientResponseException::class) diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/.openapi-generator-ignore b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md 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 new file mode 100644 index 00000000000..4d6a5844cce --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/.openapi-generator/FILES @@ -0,0 +1,43 @@ +README.md +build.gradle +docs/AuthApi.md +docs/Bird.md +docs/BodyApi.md +docs/Category.md +docs/DefaultValue.md +docs/FormApi.md +docs/HeaderApi.md +docs/NumberPropertiesOnly.md +docs/PathApi.md +docs/Pet.md +docs/Query.md +docs/QueryApi.md +docs/StringEnumRef.md +docs/Tag.md +docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +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/FormApi.kt +src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt +src/main/kotlin/org/openapitools/client/apis/PathApi.kt +src/main/kotlin/org/openapitools/client/apis/QueryApi.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt +src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/models/Bird.kt +src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/DefaultValue.kt +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/Tag.kt +src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/.openapi-generator/VERSION b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/.openapi-generator/VERSION new file mode 100644 index 00000000000..c9e125ba188 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.4.0-SNAPSHOT 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 new file mode 100644 index 00000000000..6ba004b4f2a --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/README.md @@ -0,0 +1,102 @@ +# org.openapitools.client - Kotlin client library for Echo Server API + +Echo Server API + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client. + +- API version: 0.1.0 +- Package version: +- Build package: org.openapitools.codegen.languages.KotlinClientCodegen + +## Requires + +* Kotlin 1.7.21 +* Gradle 7.5 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +## Features/Implementation Notes + +* Supports JSON inputs/outputs, File inputs, and Form inputs. +* Supports collection formats for query parameters: csv, tsv, ssv, pipes. +* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. +* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. + + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost:3000* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AuthApi* | [**testAuthHttpBasic**](docs/AuthApi.md#testauthhttpbasic) | **POST** /auth/http/basic | To test HTTP basic authentication +*AuthApi* | [**testAuthHttpBearer**](docs/AuthApi.md#testauthhttpbearer) | **POST** /auth/http/bearer | To test HTTP bearer authentication +*BodyApi* | [**testBinaryGif**](docs/BodyApi.md#testbinarygif) | **POST** /binary/gif | Test binary (gif) response body +*BodyApi* | [**testBodyApplicationOctetstreamBinary**](docs/BodyApi.md#testbodyapplicationoctetstreambinary) | **POST** /body/application/octetstream/binary | Test body parameter(s) +*BodyApi* | [**testBodyMultipartFormdataArrayOfBinary**](docs/BodyApi.md#testbodymultipartformdataarrayofbinary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime +*BodyApi* | [**testBodyMultipartFormdataSingleBinary**](docs/BodyApi.md#testbodymultipartformdatasinglebinary) | **POST** /body/application/octetstream/single_binary | Test single binary in multipart mime +*BodyApi* | [**testEchoBodyFreeFormObjectResponseString**](docs/BodyApi.md#testechobodyfreeformobjectresponsestring) | **POST** /echo/body/FreeFormObject/response_string | Test free form object +*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) +*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) +*PathApi* | [**testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](docs/PathApi.md#testspathstringpathstringintegerpathintegerenumnonrefstringpathenumrefstringpath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s) +*QueryApi* | [**testEnumRefString**](docs/QueryApi.md#testenumrefstring) | **GET** /query/enum_ref_string | Test query parameter(s) +*QueryApi* | [**testQueryDatetimeDateString**](docs/QueryApi.md#testquerydatetimedatestring) | **GET** /query/datetime/date/string | Test query parameter(s) +*QueryApi* | [**testQueryIntegerBooleanString**](docs/QueryApi.md#testqueryintegerbooleanstring) | **GET** /query/integer/boolean/string | Test query parameter(s) +*QueryApi* | [**testQueryStyleDeepObjectExplodeTrueObject**](docs/QueryApi.md#testquerystyledeepobjectexplodetrueobject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) +*QueryApi* | [**testQueryStyleFormExplodeTrueArrayString**](docs/QueryApi.md#testquerystyleformexplodetruearraystring) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) +*QueryApi* | [**testQueryStyleFormExplodeTrueObject**](docs/QueryApi.md#testquerystyleformexplodetrueobject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) + + + +## Documentation for Models + + - [org.openapitools.client.models.Bird](docs/Bird.md) + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.DefaultValue](docs/DefaultValue.md) + - [org.openapitools.client.models.NumberPropertiesOnly](docs/NumberPropertiesOnly.md) + - [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.Tag](docs/Tag.md) + - [org.openapitools.client.models.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter](docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md) + + + +## Documentation for Authorization + + +Authentication schemes defined for the API: + +### http_auth + +- **Type**: HTTP basic authentication + + +### http_bearer_auth + +- **Type**: HTTP Bearer Token authentication + + + +## Author + +team@openapitools.org diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/build.gradle b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/build.gradle new file mode 100644 index 00000000000..a650f5ebf2d --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/build.gradle @@ -0,0 +1,68 @@ +group 'org.openapitools' +version '1.0.0' + +wrapper { + gradleVersion = '7.5' + distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" +} + +buildscript { + ext.kotlin_version = '1.8.10' + ext.spring_boot_version = "3.2.0" + ext.spotless_version = "6.13.0" + + repositories { + maven { url "https://repo1.maven.org/maven2" } + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "com.diffplug.spotless:spotless-plugin-gradle:$spotless_version" + } +} + +apply plugin: 'kotlin' +apply plugin: 'maven-publish' +apply plugin: 'com.diffplug.spotless' + +repositories { + maven { url "https://repo1.maven.org/maven2" } +} + +// Use spotless plugin to automatically format code, remove unused import, etc +// To apply changes directly to the file, run `gradlew spotlessApply` +// Ref: https://github.com/diffplug/spotless/tree/main/plugin-gradle +spotless { + // comment out below to run spotless as part of the `check` task + enforceCheck false + + format 'misc', { + // define the files (e.g. '*.gradle', '*.md') to apply `misc` to + target '.gitignore' + + // define the steps to apply to those files + trimTrailingWhitespace() + indentWithSpaces() // Takes an integer argument if you don't like 4 + endWithNewline() + } + kotlin { + ktfmt() + } +} + +test { + useJUnitPlatform() +} + +kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of(17)) + } +} +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.14.3" + implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.3" + implementation "org.springframework.boot:spring-boot-starter-web:$spring_boot_version" + testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/AuthApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/AuthApi.md new file mode 100644 index 00000000000..b7ef4f547bd --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/AuthApi.md @@ -0,0 +1,101 @@ +# AuthApi + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testAuthHttpBasic**](AuthApi.md#testAuthHttpBasic) | **POST** /auth/http/basic | To test HTTP basic authentication +[**testAuthHttpBearer**](AuthApi.md#testAuthHttpBearer) | **POST** /auth/http/bearer | To test HTTP bearer authentication + + + +# **testAuthHttpBasic** +> kotlin.String testAuthHttpBasic() + +To test HTTP basic authentication + +To test HTTP basic authentication + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = AuthApi() +try { + val result : kotlin.String = apiInstance.testAuthHttpBasic() + println(result) +} catch (e: ClientException) { + println("4xx response calling AuthApi#testAuthHttpBasic") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling AuthApi#testAuthHttpBasic") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.String** + +### Authorization + + +Configure http_auth: + ApiClient.username = "" + ApiClient.password = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +# **testAuthHttpBearer** +> kotlin.String testAuthHttpBearer() + +To test HTTP bearer authentication + +To test HTTP bearer authentication + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = AuthApi() +try { + val result : kotlin.String = apiInstance.testAuthHttpBearer() + println(result) +} catch (e: ClientException) { + println("4xx response calling AuthApi#testAuthHttpBearer") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling AuthApi#testAuthHttpBearer") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.String** + +### Authorization + + +Configure http_bearer_auth: + ApiClient.accessToken = "" + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Bird.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Bird.md new file mode 100644 index 00000000000..878335adf52 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Bird.md @@ -0,0 +1,11 @@ + +# Bird + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**propertySize** | **kotlin.String** | | [optional] +**color** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/BodyApi.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/BodyApi.md new file mode 100644 index 00000000000..8a02fa98c10 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/BodyApi.md @@ -0,0 +1,388 @@ +# BodyApi + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testBinaryGif**](BodyApi.md#testBinaryGif) | **POST** /binary/gif | Test binary (gif) response body +[**testBodyApplicationOctetstreamBinary**](BodyApi.md#testBodyApplicationOctetstreamBinary) | **POST** /body/application/octetstream/binary | Test body parameter(s) +[**testBodyMultipartFormdataArrayOfBinary**](BodyApi.md#testBodyMultipartFormdataArrayOfBinary) | **POST** /body/application/octetstream/array_of_binary | Test array of binary in multipart mime +[**testBodyMultipartFormdataSingleBinary**](BodyApi.md#testBodyMultipartFormdataSingleBinary) | **POST** /body/application/octetstream/single_binary | Test single binary in multipart mime +[**testEchoBodyFreeFormObjectResponseString**](BodyApi.md#testEchoBodyFreeFormObjectResponseString) | **POST** /echo/body/FreeFormObject/response_string | Test free form object +[**testEchoBodyPet**](BodyApi.md#testEchoBodyPet) | **POST** /echo/body/Pet | Test body parameter(s) +[**testEchoBodyPetResponseString**](BodyApi.md#testEchoBodyPetResponseString) | **POST** /echo/body/Pet/response_string | Test empty response body +[**testEchoBodyTagResponseString**](BodyApi.md#testEchoBodyTagResponseString) | **POST** /echo/body/Tag/response_string | Test empty json (request body) + + + +# **testBinaryGif** +> java.io.File testBinaryGif() + +Test binary (gif) response body + +Test binary (gif) response body + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = BodyApi() +try { + val result : java.io.File = apiInstance.testBinaryGif() + println(result) +} catch (e: ClientException) { + println("4xx response calling BodyApi#testBinaryGif") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling BodyApi#testBinaryGif") + e.printStackTrace() +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**java.io.File**](java.io.File.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: image/gif + + +# **testBodyApplicationOctetstreamBinary** +> kotlin.String testBodyApplicationOctetstreamBinary(body) + +Test body parameter(s) + +Test body parameter(s) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = BodyApi() +val body : java.io.File = BINARY_DATA_HERE // java.io.File | +try { + val result : kotlin.String = apiInstance.testBodyApplicationOctetstreamBinary(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling BodyApi#testBodyApplicationOctetstreamBinary") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling BodyApi#testBodyApplicationOctetstreamBinary") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **java.io.File**| | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/octet-stream + - **Accept**: text/plain + + +# **testBodyMultipartFormdataArrayOfBinary** +> kotlin.String testBodyMultipartFormdataArrayOfBinary(files) + +Test array of binary in multipart mime + +Test array of binary in multipart mime + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = BodyApi() +val files : kotlin.collections.List = /path/to/file.txt // kotlin.collections.List | +try { + val result : kotlin.String = apiInstance.testBodyMultipartFormdataArrayOfBinary(files) + println(result) +} catch (e: ClientException) { + println("4xx response calling BodyApi#testBodyMultipartFormdataArrayOfBinary") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling BodyApi#testBodyMultipartFormdataArrayOfBinary") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **files** | **kotlin.collections.List<java.io.File>**| | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: text/plain + + +# **testBodyMultipartFormdataSingleBinary** +> kotlin.String testBodyMultipartFormdataSingleBinary(myFile) + +Test single binary in multipart mime + +Test single binary in multipart mime + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = BodyApi() +val myFile : java.io.File = BINARY_DATA_HERE // java.io.File | +try { + val result : kotlin.String = apiInstance.testBodyMultipartFormdataSingleBinary(myFile) + println(result) +} catch (e: ClientException) { + println("4xx response calling BodyApi#testBodyMultipartFormdataSingleBinary") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling BodyApi#testBodyMultipartFormdataSingleBinary") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **myFile** | **java.io.File**| | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: text/plain + + +# **testEchoBodyFreeFormObjectResponseString** +> kotlin.String testEchoBodyFreeFormObjectResponseString(body) + +Test free form object + +Test free form object + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = BodyApi() +val body : kotlin.Any = Object // kotlin.Any | Free form object +try { + val result : kotlin.String = apiInstance.testEchoBodyFreeFormObjectResponseString(body) + println(result) +} catch (e: ClientException) { + println("4xx response calling BodyApi#testEchoBodyFreeFormObjectResponseString") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling BodyApi#testEchoBodyFreeFormObjectResponseString") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **kotlin.Any**| Free form object | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: text/plain + + +# **testEchoBodyPet** +> Pet testEchoBodyPet(pet) + +Test body parameter(s) + +Test body parameter(s) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = BodyApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + val result : Pet = apiInstance.testEchoBodyPet(pet) + println(result) +} catch (e: ClientException) { + println("4xx response calling BodyApi#testEchoBodyPet") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling BodyApi#testEchoBodyPet") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **testEchoBodyPetResponseString** +> kotlin.String testEchoBodyPetResponseString(pet) + +Test empty response body + +Test empty response body + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = BodyApi() +val pet : Pet = // Pet | Pet object that needs to be added to the store +try { + val result : kotlin.String = apiInstance.testEchoBodyPetResponseString(pet) + println(result) +} catch (e: ClientException) { + println("4xx response calling BodyApi#testEchoBodyPetResponseString") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling BodyApi#testEchoBodyPetResponseString") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: text/plain + + +# **testEchoBodyTagResponseString** +> kotlin.String testEchoBodyTagResponseString(tag) + +Test empty json (request body) + +Test empty json (request body) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = BodyApi() +val tag : Tag = // Tag | Tag object +try { + val result : kotlin.String = apiInstance.testEchoBodyTagResponseString(tag) + println(result) +} catch (e: ClientException) { + println("4xx response calling BodyApi#testEchoBodyTagResponseString") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling BodyApi#testEchoBodyTagResponseString") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tag** | [**Tag**](Tag.md)| Tag object | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: text/plain + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Category.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Category.md new file mode 100644 index 00000000000..2c28a670fc7 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/DefaultValue.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/DefaultValue.md new file mode 100644 index 00000000000..de65ccf8d7c --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/DefaultValue.md @@ -0,0 +1,24 @@ + +# DefaultValue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayStringEnumRefDefault** | [**kotlin.collections.List<StringEnumRef>**](StringEnumRef.md) | | [optional] +**arrayStringEnumDefault** | [**inline**](#kotlin.collections.List<ArrayStringEnumDefault>) | | [optional] +**arrayStringDefault** | **kotlin.collections.List<kotlin.String>** | | [optional] +**arrayIntegerDefault** | **kotlin.collections.List<kotlin.Int>** | | [optional] +**arrayString** | **kotlin.collections.List<kotlin.String>** | | [optional] +**arrayStringNullable** | **kotlin.collections.List<kotlin.String>** | | [optional] +**arrayStringExtensionNullable** | **kotlin.collections.List<kotlin.String>** | | [optional] +**stringNullable** | **kotlin.String** | | [optional] + + + +## Enum: array_string_enum_default +Name | Value +---- | ----- +arrayStringEnumDefault | success, failure, unclassified + + + 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 new file mode 100644 index 00000000000..0b420b90654 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/FormApi.md @@ -0,0 +1,118 @@ +# FormApi + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testFormIntegerBooleanString**](FormApi.md#testFormIntegerBooleanString) | **POST** /form/integer/boolean/string | Test form parameter(s) +[**testFormOneof**](FormApi.md#testFormOneof) | **POST** /form/oneof | Test form parameter(s) for oneOf schema + + + +# **testFormIntegerBooleanString** +> kotlin.String testFormIntegerBooleanString(integerForm, booleanForm, stringForm) + +Test form parameter(s) + +Test form parameter(s) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FormApi() +val integerForm : kotlin.Int = 56 // kotlin.Int | +val booleanForm : kotlin.Boolean = true // kotlin.Boolean | +val stringForm : kotlin.String = stringForm_example // kotlin.String | +try { + val result : kotlin.String = apiInstance.testFormIntegerBooleanString(integerForm, booleanForm, stringForm) + println(result) +} catch (e: ClientException) { + println("4xx response calling FormApi#testFormIntegerBooleanString") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FormApi#testFormIntegerBooleanString") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integerForm** | **kotlin.Int**| | [optional] + **booleanForm** | **kotlin.Boolean**| | [optional] + **stringForm** | **kotlin.String**| | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: text/plain + + +# **testFormOneof** +> kotlin.String testFormOneof(form1, form2, form3, form4, id, name) + +Test form parameter(s) for oneOf schema + +Test form parameter(s) for oneOf schema + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = FormApi() +val form1 : kotlin.String = form1_example // kotlin.String | +val form2 : kotlin.Int = 56 // kotlin.Int | +val form3 : kotlin.String = form3_example // kotlin.String | +val form4 : kotlin.Boolean = true // kotlin.Boolean | +val id : kotlin.Long = 789 // kotlin.Long | +val name : kotlin.String = name_example // kotlin.String | +try { + val result : kotlin.String = apiInstance.testFormOneof(form1, form2, form3, form4, id, name) + println(result) +} catch (e: ClientException) { + println("4xx response calling FormApi#testFormOneof") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling FormApi#testFormOneof") + e.printStackTrace() +} +``` + +### 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** | **kotlin.String**| | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: text/plain + 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 new file mode 100644 index 00000000000..1d38dda946f --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/HeaderApi.md @@ -0,0 +1,64 @@ +# HeaderApi + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testHeaderIntegerBooleanStringEnums**](HeaderApi.md#testHeaderIntegerBooleanStringEnums) | **GET** /header/integer/boolean/string/enums | Test header parameter(s) + + + +# **testHeaderIntegerBooleanStringEnums** +> kotlin.String testHeaderIntegerBooleanStringEnums(integerHeader, booleanHeader, stringHeader, enumNonrefStringHeader, enumRefStringHeader) + +Test header parameter(s) + +Test header parameter(s) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = HeaderApi() +val integerHeader : kotlin.Int = 56 // kotlin.Int | +val booleanHeader : kotlin.Boolean = true // kotlin.Boolean | +val stringHeader : kotlin.String = stringHeader_example // kotlin.String | +val enumNonrefStringHeader : kotlin.String = enumNonrefStringHeader_example // kotlin.String | +val enumRefStringHeader : StringEnumRef = // StringEnumRef | +try { + val result : kotlin.String = apiInstance.testHeaderIntegerBooleanStringEnums(integerHeader, booleanHeader, stringHeader, enumNonrefStringHeader, enumRefStringHeader) + println(result) +} catch (e: ClientException) { + println("4xx response calling HeaderApi#testHeaderIntegerBooleanStringEnums") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling HeaderApi#testHeaderIntegerBooleanStringEnums") + e.printStackTrace() +} +``` + +### 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] + **enumRefStringHeader** | [**StringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] + +### 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/NumberPropertiesOnly.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/NumberPropertiesOnly.md new file mode 100644 index 00000000000..d601af65669 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/NumberPropertiesOnly.md @@ -0,0 +1,12 @@ + +# NumberPropertiesOnly + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional] +**float** | **kotlin.Float** | | [optional] +**double** | **kotlin.Double** | | [optional] + + + 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 new file mode 100644 index 00000000000..129553d02c1 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/PathApi.md @@ -0,0 +1,62 @@ +# PathApi + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath**](PathApi.md#testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath) | **GET** /path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path} | Test path parameter(s) + + + +# **testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath** +> kotlin.String testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath) + +Test path parameter(s) + +Test path parameter(s) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = PathApi() +val pathString : kotlin.String = pathString_example // kotlin.String | +val pathInteger : kotlin.Int = 56 // kotlin.Int | +val enumNonrefStringPath : kotlin.String = enumNonrefStringPath_example // kotlin.String | +val enumRefStringPath : StringEnumRef = // StringEnumRef | +try { + val result : kotlin.String = apiInstance.testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath) + println(result) +} catch (e: ClientException) { + println("4xx response calling PathApi#testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling PathApi#testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pathString** | **kotlin.String**| | + **pathInteger** | **kotlin.Int**| | + **enumNonrefStringPath** | **kotlin.String**| | [enum: success, failure, unclassified] + **enumRefStringPath** | [**StringEnumRef**](.md)| | [enum: success, failure, unclassified] + +### 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/Pet.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Pet.md new file mode 100644 index 00000000000..da70fca06e6 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**photoUrls** | **kotlin.collections.List<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] +**status** | [**inline**](#Status) | pet status in the store | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | available, pending, sold + + + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Query.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Query.md new file mode 100644 index 00000000000..85d53f6f088 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Query.md @@ -0,0 +1,18 @@ + +# Query + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | Query | [optional] +**outcomes** | [**inline**](#kotlin.collections.List<Outcomes>) | | [optional] + + + +## Enum: outcomes +Name | Value +---- | ----- +outcomes | SUCCESS, FAILURE, SKIPPED + + + 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 new file mode 100644 index 00000000000..443718661d3 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/QueryApi.md @@ -0,0 +1,306 @@ +# QueryApi + +All URIs are relative to *http://localhost:3000* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testEnumRefString**](QueryApi.md#testEnumRefString) | **GET** /query/enum_ref_string | Test query parameter(s) +[**testQueryDatetimeDateString**](QueryApi.md#testQueryDatetimeDateString) | **GET** /query/datetime/date/string | Test query parameter(s) +[**testQueryIntegerBooleanString**](QueryApi.md#testQueryIntegerBooleanString) | **GET** /query/integer/boolean/string | Test query parameter(s) +[**testQueryStyleDeepObjectExplodeTrueObject**](QueryApi.md#testQueryStyleDeepObjectExplodeTrueObject) | **GET** /query/style_deepObject/explode_true/object | Test query parameter(s) +[**testQueryStyleFormExplodeTrueArrayString**](QueryApi.md#testQueryStyleFormExplodeTrueArrayString) | **GET** /query/style_form/explode_true/array_string | Test query parameter(s) +[**testQueryStyleFormExplodeTrueObject**](QueryApi.md#testQueryStyleFormExplodeTrueObject) | **GET** /query/style_form/explode_true/object | Test query parameter(s) + + + +# **testEnumRefString** +> kotlin.String testEnumRefString(enumNonrefStringQuery, enumRefStringQuery) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = QueryApi() +val enumNonrefStringQuery : kotlin.String = enumNonrefStringQuery_example // kotlin.String | +val enumRefStringQuery : StringEnumRef = // StringEnumRef | +try { + val result : kotlin.String = apiInstance.testEnumRefString(enumNonrefStringQuery, enumRefStringQuery) + println(result) +} catch (e: ClientException) { + println("4xx response calling QueryApi#testEnumRefString") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling QueryApi#testEnumRefString") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumNonrefStringQuery** | **kotlin.String**| | [optional] [enum: success, failure, unclassified] + **enumRefStringQuery** | [**StringEnumRef**](.md)| | [optional] [enum: success, failure, unclassified] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +# **testQueryDatetimeDateString** +> kotlin.String testQueryDatetimeDateString(datetimeQuery, dateQuery, stringQuery) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = QueryApi() +val datetimeQuery : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | +val dateQuery : java.time.LocalDate = 2013-10-20 // java.time.LocalDate | +val stringQuery : kotlin.String = stringQuery_example // kotlin.String | +try { + val result : kotlin.String = apiInstance.testQueryDatetimeDateString(datetimeQuery, dateQuery, stringQuery) + println(result) +} catch (e: ClientException) { + println("4xx response calling QueryApi#testQueryDatetimeDateString") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling QueryApi#testQueryDatetimeDateString") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **datetimeQuery** | **java.time.OffsetDateTime**| | [optional] + **dateQuery** | **java.time.LocalDate**| | [optional] + **stringQuery** | **kotlin.String**| | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +# **testQueryIntegerBooleanString** +> kotlin.String testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = QueryApi() +val integerQuery : kotlin.Int = 56 // kotlin.Int | +val booleanQuery : kotlin.Boolean = true // kotlin.Boolean | +val stringQuery : kotlin.String = stringQuery_example // kotlin.String | +try { + val result : kotlin.String = apiInstance.testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery) + println(result) +} catch (e: ClientException) { + println("4xx response calling QueryApi#testQueryIntegerBooleanString") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling QueryApi#testQueryIntegerBooleanString") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **integerQuery** | **kotlin.Int**| | [optional] + **booleanQuery** | **kotlin.Boolean**| | [optional] + **stringQuery** | **kotlin.String**| | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +# **testQueryStyleDeepObjectExplodeTrueObject** +> kotlin.String testQueryStyleDeepObjectExplodeTrueObject(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = QueryApi() +val queryObject : Pet = // Pet | +try { + val result : kotlin.String = apiInstance.testQueryStyleDeepObjectExplodeTrueObject(queryObject) + println(result) +} catch (e: ClientException) { + println("4xx response calling QueryApi#testQueryStyleDeepObjectExplodeTrueObject") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling QueryApi#testQueryStyleDeepObjectExplodeTrueObject") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | [**Pet**](.md)| | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +# **testQueryStyleFormExplodeTrueArrayString** +> kotlin.String testQueryStyleFormExplodeTrueArrayString(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = QueryApi() +val queryObject : TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter = // TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter | +try { + val result : kotlin.String = apiInstance.testQueryStyleFormExplodeTrueArrayString(queryObject) + println(result) +} catch (e: ClientException) { + println("4xx response calling QueryApi#testQueryStyleFormExplodeTrueArrayString") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling QueryApi#testQueryStyleFormExplodeTrueArrayString") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | [**TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter**](.md)| | [optional] + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/plain + + +# **testQueryStyleFormExplodeTrueObject** +> kotlin.String testQueryStyleFormExplodeTrueObject(queryObject) + +Test query parameter(s) + +Test query parameter(s) + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiInstance = QueryApi() +val queryObject : Pet = // Pet | +try { + val result : kotlin.String = apiInstance.testQueryStyleFormExplodeTrueObject(queryObject) + println(result) +} catch (e: ClientException) { + println("4xx response calling QueryApi#testQueryStyleFormExplodeTrueObject") + e.printStackTrace() +} catch (e: ServerException) { + println("5xx response calling QueryApi#testQueryStyleFormExplodeTrueObject") + e.printStackTrace() +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **queryObject** | [**Pet**](.md)| | [optional] + +### 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/StringEnumRef.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/StringEnumRef.md new file mode 100644 index 00000000000..d61e16ef26b --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/StringEnumRef.md @@ -0,0 +1,16 @@ + +# StringEnumRef + +## Enum + + + * `success` (value: `"success"`) + + * `failure` (value: `"failure"`) + + * `unclassified` (value: `"unclassified"`) + + * `unknownDefaultOpenApi` (value: `"unknown_default_open_api"`) + + + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Tag.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Tag.md new file mode 100644 index 00000000000..60ce1bcdbad --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md new file mode 100644 index 00000000000..63e23617161 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/docs/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.md @@ -0,0 +1,10 @@ + +# TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**propertyValues** | **kotlin.collections.List<kotlin.String>** | | [optional] + + + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.jar b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000000..c1962a79e29 Binary files /dev/null and b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.properties b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000000..8707e8b5067 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +networkTimeout=10000 +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradlew b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradlew new file mode 100644 index 00000000000..aeb74cbb43e --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradlew @@ -0,0 +1,245 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradlew.bat b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradlew.bat new file mode 100644 index 00000000000..93e3f59f135 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/settings.gradle b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/settings.gradle new file mode 100644 index 00000000000..854d039d418 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-client' diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/AuthApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/AuthApi.kt new file mode 100644 index 00000000000..cc3e26512b0 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/AuthApi.kt @@ -0,0 +1,108 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +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.* + +class AuthApi(client: RestClient) : ApiClient(client) { + + constructor(baseUrl: String) : this(RestClient.builder() + .baseUrl(baseUrl) + .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .build() + ) + + + @Throws(RestClientResponseException::class) + fun testAuthHttpBasic(): kotlin.String { + val result = testAuthHttpBasicWithHttpInfo() + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testAuthHttpBasicWithHttpInfo(): ResponseEntity { + val localVariableConfig = testAuthHttpBasicRequestConfig() + return request( + localVariableConfig + ) + } + + fun testAuthHttpBasicRequestConfig() : RequestConfig { + val localVariableBody = null + val localVariableQuery = mutableMapOf>() + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.POST, + path = "/auth/http/basic", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = true, + body = localVariableBody + ) + } + + + @Throws(RestClientResponseException::class) + fun testAuthHttpBearer(): kotlin.String { + val result = testAuthHttpBearerWithHttpInfo() + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testAuthHttpBearerWithHttpInfo(): ResponseEntity { + val localVariableConfig = testAuthHttpBearerRequestConfig() + return request( + localVariableConfig + ) + } + + fun testAuthHttpBearerRequestConfig() : RequestConfig { + val localVariableBody = null + val localVariableQuery = mutableMapOf>() + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.POST, + path = "/auth/http/bearer", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = true, + body = localVariableBody + ) + } + +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/BodyApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/BodyApi.kt new file mode 100644 index 00000000000..44ca769307d --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/BodyApi.kt @@ -0,0 +1,327 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +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.models.Pet +import org.openapitools.client.models.Tag +import org.openapitools.client.infrastructure.* + +class BodyApi(client: RestClient) : ApiClient(client) { + + constructor(baseUrl: String) : this(RestClient.builder() + .baseUrl(baseUrl) + .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .build() + ) + + + @Throws(RestClientResponseException::class) + fun testBinaryGif(): java.io.File { + val result = testBinaryGifWithHttpInfo() + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testBinaryGifWithHttpInfo(): ResponseEntity { + val localVariableConfig = testBinaryGifRequestConfig() + return request( + localVariableConfig + ) + } + + fun testBinaryGifRequestConfig() : RequestConfig { + val localVariableBody = null + val localVariableQuery = mutableMapOf>() + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "image/gif" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.POST, + path = "/binary/gif", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + + + @Throws(RestClientResponseException::class) + fun testBodyApplicationOctetstreamBinary(body: java.io.File? = null): kotlin.String { + val result = testBodyApplicationOctetstreamBinaryWithHttpInfo(body = body) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testBodyApplicationOctetstreamBinaryWithHttpInfo(body: java.io.File? = null): ResponseEntity { + val localVariableConfig = testBodyApplicationOctetstreamBinaryRequestConfig(body = body) + return request( + localVariableConfig + ) + } + + fun testBodyApplicationOctetstreamBinaryRequestConfig(body: java.io.File? = null) : RequestConfig { + val localVariableBody = body + val localVariableQuery = mutableMapOf>() + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/octet-stream" + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.POST, + path = "/body/application/octetstream/binary", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + + + @Throws(RestClientResponseException::class) + fun testBodyMultipartFormdataArrayOfBinary(files: kotlin.collections.List): kotlin.String { + val result = testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files = files) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testBodyMultipartFormdataArrayOfBinaryWithHttpInfo(files: kotlin.collections.List): ResponseEntity { + val localVariableConfig = testBodyMultipartFormdataArrayOfBinaryRequestConfig(files = files) + return request>, kotlin.String>( + localVariableConfig + ) + } + + fun testBodyMultipartFormdataArrayOfBinaryRequestConfig(files: kotlin.collections.List) : RequestConfig>> { + val localVariableBody = mapOf( + "files" to PartConfig(body = files, headers = mutableMapOf()),) + val localVariableQuery = mutableMapOf>() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.POST, + path = "/body/application/octetstream/array_of_binary", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + + + @Throws(RestClientResponseException::class) + fun testBodyMultipartFormdataSingleBinary(myFile: java.io.File? = null): kotlin.String { + val result = testBodyMultipartFormdataSingleBinaryWithHttpInfo(myFile = myFile) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testBodyMultipartFormdataSingleBinaryWithHttpInfo(myFile: java.io.File? = null): ResponseEntity { + val localVariableConfig = testBodyMultipartFormdataSingleBinaryRequestConfig(myFile = myFile) + return request>, kotlin.String>( + localVariableConfig + ) + } + + fun testBodyMultipartFormdataSingleBinaryRequestConfig(myFile: java.io.File? = null) : RequestConfig>> { + val localVariableBody = mapOf( + "my-file" to PartConfig(body = myFile, headers = mutableMapOf()),) + val localVariableQuery = mutableMapOf>() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.POST, + path = "/body/application/octetstream/single_binary", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + + + @Throws(RestClientResponseException::class) + fun testEchoBodyFreeFormObjectResponseString(body: kotlin.Any? = null): kotlin.String { + val result = testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body = body) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testEchoBodyFreeFormObjectResponseStringWithHttpInfo(body: kotlin.Any? = null): ResponseEntity { + val localVariableConfig = testEchoBodyFreeFormObjectResponseStringRequestConfig(body = body) + return request( + localVariableConfig + ) + } + + fun testEchoBodyFreeFormObjectResponseStringRequestConfig(body: kotlin.Any? = null) : RequestConfig { + val localVariableBody = body + val localVariableQuery = mutableMapOf>() + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.POST, + path = "/echo/body/FreeFormObject/response_string", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + + + @Throws(RestClientResponseException::class) + fun testEchoBodyPet(pet: Pet? = null): Pet { + val result = testEchoBodyPetWithHttpInfo(pet = pet) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testEchoBodyPetWithHttpInfo(pet: Pet? = null): ResponseEntity { + val localVariableConfig = testEchoBodyPetRequestConfig(pet = pet) + return request( + localVariableConfig + ) + } + + fun testEchoBodyPetRequestConfig(pet: Pet? = null) : RequestConfig { + val localVariableBody = pet + val localVariableQuery = mutableMapOf>() + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "application/json" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.POST, + path = "/echo/body/Pet", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + + + @Throws(RestClientResponseException::class) + fun testEchoBodyPetResponseString(pet: Pet? = null): kotlin.String { + val result = testEchoBodyPetResponseStringWithHttpInfo(pet = pet) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testEchoBodyPetResponseStringWithHttpInfo(pet: Pet? = null): ResponseEntity { + val localVariableConfig = testEchoBodyPetResponseStringRequestConfig(pet = pet) + return request( + localVariableConfig + ) + } + + fun testEchoBodyPetResponseStringRequestConfig(pet: Pet? = null) : RequestConfig { + val localVariableBody = pet + val localVariableQuery = mutableMapOf>() + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.POST, + path = "/echo/body/Pet/response_string", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + + + @Throws(RestClientResponseException::class) + fun testEchoBodyTagResponseString(tag: Tag? = null): kotlin.String { + val result = testEchoBodyTagResponseStringWithHttpInfo(tag = tag) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testEchoBodyTagResponseStringWithHttpInfo(tag: Tag? = null): ResponseEntity { + val localVariableConfig = testEchoBodyTagResponseStringRequestConfig(tag = tag) + return request( + localVariableConfig + ) + } + + fun testEchoBodyTagResponseStringRequestConfig(tag: Tag? = null) : RequestConfig { + val localVariableBody = tag + val localVariableQuery = mutableMapOf>() + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Content-Type"] = "application/json" + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.POST, + path = "/echo/body/Tag/response_string", + 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/apis/FormApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/FormApi.kt new file mode 100644 index 00000000000..c45ae1a23b6 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/FormApi.kt @@ -0,0 +1,117 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +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.* + +class FormApi(client: RestClient) : ApiClient(client) { + + constructor(baseUrl: String) : this(RestClient.builder() + .baseUrl(baseUrl) + .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .build() + ) + + + @Throws(RestClientResponseException::class) + fun testFormIntegerBooleanString(integerForm: kotlin.Int? = null, booleanForm: kotlin.Boolean? = null, stringForm: kotlin.String? = null): kotlin.String { + val result = testFormIntegerBooleanStringWithHttpInfo(integerForm = integerForm, booleanForm = booleanForm, stringForm = stringForm) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testFormIntegerBooleanStringWithHttpInfo(integerForm: kotlin.Int? = null, booleanForm: kotlin.Boolean? = null, stringForm: kotlin.String? = null): ResponseEntity { + val localVariableConfig = testFormIntegerBooleanStringRequestConfig(integerForm = integerForm, booleanForm = booleanForm, stringForm = stringForm) + return request>, kotlin.String>( + localVariableConfig + ) + } + + fun testFormIntegerBooleanStringRequestConfig(integerForm: kotlin.Int? = null, booleanForm: kotlin.Boolean? = null, stringForm: kotlin.String? = null) : RequestConfig>> { + val localVariableBody = mapOf( + "integer_form" to PartConfig(body = integerForm, headers = mutableMapOf()), + "boolean_form" to PartConfig(body = booleanForm, headers = mutableMapOf()), + "string_form" to PartConfig(body = stringForm, headers = mutableMapOf()),) + val localVariableQuery = mutableMapOf>() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.POST, + path = "/form/integer/boolean/string", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + + + @Throws(RestClientResponseException::class) + fun testFormOneof(form1: kotlin.String? = null, form2: kotlin.Int? = null, form3: kotlin.String? = null, form4: kotlin.Boolean? = null, id: kotlin.Long? = null, name: kotlin.String? = null): kotlin.String { + val result = testFormOneofWithHttpInfo(form1 = form1, form2 = form2, form3 = form3, form4 = form4, id = id, name = name) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testFormOneofWithHttpInfo(form1: kotlin.String? = null, form2: kotlin.Int? = null, form3: kotlin.String? = null, form4: kotlin.Boolean? = null, id: kotlin.Long? = null, name: kotlin.String? = null): ResponseEntity { + val localVariableConfig = testFormOneofRequestConfig(form1 = form1, form2 = form2, form3 = form3, form4 = form4, id = id, name = name) + return request>, kotlin.String>( + localVariableConfig + ) + } + + fun testFormOneofRequestConfig(form1: kotlin.String? = null, form2: kotlin.Int? = null, form3: kotlin.String? = null, form4: kotlin.Boolean? = null, id: kotlin.Long? = null, name: kotlin.String? = null) : RequestConfig>> { + val localVariableBody = mapOf( + "form1" to PartConfig(body = form1, headers = mutableMapOf()), + "form2" to PartConfig(body = form2, headers = mutableMapOf()), + "form3" to PartConfig(body = form3, headers = mutableMapOf()), + "form4" to PartConfig(body = form4, headers = mutableMapOf()), + "id" to PartConfig(body = id, headers = mutableMapOf()), + "name" to PartConfig(body = name, headers = mutableMapOf()),) + val localVariableQuery = mutableMapOf>() + val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.POST, + path = "/form/oneof", + 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/apis/HeaderApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt new file mode 100644 index 00000000000..ce7a48355e8 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/HeaderApi.kt @@ -0,0 +1,88 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +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.models.StringEnumRef +import org.openapitools.client.infrastructure.* + +class HeaderApi(client: RestClient) : ApiClient(client) { + + constructor(baseUrl: String) : this(RestClient.builder() + .baseUrl(baseUrl) + .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .build() + ) + + /** + * enum for parameter enumNonrefStringHeader + */ + enum class EnumNonrefStringHeaderTestHeaderIntegerBooleanStringEnums(val value: kotlin.String) { + @JsonProperty(value = "success") success("success"), + @JsonProperty(value = "failure") failure("failure"), + @JsonProperty(value = "unclassified") unclassified("unclassified"), + } + + + @Throws(RestClientResponseException::class) + fun testHeaderIntegerBooleanStringEnums(integerHeader: kotlin.Int? = null, booleanHeader: kotlin.Boolean? = null, stringHeader: kotlin.String? = null, enumNonrefStringHeader: EnumNonrefStringHeaderTestHeaderIntegerBooleanStringEnums? = null, enumRefStringHeader: StringEnumRef? = null): kotlin.String { + val result = testHeaderIntegerBooleanStringEnumsWithHttpInfo(integerHeader = integerHeader, booleanHeader = booleanHeader, stringHeader = stringHeader, enumNonrefStringHeader = enumNonrefStringHeader, enumRefStringHeader = enumRefStringHeader) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testHeaderIntegerBooleanStringEnumsWithHttpInfo(integerHeader: kotlin.Int? = null, booleanHeader: kotlin.Boolean? = null, stringHeader: kotlin.String? = null, enumNonrefStringHeader: EnumNonrefStringHeaderTestHeaderIntegerBooleanStringEnums? = null, enumRefStringHeader: StringEnumRef? = null): ResponseEntity { + val localVariableConfig = testHeaderIntegerBooleanStringEnumsRequestConfig(integerHeader = integerHeader, booleanHeader = booleanHeader, stringHeader = stringHeader, enumNonrefStringHeader = enumNonrefStringHeader, enumRefStringHeader = enumRefStringHeader) + return request( + localVariableConfig + ) + } + + fun testHeaderIntegerBooleanStringEnumsRequestConfig(integerHeader: kotlin.Int? = null, booleanHeader: kotlin.Boolean? = null, stringHeader: kotlin.String? = null, enumNonrefStringHeader: EnumNonrefStringHeaderTestHeaderIntegerBooleanStringEnums? = null, enumRefStringHeader: StringEnumRef? = null) : RequestConfig { + val localVariableBody = null + val localVariableQuery = mutableMapOf>() + val localVariableHeaders: MutableMap = mutableMapOf() + integerHeader?.apply { localVariableHeaders["integer_header"] = this.toString() } + booleanHeader?.apply { localVariableHeaders["boolean_header"] = this.toString() } + stringHeader?.apply { localVariableHeaders["string_header"] = this.toString() } + enumNonrefStringHeader?.apply { localVariableHeaders["enum_nonref_string_header"] = this.toString() } + enumRefStringHeader?.apply { localVariableHeaders["enum_ref_string_header"] = this.toString() } + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.GET, + path = "/header/integer/boolean/string/enums", + 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/apis/PathApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/PathApi.kt new file mode 100644 index 00000000000..f1af5bd244a --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/PathApi.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", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +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.models.StringEnumRef +import org.openapitools.client.infrastructure.* + +class PathApi(client: RestClient) : ApiClient(client) { + + constructor(baseUrl: String) : this(RestClient.builder() + .baseUrl(baseUrl) + .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .build() + ) + + /** + * enum for parameter enumNonrefStringPath + */ + enum class EnumNonrefStringPathTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(val value: kotlin.String) { + @JsonProperty(value = "success") success("success"), + @JsonProperty(value = "failure") failure("failure"), + @JsonProperty(value = "unclassified") unclassified("unclassified"), + } + + + @Throws(RestClientResponseException::class) + fun testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString: kotlin.String, pathInteger: kotlin.Int, enumNonrefStringPath: EnumNonrefStringPathTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath, enumRefStringPath: StringEnumRef): kotlin.String { + val result = testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(pathString = pathString, pathInteger = pathInteger, enumNonrefStringPath = enumNonrefStringPath, enumRefStringPath = enumRefStringPath) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathWithHttpInfo(pathString: kotlin.String, pathInteger: kotlin.Int, enumNonrefStringPath: EnumNonrefStringPathTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath, enumRefStringPath: StringEnumRef): ResponseEntity { + val localVariableConfig = testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequestConfig(pathString = pathString, pathInteger = pathInteger, enumNonrefStringPath = enumNonrefStringPath, enumRefStringPath = enumRefStringPath) + return request( + localVariableConfig + ) + } + + fun testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPathRequestConfig(pathString: kotlin.String, pathInteger: kotlin.Int, enumNonrefStringPath: EnumNonrefStringPathTestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath, enumRefStringPath: StringEnumRef) : RequestConfig { + val localVariableBody = null + val localVariableQuery = mutableMapOf>() + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + "path_string" to pathString, + "path_integer" to pathInteger, + "enum_nonref_string_path" to enumNonrefStringPath.value, + "enum_ref_string_path" to enumRefStringPath, + ) + + return RequestConfig( + method = RequestMethod.GET, + path = "/path/string/{path_string}/integer/{path_integer}/{enum_nonref_string_path}/{enum_ref_string_path}", + 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/apis/QueryApi.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/QueryApi.kt new file mode 100644 index 00000000000..3b2b78ffec9 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/QueryApi.kt @@ -0,0 +1,305 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +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.models.Pet +import org.openapitools.client.models.StringEnumRef +import org.openapitools.client.models.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter +import org.openapitools.client.infrastructure.* + +class QueryApi(client: RestClient) : ApiClient(client) { + + constructor(baseUrl: String) : this(RestClient.builder() + .baseUrl(baseUrl) + .messageConverters { it.add(MappingJackson2HttpMessageConverter()) } + .build() + ) + + /** + * enum for parameter enumNonrefStringQuery + */ + enum class EnumNonrefStringQueryTestEnumRefString(val value: kotlin.String) { + @JsonProperty(value = "success") success("success"), + @JsonProperty(value = "failure") failure("failure"), + @JsonProperty(value = "unclassified") unclassified("unclassified"), + } + + + @Throws(RestClientResponseException::class) + fun testEnumRefString(enumNonrefStringQuery: EnumNonrefStringQueryTestEnumRefString? = null, enumRefStringQuery: StringEnumRef? = null): kotlin.String { + val result = testEnumRefStringWithHttpInfo(enumNonrefStringQuery = enumNonrefStringQuery, enumRefStringQuery = enumRefStringQuery) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testEnumRefStringWithHttpInfo(enumNonrefStringQuery: EnumNonrefStringQueryTestEnumRefString? = null, enumRefStringQuery: StringEnumRef? = null): ResponseEntity { + val localVariableConfig = testEnumRefStringRequestConfig(enumNonrefStringQuery = enumNonrefStringQuery, enumRefStringQuery = enumRefStringQuery) + return request( + localVariableConfig + ) + } + + fun testEnumRefStringRequestConfig(enumNonrefStringQuery: EnumNonrefStringQueryTestEnumRefString? = null, enumRefStringQuery: StringEnumRef? = null) : RequestConfig { + val localVariableBody = null + val localVariableQuery = mutableMapOf>() + .apply { + if (enumNonrefStringQuery != null) { + put("enum_nonref_string_query", listOf(enumNonrefStringQuery.toString())) + } + if (enumRefStringQuery != null) { + put("enum_ref_string_query", listOf(enumRefStringQuery.toString())) + } + } + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.GET, + path = "/query/enum_ref_string", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + + + @Throws(RestClientResponseException::class) + fun testQueryDatetimeDateString(datetimeQuery: java.time.OffsetDateTime? = null, dateQuery: java.time.LocalDate? = null, stringQuery: kotlin.String? = null): kotlin.String { + val result = testQueryDatetimeDateStringWithHttpInfo(datetimeQuery = datetimeQuery, dateQuery = dateQuery, stringQuery = stringQuery) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testQueryDatetimeDateStringWithHttpInfo(datetimeQuery: java.time.OffsetDateTime? = null, dateQuery: java.time.LocalDate? = null, stringQuery: kotlin.String? = null): ResponseEntity { + val localVariableConfig = testQueryDatetimeDateStringRequestConfig(datetimeQuery = datetimeQuery, dateQuery = dateQuery, stringQuery = stringQuery) + return request( + localVariableConfig + ) + } + + fun testQueryDatetimeDateStringRequestConfig(datetimeQuery: java.time.OffsetDateTime? = null, dateQuery: java.time.LocalDate? = null, stringQuery: kotlin.String? = null) : RequestConfig { + val localVariableBody = null + val localVariableQuery = mutableMapOf>() + .apply { + if (datetimeQuery != null) { + put("datetime_query", listOf(parseDateToQueryString(datetimeQuery))) + } + if (dateQuery != null) { + put("date_query", listOf(parseDateToQueryString(dateQuery))) + } + if (stringQuery != null) { + put("string_query", listOf(stringQuery.toString())) + } + } + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.GET, + path = "/query/datetime/date/string", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + + + @Throws(RestClientResponseException::class) + fun testQueryIntegerBooleanString(integerQuery: kotlin.Int? = null, booleanQuery: kotlin.Boolean? = null, stringQuery: kotlin.String? = null): kotlin.String { + val result = testQueryIntegerBooleanStringWithHttpInfo(integerQuery = integerQuery, booleanQuery = booleanQuery, stringQuery = stringQuery) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testQueryIntegerBooleanStringWithHttpInfo(integerQuery: kotlin.Int? = null, booleanQuery: kotlin.Boolean? = null, stringQuery: kotlin.String? = null): ResponseEntity { + val localVariableConfig = testQueryIntegerBooleanStringRequestConfig(integerQuery = integerQuery, booleanQuery = booleanQuery, stringQuery = stringQuery) + return request( + localVariableConfig + ) + } + + fun testQueryIntegerBooleanStringRequestConfig(integerQuery: kotlin.Int? = null, booleanQuery: kotlin.Boolean? = null, stringQuery: kotlin.String? = null) : RequestConfig { + val localVariableBody = null + val localVariableQuery = mutableMapOf>() + .apply { + if (integerQuery != null) { + put("integer_query", listOf(integerQuery.toString())) + } + if (booleanQuery != null) { + put("boolean_query", listOf(booleanQuery.toString())) + } + if (stringQuery != null) { + put("string_query", listOf(stringQuery.toString())) + } + } + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.GET, + path = "/query/integer/boolean/string", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + + + @Throws(RestClientResponseException::class) + fun testQueryStyleDeepObjectExplodeTrueObject(queryObject: Pet? = null): kotlin.String { + val result = testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(queryObject = queryObject) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testQueryStyleDeepObjectExplodeTrueObjectWithHttpInfo(queryObject: Pet? = null): ResponseEntity { + val localVariableConfig = testQueryStyleDeepObjectExplodeTrueObjectRequestConfig(queryObject = queryObject) + return request( + localVariableConfig + ) + } + + fun testQueryStyleDeepObjectExplodeTrueObjectRequestConfig(queryObject: Pet? = null) : RequestConfig { + val localVariableBody = null + val localVariableQuery = mutableMapOf>() + .apply { + if (queryObject != null) { + put("query_object", listOf(queryObject.toString())) + } + } + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.GET, + path = "/query/style_deepObject/explode_true/object", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + + + @Throws(RestClientResponseException::class) + fun testQueryStyleFormExplodeTrueArrayString(queryObject: TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? = null): kotlin.String { + val result = testQueryStyleFormExplodeTrueArrayStringWithHttpInfo(queryObject = queryObject) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testQueryStyleFormExplodeTrueArrayStringWithHttpInfo(queryObject: TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? = null): ResponseEntity { + val localVariableConfig = testQueryStyleFormExplodeTrueArrayStringRequestConfig(queryObject = queryObject) + return request( + localVariableConfig + ) + } + + fun testQueryStyleFormExplodeTrueArrayStringRequestConfig(queryObject: TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? = null) : RequestConfig { + val localVariableBody = null + val localVariableQuery = mutableMapOf>() + .apply { + if (queryObject != null) { + put("query_object", listOf(queryObject.toString())) + } + } + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.GET, + path = "/query/style_form/explode_true/array_string", + params = params, + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + body = localVariableBody + ) + } + + + @Throws(RestClientResponseException::class) + fun testQueryStyleFormExplodeTrueObject(queryObject: Pet? = null): kotlin.String { + val result = testQueryStyleFormExplodeTrueObjectWithHttpInfo(queryObject = queryObject) + return result.body!! + } + + @Throws(RestClientResponseException::class) + fun testQueryStyleFormExplodeTrueObjectWithHttpInfo(queryObject: Pet? = null): ResponseEntity { + val localVariableConfig = testQueryStyleFormExplodeTrueObjectRequestConfig(queryObject = queryObject) + return request( + localVariableConfig + ) + } + + fun testQueryStyleFormExplodeTrueObjectRequestConfig(queryObject: Pet? = null) : RequestConfig { + val localVariableBody = null + val localVariableQuery = mutableMapOf>() + .apply { + if (queryObject != null) { + put("query_object", listOf(queryObject.toString())) + } + } + val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "text/plain" + + val params = mutableMapOf( + ) + + return RequestConfig( + method = RequestMethod.GET, + path = "/query/style_form/explode_true/object", + 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/infrastructure/ApiAbstractions.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 00000000000..a4a4491eac0 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = MutableMap> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipe" -> "|" + "space" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) + = toMultiValue(items.asIterable(), collectionFormat, map) + +fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 00000000000..64f843ed93b --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,61 @@ +package org.openapitools.client.infrastructure; + +import org.springframework.core.ParameterizedTypeReference +import org.springframework.http.HttpHeaders +import org.springframework.http.HttpMethod +import org.springframework.http.MediaType +import org.springframework.web.client.RestClient +import org.springframework.http.ResponseEntity +import org.springframework.util.LinkedMultiValueMap + +open class ApiClient(protected val client: RestClient) { + + protected inline fun request(requestConfig: RequestConfig): ResponseEntity { + return prepare(defaults(requestConfig)) + .retrieve() + .toEntity(object : ParameterizedTypeReference() {}) + } + + protected fun prepare(requestConfig: RequestConfig) = + client.method(requestConfig) + .uri(requestConfig) + .headers(requestConfig) + .nullableBody(requestConfig) + + protected fun defaults(requestConfig: RequestConfig) = + requestConfig.apply { + if (body != null && headers[HttpHeaders.CONTENT_TYPE].isNullOrEmpty()) { + headers[HttpHeaders.CONTENT_TYPE] = MediaType.APPLICATION_JSON_VALUE + } + if (headers[HttpHeaders.ACCEPT].isNullOrEmpty()) { + headers[HttpHeaders.ACCEPT] = MediaType.APPLICATION_JSON_VALUE + } + } + + private fun RestClient.method(requestConfig: RequestConfig)= + method(HttpMethod.valueOf(requestConfig.method.name)) + + private fun RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig) = + uri { builder -> + builder + .path(requestConfig.path) + .queryParams(LinkedMultiValueMap(requestConfig.query)) + .build(requestConfig.params) + } + + private fun RestClient.RequestBodySpec.headers(requestConfig: RequestConfig) = + apply { requestConfig.headers.forEach { (name, value) -> header(name, value) } } + + private fun RestClient.RequestBodySpec.nullableBody(requestConfig: RequestConfig) = + apply { if (requestConfig.body != null) body(requestConfig.body) } +} + +inline fun parseDateToQueryString(value : T): String { + /* + .replace("\"", "") converts the json object string to an actual string for the query parameter. + The moshi or gson adapter allows a more generic solution instead of trying to use a native + formatter. It also easily allows to provide a simple way to define a custom date format pattern + inside a gson/moshi adapter. + */ + return Serializer.jacksonObjectMapper.writeValueAsString(value).replace("\"", "") + } diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 00000000000..be00e38fbae --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt new file mode 100644 index 00000000000..6578b9381b7 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -0,0 +1,19 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given request. + * NOTE: This object doesn't include 'body' because it + * allows for caching of the constructed object + * for many request definitions. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class RequestConfig( + val method: RequestMethod, + val path: String, + val headers: MutableMap = mutableMapOf(), + val params: MutableMap = mutableMapOf(), + val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, + val body: T? = null +) diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt new file mode 100644 index 00000000000..beb56f07cdd --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt @@ -0,0 +1,8 @@ +package org.openapitools.client.infrastructure + +/** + * Provides enumerated HTTP verbs + */ +enum class RequestMethod { + GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt new file mode 100644 index 00000000000..6a09fd57f30 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.infrastructure + +import com.fasterxml.jackson.databind.DeserializationFeature +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.databind.SerializationFeature +import com.fasterxml.jackson.annotation.JsonInclude +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper + +object Serializer { + @JvmStatic + val jacksonObjectMapper: ObjectMapper = jacksonObjectMapper() + .findAndRegisterModules() + .setSerializationInclusion(JsonInclude.Include.NON_ABSENT) + .configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE, true) + .configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Bird.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Bird.kt new file mode 100644 index 00000000000..c63c0366edf --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Bird.kt @@ -0,0 +1,39 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonEnumDefaultValue +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * + * + * @param propertySize + * @param color + */ + + +data class Bird ( + + @field:JsonProperty("size") + val propertySize: kotlin.String? = null, + + @field:JsonProperty("color") + val color: kotlin.String? = null + +) + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt new file mode 100644 index 00000000000..e62c174314a --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -0,0 +1,39 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonEnumDefaultValue +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * + * + * @param id + * @param name + */ + + +data class Category ( + + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("name") + val name: kotlin.String? = null + +) + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt new file mode 100644 index 00000000000..894db93c77e --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/DefaultValue.kt @@ -0,0 +1,77 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.StringEnumRef + +import com.fasterxml.jackson.annotation.JsonEnumDefaultValue +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * to test the default value of properties + * + * @param arrayStringEnumRefDefault + * @param arrayStringEnumDefault + * @param arrayStringDefault + * @param arrayIntegerDefault + * @param arrayString + * @param arrayStringNullable + * @param arrayStringExtensionNullable + * @param stringNullable + */ + + +data class DefaultValue ( + + @field:JsonProperty("array_string_enum_ref_default") + val arrayStringEnumRefDefault: kotlin.collections.List? = null, + + @field:JsonProperty("array_string_enum_default") + val arrayStringEnumDefault: kotlin.collections.List? = null, + + @field:JsonProperty("array_string_default") + val arrayStringDefault: kotlin.collections.List? = arrayListOf("failure","skipped"), + + @field:JsonProperty("array_integer_default") + val arrayIntegerDefault: kotlin.collections.List? = arrayListOf(1,3), + + @field:JsonProperty("array_string") + val arrayString: kotlin.collections.List? = null, + + @field:JsonProperty("array_string_nullable") + val arrayStringNullable: kotlin.collections.List? = null, + + @field:JsonProperty("array_string_extension_nullable") + val arrayStringExtensionNullable: kotlin.collections.List? = null, + + @field:JsonProperty("string_nullable") + val stringNullable: kotlin.String? = null + +) { + + /** + * + * + * Values: success,failure,unclassified,unknownDefaultOpenApi + */ + enum class ArrayStringEnumDefault(val value: kotlin.String) { + @JsonProperty(value = "success") success("success"), + @JsonProperty(value = "failure") failure("failure"), + @JsonProperty(value = "unclassified") unclassified("unclassified"), + @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknownDefaultOpenApi("unknown_default_open_api"); + } +} + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt new file mode 100644 index 00000000000..0f1c287e41a --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/NumberPropertiesOnly.kt @@ -0,0 +1,43 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonEnumDefaultValue +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * + * + * @param number + * @param float + * @param double + */ + + +data class NumberPropertiesOnly ( + + @field:JsonProperty("number") + val number: java.math.BigDecimal? = null, + + @field:JsonProperty("float") + val float: kotlin.Float? = null, + + @field:JsonProperty("double") + val double: kotlin.Double? = null + +) + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt new file mode 100644 index 00000000000..355a8d07b56 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -0,0 +1,71 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.fasterxml.jackson.annotation.JsonEnumDefaultValue +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * + * + * @param name + * @param photoUrls + * @param id + * @param category + * @param tags + * @param status pet status in the store + */ + + +data class Pet ( + + @field:JsonProperty("name") + val name: kotlin.String, + + @field:JsonProperty("photoUrls") + val photoUrls: kotlin.collections.List, + + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("category") + val category: Category? = null, + + @field:JsonProperty("tags") + val tags: kotlin.collections.List? = null, + + /* pet status in the store */ + @field:JsonProperty("status") + val status: Pet.Status? = null + +) { + + /** + * pet status in the store + * + * Values: available,pending,sold,unknownDefaultOpenApi + */ + enum class Status(val value: kotlin.String) { + @JsonProperty(value = "available") available("available"), + @JsonProperty(value = "pending") pending("pending"), + @JsonProperty(value = "sold") sold("sold"), + @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknownDefaultOpenApi("unknown_default_open_api"); + } +} + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Query.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Query.kt new file mode 100644 index 00000000000..679fc593962 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Query.kt @@ -0,0 +1,53 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonEnumDefaultValue +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * + * + * @param id Query + * @param outcomes + */ + + +data class Query ( + + /* Query */ + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("outcomes") + val outcomes: kotlin.collections.List? = null + +) { + + /** + * + * + * Values: sUCCESS,fAILURE,sKIPPED,unknownDefaultOpenApi + */ + enum class Outcomes(val value: kotlin.String) { + @JsonProperty(value = "SUCCESS") sUCCESS("SUCCESS"), + @JsonProperty(value = "FAILURE") fAILURE("FAILURE"), + @JsonProperty(value = "SKIPPED") sKIPPED("SKIPPED"), + @JsonProperty(value = "unknown_default_open_api") @JsonEnumDefaultValue unknownDefaultOpenApi("unknown_default_open_api"); + } +} + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/StringEnumRef.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/StringEnumRef.kt new file mode 100644 index 00000000000..e85cc978ab6 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/StringEnumRef.kt @@ -0,0 +1,67 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * + * + * Values: success,failure,unclassified,unknownDefaultOpenApi + */ + +enum class StringEnumRef(val value: kotlin.String) { + + @JsonProperty(value = "success") + success("success"), + + @JsonProperty(value = "failure") + failure("failure"), + + @JsonProperty(value = "unclassified") + unclassified("unclassified"), + + @JsonProperty(value = "unknown_default_open_api") + unknownDefaultOpenApi("unknown_default_open_api"); + + /** + * Override [toString()] to avoid using the enum variable name as the value, and instead use + * the actual value defined in the API spec file. + * + * This solves a problem when the variable name and its value are different, and ensures that + * the client sends the correct enum values to the server always. + */ + override fun toString(): kotlin.String = value + + companion object { + /** + * Converts the provided [data] to a [String] on success, null otherwise. + */ + fun encode(data: kotlin.Any?): kotlin.String? = if (data is StringEnumRef) "$data" else null + + /** + * Returns a valid [StringEnumRef] for [data], null otherwise. + */ + fun decode(data: kotlin.Any?): StringEnumRef? = data?.let { + val normalizedData = "$it".lowercase() + values().firstOrNull { value -> + it == value || normalizedData == "$value".lowercase() + } + } + } +} + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt new file mode 100644 index 00000000000..36d7c43ee87 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -0,0 +1,39 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonEnumDefaultValue +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * + * + * @param id + * @param name + */ + + +data class Tag ( + + @field:JsonProperty("id") + val id: kotlin.Long? = null, + + @field:JsonProperty("name") + val name: kotlin.String? = null + +) + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt new file mode 100644 index 00000000000..cb6010f5d40 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter.kt @@ -0,0 +1,35 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.fasterxml.jackson.annotation.JsonEnumDefaultValue +import com.fasterxml.jackson.annotation.JsonProperty + +/** + * + * + * @param propertyValues + */ + + +data class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter ( + + @field:JsonProperty("values") + val propertyValues: kotlin.collections.List? = null + +) + diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/AuthApiTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/AuthApiTest.kt new file mode 100644 index 00000000000..8e270b251e4 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/AuthApiTest.kt @@ -0,0 +1,43 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.apis.AuthApi + +class AuthApiTest : ShouldSpec() { + init { + // uncomment below to create an instance of AuthApi + //val apiInstance = AuthApi() + + // to test testAuthHttpBasic + should("test testAuthHttpBasic") { + // uncomment below to test testAuthHttpBasic + //val result : kotlin.String = apiInstance.testAuthHttpBasic() + //result shouldBe ("TODO") + } + + // to test testAuthHttpBearer + should("test testAuthHttpBearer") { + // uncomment below to test testAuthHttpBearer + //val result : kotlin.String = apiInstance.testAuthHttpBearer() + //result shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/BodyApiTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/BodyApiTest.kt new file mode 100644 index 00000000000..08d3d1db90d --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/BodyApiTest.kt @@ -0,0 +1,94 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.apis.BodyApi +import org.openapitools.client.models.Pet +import org.openapitools.client.models.Tag + +class BodyApiTest : ShouldSpec() { + init { + // uncomment below to create an instance of BodyApi + //val apiInstance = BodyApi() + + // to test testBinaryGif + should("test testBinaryGif") { + // uncomment below to test testBinaryGif + //val result : java.io.File = apiInstance.testBinaryGif() + //result shouldBe ("TODO") + } + + // to test testBodyApplicationOctetstreamBinary + should("test testBodyApplicationOctetstreamBinary") { + // uncomment below to test testBodyApplicationOctetstreamBinary + //val body : java.io.File = BINARY_DATA_HERE // java.io.File | + //val result : kotlin.String = apiInstance.testBodyApplicationOctetstreamBinary(body) + //result shouldBe ("TODO") + } + + // to test testBodyMultipartFormdataArrayOfBinary + should("test testBodyMultipartFormdataArrayOfBinary") { + // uncomment below to test testBodyMultipartFormdataArrayOfBinary + //val files : kotlin.collections.List = /path/to/file.txt // kotlin.collections.List | + //val result : kotlin.String = apiInstance.testBodyMultipartFormdataArrayOfBinary(files) + //result shouldBe ("TODO") + } + + // to test testBodyMultipartFormdataSingleBinary + should("test testBodyMultipartFormdataSingleBinary") { + // uncomment below to test testBodyMultipartFormdataSingleBinary + //val myFile : java.io.File = BINARY_DATA_HERE // java.io.File | + //val result : kotlin.String = apiInstance.testBodyMultipartFormdataSingleBinary(myFile) + //result shouldBe ("TODO") + } + + // to test testEchoBodyFreeFormObjectResponseString + should("test testEchoBodyFreeFormObjectResponseString") { + // uncomment below to test testEchoBodyFreeFormObjectResponseString + //val body : kotlin.Any = Object // kotlin.Any | Free form object + //val result : kotlin.String = apiInstance.testEchoBodyFreeFormObjectResponseString(body) + //result shouldBe ("TODO") + } + + // to test testEchoBodyPet + should("test testEchoBodyPet") { + // uncomment below to test testEchoBodyPet + //val pet : Pet = // Pet | Pet object that needs to be added to the store + //val result : Pet = apiInstance.testEchoBodyPet(pet) + //result shouldBe ("TODO") + } + + // to test testEchoBodyPetResponseString + should("test testEchoBodyPetResponseString") { + // uncomment below to test testEchoBodyPetResponseString + //val pet : Pet = // Pet | Pet object that needs to be added to the store + //val result : kotlin.String = apiInstance.testEchoBodyPetResponseString(pet) + //result shouldBe ("TODO") + } + + // to test testEchoBodyTagResponseString + should("test testEchoBodyTagResponseString") { + // uncomment below to test testEchoBodyTagResponseString + //val tag : Tag = // Tag | Tag object + //val result : kotlin.String = apiInstance.testEchoBodyTagResponseString(tag) + //result shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/FormApiTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/FormApiTest.kt new file mode 100644 index 00000000000..f2ff643d263 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/FormApiTest.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", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.apis.FormApi + +class FormApiTest : ShouldSpec() { + init { + // uncomment below to create an instance of FormApi + //val apiInstance = FormApi() + + // to test testFormIntegerBooleanString + should("test testFormIntegerBooleanString") { + // uncomment below to test testFormIntegerBooleanString + //val integerForm : kotlin.Int = 56 // kotlin.Int | + //val booleanForm : kotlin.Boolean = true // kotlin.Boolean | + //val stringForm : kotlin.String = stringForm_example // kotlin.String | + //val result : kotlin.String = apiInstance.testFormIntegerBooleanString(integerForm, booleanForm, stringForm) + //result shouldBe ("TODO") + } + + // to test testFormOneof + should("test testFormOneof") { + // uncomment below to test testFormOneof + //val form1 : kotlin.String = form1_example // kotlin.String | + //val form2 : kotlin.Int = 56 // kotlin.Int | + //val form3 : kotlin.String = form3_example // kotlin.String | + //val form4 : kotlin.Boolean = true // kotlin.Boolean | + //val id : kotlin.Long = 789 // kotlin.Long | + //val name : kotlin.String = name_example // kotlin.String | + //val result : kotlin.String = apiInstance.testFormOneof(form1, form2, form3, form4, id, name) + //result shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/HeaderApiTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/HeaderApiTest.kt new file mode 100644 index 00000000000..ae57e73099f --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/HeaderApiTest.kt @@ -0,0 +1,42 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.apis.HeaderApi +import org.openapitools.client.models.StringEnumRef + +class HeaderApiTest : ShouldSpec() { + init { + // uncomment below to create an instance of HeaderApi + //val apiInstance = HeaderApi() + + // to test testHeaderIntegerBooleanStringEnums + should("test testHeaderIntegerBooleanStringEnums") { + // uncomment below to test testHeaderIntegerBooleanStringEnums + //val integerHeader : kotlin.Int = 56 // kotlin.Int | + //val booleanHeader : kotlin.Boolean = true // kotlin.Boolean | + //val stringHeader : kotlin.String = stringHeader_example // kotlin.String | + //val enumNonrefStringHeader : kotlin.String = enumNonrefStringHeader_example // kotlin.String | + //val enumRefStringHeader : StringEnumRef = // StringEnumRef | + //val result : kotlin.String = apiInstance.testHeaderIntegerBooleanStringEnums(integerHeader, booleanHeader, stringHeader, enumNonrefStringHeader, enumRefStringHeader) + //result shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/PathApiTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/PathApiTest.kt new file mode 100644 index 00000000000..de937f200a2 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/PathApiTest.kt @@ -0,0 +1,41 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.apis.PathApi +import org.openapitools.client.models.StringEnumRef + +class PathApiTest : ShouldSpec() { + init { + // uncomment below to create an instance of PathApi + //val apiInstance = PathApi() + + // to test testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath + should("test testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath") { + // uncomment below to test testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath + //val pathString : kotlin.String = pathString_example // kotlin.String | + //val pathInteger : kotlin.Int = 56 // kotlin.Int | + //val enumNonrefStringPath : kotlin.String = enumNonrefStringPath_example // kotlin.String | + //val enumRefStringPath : StringEnumRef = // StringEnumRef | + //val result : kotlin.String = apiInstance.testsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(pathString, pathInteger, enumNonrefStringPath, enumRefStringPath) + //result shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/QueryApiTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/QueryApiTest.kt new file mode 100644 index 00000000000..a7c855a4494 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/apis/QueryApiTest.kt @@ -0,0 +1,85 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.apis.QueryApi +import org.openapitools.client.models.Pet +import org.openapitools.client.models.StringEnumRef +import org.openapitools.client.models.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + +class QueryApiTest : ShouldSpec() { + init { + // uncomment below to create an instance of QueryApi + //val apiInstance = QueryApi() + + // to test testEnumRefString + should("test testEnumRefString") { + // uncomment below to test testEnumRefString + //val enumNonrefStringQuery : kotlin.String = enumNonrefStringQuery_example // kotlin.String | + //val enumRefStringQuery : StringEnumRef = // StringEnumRef | + //val result : kotlin.String = apiInstance.testEnumRefString(enumNonrefStringQuery, enumRefStringQuery) + //result shouldBe ("TODO") + } + + // to test testQueryDatetimeDateString + should("test testQueryDatetimeDateString") { + // uncomment below to test testQueryDatetimeDateString + //val datetimeQuery : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | + //val dateQuery : java.time.LocalDate = 2013-10-20 // java.time.LocalDate | + //val stringQuery : kotlin.String = stringQuery_example // kotlin.String | + //val result : kotlin.String = apiInstance.testQueryDatetimeDateString(datetimeQuery, dateQuery, stringQuery) + //result shouldBe ("TODO") + } + + // to test testQueryIntegerBooleanString + should("test testQueryIntegerBooleanString") { + // uncomment below to test testQueryIntegerBooleanString + //val integerQuery : kotlin.Int = 56 // kotlin.Int | + //val booleanQuery : kotlin.Boolean = true // kotlin.Boolean | + //val stringQuery : kotlin.String = stringQuery_example // kotlin.String | + //val result : kotlin.String = apiInstance.testQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery) + //result shouldBe ("TODO") + } + + // to test testQueryStyleDeepObjectExplodeTrueObject + should("test testQueryStyleDeepObjectExplodeTrueObject") { + // uncomment below to test testQueryStyleDeepObjectExplodeTrueObject + //val queryObject : Pet = // Pet | + //val result : kotlin.String = apiInstance.testQueryStyleDeepObjectExplodeTrueObject(queryObject) + //result shouldBe ("TODO") + } + + // to test testQueryStyleFormExplodeTrueArrayString + should("test testQueryStyleFormExplodeTrueArrayString") { + // uncomment below to test testQueryStyleFormExplodeTrueArrayString + //val queryObject : TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter = // TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter | + //val result : kotlin.String = apiInstance.testQueryStyleFormExplodeTrueArrayString(queryObject) + //result shouldBe ("TODO") + } + + // to test testQueryStyleFormExplodeTrueObject + should("test testQueryStyleFormExplodeTrueObject") { + // uncomment below to test testQueryStyleFormExplodeTrueObject + //val queryObject : Pet = // Pet | + //val result : kotlin.String = apiInstance.testQueryStyleFormExplodeTrueObject(queryObject) + //result shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/BirdTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/BirdTest.kt new file mode 100644 index 00000000000..3057b9f88e3 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/BirdTest.kt @@ -0,0 +1,41 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.Bird + +class BirdTest : ShouldSpec() { + init { + // uncomment below to create an instance of Bird + //val modelInstance = Bird() + + // to test the property `propertySize` + should("test propertySize") { + // uncomment below to test the property + //modelInstance.propertySize shouldBe ("TODO") + } + + // to test the property `color` + should("test color") { + // uncomment below to test the property + //modelInstance.color shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/CategoryTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/CategoryTest.kt new file mode 100644 index 00000000000..4cfde8e19c6 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/CategoryTest.kt @@ -0,0 +1,41 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.Category + +class CategoryTest : ShouldSpec() { + init { + // uncomment below to create an instance of Category + //val modelInstance = Category() + + // to test the property `id` + should("test id") { + // uncomment below to test the property + //modelInstance.id shouldBe ("TODO") + } + + // to test the property `name` + should("test name") { + // uncomment below to test the property + //modelInstance.name shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/DefaultValueTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/DefaultValueTest.kt new file mode 100644 index 00000000000..b08e850a6cd --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/DefaultValueTest.kt @@ -0,0 +1,78 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.DefaultValue +import org.openapitools.client.models.StringEnumRef + +class DefaultValueTest : ShouldSpec() { + init { + // uncomment below to create an instance of DefaultValue + //val modelInstance = DefaultValue() + + // to test the property `arrayStringEnumRefDefault` + should("test arrayStringEnumRefDefault") { + // uncomment below to test the property + //modelInstance.arrayStringEnumRefDefault shouldBe ("TODO") + } + + // to test the property `arrayStringEnumDefault` + should("test arrayStringEnumDefault") { + // uncomment below to test the property + //modelInstance.arrayStringEnumDefault shouldBe ("TODO") + } + + // to test the property `arrayStringDefault` + should("test arrayStringDefault") { + // uncomment below to test the property + //modelInstance.arrayStringDefault shouldBe ("TODO") + } + + // to test the property `arrayIntegerDefault` + should("test arrayIntegerDefault") { + // uncomment below to test the property + //modelInstance.arrayIntegerDefault shouldBe ("TODO") + } + + // to test the property `arrayString` + should("test arrayString") { + // uncomment below to test the property + //modelInstance.arrayString shouldBe ("TODO") + } + + // to test the property `arrayStringNullable` + should("test arrayStringNullable") { + // uncomment below to test the property + //modelInstance.arrayStringNullable shouldBe ("TODO") + } + + // to test the property `arrayStringExtensionNullable` + should("test arrayStringExtensionNullable") { + // uncomment below to test the property + //modelInstance.arrayStringExtensionNullable shouldBe ("TODO") + } + + // to test the property `stringNullable` + should("test stringNullable") { + // uncomment below to test the property + //modelInstance.stringNullable shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/NumberPropertiesOnlyTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/NumberPropertiesOnlyTest.kt new file mode 100644 index 00000000000..70c69e8eca9 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/NumberPropertiesOnlyTest.kt @@ -0,0 +1,47 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.NumberPropertiesOnly + +class NumberPropertiesOnlyTest : ShouldSpec() { + init { + // uncomment below to create an instance of NumberPropertiesOnly + //val modelInstance = NumberPropertiesOnly() + + // to test the property `number` + should("test number") { + // uncomment below to test the property + //modelInstance.number shouldBe ("TODO") + } + + // to test the property `float` + should("test float") { + // uncomment below to test the property + //modelInstance.float shouldBe ("TODO") + } + + // to test the property `double` + should("test double") { + // uncomment below to test the property + //modelInstance.double shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/PetTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/PetTest.kt new file mode 100644 index 00000000000..ef7128c4d0b --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/PetTest.kt @@ -0,0 +1,67 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.Pet +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +class PetTest : ShouldSpec() { + init { + // uncomment below to create an instance of Pet + //val modelInstance = Pet() + + // to test the property `name` + should("test name") { + // uncomment below to test the property + //modelInstance.name shouldBe ("TODO") + } + + // to test the property `photoUrls` + should("test photoUrls") { + // uncomment below to test the property + //modelInstance.photoUrls shouldBe ("TODO") + } + + // to test the property `id` + should("test id") { + // uncomment below to test the property + //modelInstance.id shouldBe ("TODO") + } + + // to test the property `category` + should("test category") { + // uncomment below to test the property + //modelInstance.category shouldBe ("TODO") + } + + // to test the property `tags` + should("test tags") { + // uncomment below to test the property + //modelInstance.tags shouldBe ("TODO") + } + + // to test the property `status` - pet status in the store + should("test status") { + // uncomment below to test the property + //modelInstance.status shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/QueryTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/QueryTest.kt new file mode 100644 index 00000000000..ee589f44428 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/QueryTest.kt @@ -0,0 +1,41 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.Query + +class QueryTest : ShouldSpec() { + init { + // uncomment below to create an instance of Query + //val modelInstance = Query() + + // to test the property `id` - Query + should("test id") { + // uncomment below to test the property + //modelInstance.id shouldBe ("TODO") + } + + // to test the property `outcomes` + should("test outcomes") { + // uncomment below to test the property + //modelInstance.outcomes shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/StringEnumRefTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/StringEnumRefTest.kt new file mode 100644 index 00000000000..4700e12b80b --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/StringEnumRefTest.kt @@ -0,0 +1,29 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.StringEnumRef + +class StringEnumRefTest : ShouldSpec() { + init { + // uncomment below to create an instance of StringEnumRef + //val modelInstance = StringEnumRef() + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/TagTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/TagTest.kt new file mode 100644 index 00000000000..65e729bb498 --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/TagTest.kt @@ -0,0 +1,41 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.Tag + +class TagTest : ShouldSpec() { + init { + // uncomment below to create an instance of Tag + //val modelInstance = Tag() + + // to test the property `id` + should("test id") { + // uncomment below to test the property + //modelInstance.id shouldBe ("TODO") + } + + // to test the property `name` + should("test name") { + // uncomment below to test the property + //modelInstance.name shouldBe ("TODO") + } + + } +} diff --git a/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.kt b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.kt new file mode 100644 index 00000000000..64cb7da9e7c --- /dev/null +++ b/samples/client/echo_api/kotlin-jvm-spring-3-webclient/src/test/kotlin/org/openapitools/client/models/TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest.kt @@ -0,0 +1,35 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec + +import org.openapitools.client.models.TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + +class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTest : ShouldSpec() { + init { + // uncomment below to create an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter + //val modelInstance = TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() + + // to test the property `propertyValues` + should("test propertyValues") { + // uncomment below to test the property + //modelInstance.propertyValues shouldBe ("TODO") + } + + } +} diff --git a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 50d8b7332bd..0c322c4d100 100644 --- a/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-spring-2-webclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -117,11 +117,11 @@ class PetApi(client: WebClient) : ApiClient(client) { /** * enum for parameter status */ - enum class StatusFindPetsByStatus(val value: kotlin.String) { - @JsonProperty(value = "available") available("available"), - @JsonProperty(value = "pending") pending("pending"), - @JsonProperty(value = "sold") sold("sold"), - } + enum class StatusFindPetsByStatus(val value: kotlin.String) { + @JsonProperty(value = "available") available("available"), + @JsonProperty(value = "pending") pending("pending"), + @JsonProperty(value = "sold") sold("sold"), + } @Throws(WebClientResponseException::class) diff --git a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index f1548da94e5..a1555520b2c 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-restclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -112,11 +112,11 @@ class PetApi(client: RestClient) : ApiClient(client) { /** * enum for parameter status */ - enum class StatusFindPetsByStatus(val value: kotlin.String) { - @JsonProperty(value = "available") available("available"), - @JsonProperty(value = "pending") pending("pending"), - @JsonProperty(value = "sold") sold("sold"), - } + enum class StatusFindPetsByStatus(val value: kotlin.String) { + @JsonProperty(value = "available") available("available"), + @JsonProperty(value = "pending") pending("pending"), + @JsonProperty(value = "sold") sold("sold"), + } @Throws(RestClientResponseException::class) diff --git a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 50d8b7332bd..0c322c4d100 100644 --- a/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-spring-3-webclient/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -117,11 +117,11 @@ class PetApi(client: WebClient) : ApiClient(client) { /** * enum for parameter status */ - enum class StatusFindPetsByStatus(val value: kotlin.String) { - @JsonProperty(value = "available") available("available"), - @JsonProperty(value = "pending") pending("pending"), - @JsonProperty(value = "sold") sold("sold"), - } + enum class StatusFindPetsByStatus(val value: kotlin.String) { + @JsonProperty(value = "available") available("available"), + @JsonProperty(value = "pending") pending("pending"), + @JsonProperty(value = "sold") sold("sold"), + } @Throws(WebClientResponseException::class)