[Kotlin][Client] Fix url path for Retrofit, Fix optionals for @Query @Body, Set List as default collection for Kotlin data class (#6456)

* Replace typeMapping kotlin.Array with kotlin.collections.List, because its doesn't work with Kotlin Data Classes(required manually implementing  hashCode&equals)
Replace typeMapping kotlin.Array<kotlin.Byte> with efficient primitive implementation kotlin.ByteArray
Replace instantiationTypes array to kotlin.collections.ArrayList, for extending Array we should provide element count to its constructor.

* Fixed path(removed slash on begin path) for Jvm Kotlin Retrofit

* Fixed handling optional bodyParams for Jvm Kotlin Retrofit

* Fix kotlin tests

* Fixed code format for detekt inspections #2

* revert formatting

* Added ability to generate optional @Query params.

* Update Kotlin docs.

* Update Kotlin openapi3 client samples

* Update Kotlin client samples

* Update Kotlin openapi3 client samples after merge with master

* Revert hardcoding List instead Array

* Set List as default collectionType

* Update Kotlin samples

* Fixed Kotlin multiplatform api template. fix mapper for Array type.
Fixed Kotlin multiplatform api template Code style.

* Update Kotlin multiplatform sample

* Fix Kotlin multiplatform template code style

* Update Kotlin multiplatform sample

* Fix Kotlin multiplatform converting Array to List in Api.

* Update Kotlin multiplatform sample #3

* Fix Kotlin tests

* Fix Kotlin jackson Application.kt

* Fix Kotlin tests #2

* Fix merge conflict with master

* Generate samples after merge with master

* Generate samples after merge with master #2

* Generate samples after merge with master #3

* Generate samples after merge with master #4

* update kotlin samples

* update all samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
Nikita Karnaukh
2020-06-16 05:33:34 +03:00
committed by GitHub
parent 6f2e84db04
commit 53eff43184
437 changed files with 1566 additions and 1274 deletions

View File

@@ -8,7 +8,7 @@ sidebar_label: kotlin
|apiSuffix|suffix for api classes| |Api| |apiSuffix|suffix for api classes| |Api|
|artifactId|Generated artifact id (name of jar).| |kotlin-client| |artifactId|Generated artifact id (name of jar).| |kotlin-client|
|artifactVersion|Generated artifact's package version.| |1.0.0| |artifactVersion|Generated artifact's package version.| |1.0.0|
|collectionType|Option. Collection type to use|<dl><dt>**array**</dt><dd>kotlin.Array</dd><dt>**list**</dt><dd>kotlin.collections.List</dd></dl>|array| |collectionType|Option. Collection type to use|<dl><dt>**array**</dt><dd>kotlin.Array</dd><dt>**list**</dt><dd>kotlin.collections.List</dd></dl>|list|
|dateLibrary|Option. Date library to use|<dl><dt>**threetenbp-localdatetime**</dt><dd>Threetenbp - Backport of JSR310 (jvm only, for legacy app only)</dd><dt>**string**</dt><dd>String</dd><dt>**java8-localdatetime**</dt><dd>Java 8 native JSR310 (jvm only, for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (jvm only, preferred for jdk 1.8+)</dd><dt>**threetenbp**</dt><dd>Threetenbp - Backport of JSR310 (jvm only, preferred for jdk &lt; 1.8)</dd></dl>|java8| |dateLibrary|Option. Date library to use|<dl><dt>**threetenbp-localdatetime**</dt><dd>Threetenbp - Backport of JSR310 (jvm only, for legacy app only)</dd><dt>**string**</dt><dd>String</dd><dt>**java8-localdatetime**</dt><dd>Java 8 native JSR310 (jvm only, for legacy app only)</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (jvm only, preferred for jdk 1.8+)</dd><dt>**threetenbp**</dt><dd>Threetenbp - Backport of JSR310 (jvm only, preferred for jdk &lt; 1.8)</dd></dl>|java8|
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase|
|groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| |groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools|

View File

@@ -25,23 +25,7 @@ import com.google.common.collect.ImmutableMap;
import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Mustache;
import com.samskivert.mustache.Mustache.Compiler; import com.samskivert.mustache.Mustache.Compiler;
import com.samskivert.mustache.Mustache.Lambda; import com.samskivert.mustache.Mustache.Lambda;
import io.swagger.v3.core.util.Json;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.PathItem;
import io.swagger.v3.oas.models.callbacks.Callback;
import io.swagger.v3.oas.models.examples.Example;
import io.swagger.v3.oas.models.headers.Header;
import io.swagger.v3.oas.models.media.*;
import io.swagger.v3.oas.models.parameters.*;
import io.swagger.v3.oas.models.responses.ApiResponse;
import io.swagger.v3.oas.models.responses.ApiResponses;
import io.swagger.v3.oas.models.security.OAuthFlow;
import io.swagger.v3.oas.models.security.OAuthFlows;
import io.swagger.v3.oas.models.security.SecurityScheme;
import io.swagger.v3.oas.models.servers.Server;
import io.swagger.v3.oas.models.servers.ServerVariable;
import io.swagger.v3.parser.util.SchemaTypeUtil;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@@ -59,7 +43,6 @@ import org.openapitools.codegen.templating.MustacheEngineAdapter;
import org.openapitools.codegen.templating.mustache.*; import org.openapitools.codegen.templating.mustache.*;
import org.openapitools.codegen.utils.ModelUtils; import org.openapitools.codegen.utils.ModelUtils;
import org.openapitools.codegen.utils.OneOfImplementorAdditionalData; import org.openapitools.codegen.utils.OneOfImplementorAdditionalData;
import org.openapitools.codegen.utils.SemVer;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -73,6 +56,24 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import io.swagger.v3.core.util.Json;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.PathItem;
import io.swagger.v3.oas.models.callbacks.Callback;
import io.swagger.v3.oas.models.examples.Example;
import io.swagger.v3.oas.models.headers.Header;
import io.swagger.v3.oas.models.media.*;
import io.swagger.v3.oas.models.parameters.*;
import io.swagger.v3.oas.models.responses.ApiResponse;
import io.swagger.v3.oas.models.responses.ApiResponses;
import io.swagger.v3.oas.models.security.OAuthFlow;
import io.swagger.v3.oas.models.security.OAuthFlows;
import io.swagger.v3.oas.models.security.SecurityScheme;
import io.swagger.v3.oas.models.servers.Server;
import io.swagger.v3.oas.models.servers.ServerVariable;
import io.swagger.v3.parser.util.SchemaTypeUtil;
import static org.openapitools.codegen.utils.OnceLogger.once; import static org.openapitools.codegen.utils.OnceLogger.once;
import static org.openapitools.codegen.utils.StringUtils.*; import static org.openapitools.codegen.utils.StringUtils.*;

View File

@@ -158,7 +158,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
typeMapping.put("set", "kotlin.collections.Set"); typeMapping.put("set", "kotlin.collections.Set");
typeMapping.put("map", "kotlin.collections.Map"); typeMapping.put("map", "kotlin.collections.Map");
typeMapping.put("object", "kotlin.Any"); typeMapping.put("object", "kotlin.Any");
typeMapping.put("binary", "kotlin.Array<kotlin.Byte>"); typeMapping.put("binary", "kotlin.ByteArray");
typeMapping.put("Date", "java.time.LocalDate"); typeMapping.put("Date", "java.time.LocalDate");
typeMapping.put("DateTime", "java.time.LocalDateTime"); typeMapping.put("DateTime", "java.time.LocalDateTime");

View File

@@ -62,7 +62,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
protected String dateLibrary = DateLibrary.JAVA8.value; protected String dateLibrary = DateLibrary.JAVA8.value;
protected String requestDateConverter = RequestDateConverter.TO_JSON.value; protected String requestDateConverter = RequestDateConverter.TO_JSON.value;
protected String collectionType = CollectionType.ARRAY.value; protected String collectionType = CollectionType.LIST.value;
protected boolean useRxJava = false; protected boolean useRxJava = false;
protected boolean useRxJava2 = false; protected boolean useRxJava2 = false;
protected boolean useCoroutines = false; protected boolean useCoroutines = false;
@@ -593,6 +593,10 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
List<CodegenOperation> ops = (List<CodegenOperation>) operations.get("operation"); List<CodegenOperation> ops = (List<CodegenOperation>) operations.get("operation");
for (CodegenOperation operation : ops) { for (CodegenOperation operation : ops) {
if (JVM_RETROFIT2.equals(getLibrary()) && StringUtils.isNotEmpty(operation.path) && operation.path.startsWith("/")) {
operation.path = operation.path.substring(1);
}
// set multipart against all relevant operations // set multipart against all relevant operations
if (operation.hasConsumes == Boolean.TRUE) { if (operation.hasConsumes == Boolean.TRUE) {
if (isMultipartType(operation.consumes)) { if (isMultipartType(operation.consumes)) {

View File

@@ -18,12 +18,9 @@ package org.openapitools.codegen.languages;
import com.google.common.collect.ImmutableMap.Builder; import com.google.common.collect.ImmutableMap.Builder;
import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Mustache;
import com.samskivert.mustache.Template;
import com.samskivert.mustache.Mustache.Lambda; import com.samskivert.mustache.Mustache.Lambda;
import com.samskivert.mustache.Template;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.media.Schema;
import org.openapitools.codegen.*; import org.openapitools.codegen.*;
import org.openapitools.codegen.languages.features.BeanValidationFeatures; import org.openapitools.codegen.languages.features.BeanValidationFeatures;
import org.openapitools.codegen.meta.features.*; import org.openapitools.codegen.meta.features.*;
@@ -37,7 +34,9 @@ import java.io.Writer;
import java.net.URL; import java.net.URL;
import java.util.*; import java.util.*;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.stream.Collectors;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import static org.openapitools.codegen.utils.StringUtils.camelize; import static org.openapitools.codegen.utils.StringUtils.camelize;

View File

@@ -28,6 +28,7 @@ import kotlinx.serialization.internal.CommonEnumSerializer
{{#serializableModel}} {{#serializableModel}}
import java.io.Serializable import java.io.Serializable
{{/serializableModel}} {{/serializableModel}}
/** /**
* {{{description}}} * {{{description}}}
{{#allVars}} {{#allVars}}

View File

@@ -1 +1 @@
{{#isQueryParam}}@Query("{{baseName}}") {{{paramName}}}: {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}}{{/isQueryParam}} {{#isQueryParam}}@Query("{{baseName}}") {{{paramName}}}: {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}}{{^required}}? = null{{/required}}{{/isQueryParam}}

View File

@@ -17,33 +17,33 @@ import kotlinx.serialization.internal.StringDescriptor
{{#operations}} {{#operations}}
{{#nonPublicApi}}internal {{/nonPublicApi}}class {{classname}} @UseExperimental(UnstableDefault::class) constructor( {{#nonPublicApi}}internal {{/nonPublicApi}}class {{classname}} @UseExperimental(UnstableDefault::class) constructor(
baseUrl: kotlin.String = "{{{basePath}}}", baseUrl: kotlin.String = "{{{basePath}}}",
httpClientEngine: HttpClientEngine? = null, httpClientEngine: HttpClientEngine? = null,
serializer: KotlinxSerializer) serializer: KotlinxSerializer
: ApiClient(baseUrl, httpClientEngine, serializer) { ) : ApiClient(baseUrl, httpClientEngine, serializer) {
@UseExperimental(UnstableDefault::class) @UseExperimental(UnstableDefault::class)
constructor( constructor(
baseUrl: kotlin.String = "{{{basePath}}}", baseUrl: kotlin.String = "{{{basePath}}}",
httpClientEngine: HttpClientEngine? = null, httpClientEngine: HttpClientEngine? = null,
jsonConfiguration: JsonConfiguration = JsonConfiguration.Default) jsonConfiguration: JsonConfiguration = JsonConfiguration.Default
: this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) ) : this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration)))
{{#operation}} {{#operation}}
/** /**
* {{summary}} * {{summary}}
* {{notes}} * {{notes}}
{{#allParams}}* @param {{{paramName}}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{#allParams}} * @param {{{paramName}}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}
{{/allParams}}* @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
*/ */
{{#returnType}} {{#returnType}}
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
{{/returnType}} {{/returnType}}
suspend fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : HttpResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> { suspend fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}): HttpResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> {
val localVariableAuthNames = listOf<String>({{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}}) val localVariableAuthNames = listOf<String>({{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}})
val localVariableBody = {{#hasBodyParam}}{{#bodyParam}}{{#isListContainer}}{{operationIdCamelCase}}Request({{{paramName}}}.asList()){{/isListContainer}}{{^isListContainer}}{{#isMapContainer}}{{operationIdCamelCase}}Request({{{paramName}}}){{/isMapContainer}}{{^isMapContainer}}{{{paramName}}}{{/isMapContainer}}{{/isListContainer}}{{/bodyParam}}{{/hasBodyParam}} val localVariableBody = {{#hasBodyParam}}{{#bodyParam}}{{#isListContainer}}{{operationIdCamelCase}}Request({{{paramName}}}{{^isList}}.asList(){{/isList}}){{/isListContainer}}{{^isListContainer}}{{#isMapContainer}}{{operationIdCamelCase}}Request({{{paramName}}}){{/isMapContainer}}{{^isMapContainer}}{{{paramName}}}{{/isMapContainer}}{{/isListContainer}}{{/bodyParam}}{{/hasBodyParam}}
{{^hasBodyParam}} {{^hasBodyParam}}
{{#hasFormParams}} {{#hasFormParams}}
{{#isMultipart}} {{#isMultipart}}
@@ -78,7 +78,7 @@ import kotlinx.serialization.internal.StringDescriptor
val localVariableConfig = RequestConfig( val localVariableConfig = RequestConfig(
RequestMethod.{{httpMethod}}, RequestMethod.{{httpMethod}},
"{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", "${{{paramName}}}"){{/pathParams}}, "{{path}}"{{#pathParams}}.replace("{" + "{{baseName}}" + "}", "${{{paramName}}}"){{/pathParams}},
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
@@ -87,20 +87,20 @@ import kotlinx.serialization.internal.StringDescriptor
localVariableConfig, localVariableConfig,
localVariableBody, localVariableBody,
localVariableAuthNames localVariableAuthNames
).{{#isListContainer}}wrap<{{operationIdCamelCase}}Response>().map { value.toTypedArray() }{{/isListContainer}}{{^isListContainer}}{{#isMapContainer}}wrap<{{operationIdCamelCase}}Response>().map { value }{{/isMapContainer}}{{^isMapContainer}}wrap(){{/isMapContainer}}{{/isListContainer}} ).{{#isListContainer}}wrap<{{operationIdCamelCase}}Response>().map { value{{^isList}}.toTypedArray(){{/isList}} }{{/isListContainer}}{{^isListContainer}}{{#isMapContainer}}wrap<{{operationIdCamelCase}}Response>().map { value }{{/isMapContainer}}{{^isMapContainer}}wrap(){{/isMapContainer}}{{/isListContainer}}
} }
{{#hasBodyParam}} {{#hasBodyParam}}
{{#bodyParam}} {{#bodyParam}}
{{#isListContainer}}{{>serial_wrapper_request_list}}{{/isListContainer}}{{#isMapContainer}}{{>serial_wrapper_request_map}}{{/isMapContainer}} {{#isListContainer}}{{>serial_wrapper_request_list}}{{/isListContainer}}{{#isMapContainer}}{{>serial_wrapper_request_map}}{{/isMapContainer}}
{{/bodyParam}} {{/bodyParam}}
{{/hasBodyParam}} {{/hasBodyParam}}
{{#isListContainer}} {{#isListContainer}}
{{>serial_wrapper_response_list}} {{>serial_wrapper_response_list}}
{{/isListContainer}} {{/isListContainer}}
{{#isMapContainer}} {{#isMapContainer}}
{{>serial_wrapper_response_map}} {{>serial_wrapper_response_map}}
{{/isMapContainer}} {{/isMapContainer}}
{{/operation}} {{/operation}}

View File

@@ -1,10 +1,10 @@
@Serializable @Serializable
private class {{operationIdCamelCase}}Request(val value: List<{{#bodyParam}}{{baseType}}{{/bodyParam}}>) { private class {{operationIdCamelCase}}Request(val value: List<{{#bodyParam}}{{baseType}}{{/bodyParam}}>) {
@Serializer({{operationIdCamelCase}}Request::class) @Serializer({{operationIdCamelCase}}Request::class)
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Request> { {{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Request> {
private val serializer: KSerializer<List<{{#bodyParam}}{{baseType}}{{/bodyParam}}>> = {{#bodyParam}}{{baseType}}{{/bodyParam}}.serializer().list private val serializer: KSerializer<List<{{#bodyParam}}{{baseType}}{{/bodyParam}}>> = {{#bodyParam}}{{baseType}}{{/bodyParam}}.serializer().list
override val descriptor = StringDescriptor.withName("{{operationIdCamelCase}}Request") override val descriptor = StringDescriptor.withName("{{operationIdCamelCase}}Request")
override fun serialize(encoder: Encoder, obj: {{operationIdCamelCase}}Request) = serializer.serialize(encoder, obj.value) override fun serialize(encoder: Encoder, obj: {{operationIdCamelCase}}Request) = serializer.serialize(encoder, obj.value)
override fun deserialize(decoder: Decoder) = {{operationIdCamelCase}}Request(serializer.deserialize(decoder)) override fun deserialize(decoder: Decoder) = {{operationIdCamelCase}}Request(serializer.deserialize(decoder))
} }
} }

View File

@@ -1,10 +1,10 @@
@Serializable @Serializable
private class {{operationIdCamelCase}}Request(val value: Map<kotlin.String, {{#bodyParam}}{{baseType}}{{/bodyParam}}>) { private class {{operationIdCamelCase}}Request(val value: Map<kotlin.String, {{#bodyParam}}{{baseType}}{{/bodyParam}}>) {
@Serializer({{operationIdCamelCase}}Request::class) @Serializer({{operationIdCamelCase}}Request::class)
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Request> { {{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Request> {
private val serializer: KSerializer<Map<kotlin.String, {{#bodyParam}}{{baseType}}{{/bodyParam}}>> = (kotlin.String.serializer() to {{#bodyParam}}{{baseType}}{{/bodyParam}}.serializer()).map private val serializer: KSerializer<Map<kotlin.String, {{#bodyParam}}{{baseType}}{{/bodyParam}}>> = (kotlin.String.serializer() to {{#bodyParam}}{{baseType}}{{/bodyParam}}.serializer()).map
override val descriptor = StringDescriptor.withName("{{operationIdCamelCase}}Request") override val descriptor = StringDescriptor.withName("{{operationIdCamelCase}}Request")
override fun serialize(encoder: Encoder, obj: {{operationIdCamelCase}}Request) = serializer.serialize(encoder, obj.value) override fun serialize(encoder: Encoder, obj: {{operationIdCamelCase}}Request) = serializer.serialize(encoder, obj.value)
override fun deserialize(decoder: Decoder) = {{operationIdCamelCase}}Request(serializer.deserialize(decoder)) override fun deserialize(decoder: Decoder) = {{operationIdCamelCase}}Request(serializer.deserialize(decoder))
} }
} }

View File

@@ -1,10 +1,10 @@
@Serializable @Serializable
private class {{operationIdCamelCase}}Response(val value: List<{{returnBaseType}}>) { private class {{operationIdCamelCase}}Response(val value: List<{{returnBaseType}}>) {
@Serializer({{operationIdCamelCase}}Response::class) @Serializer({{operationIdCamelCase}}Response::class)
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Response> { {{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Response> {
private val serializer: KSerializer<List<{{returnBaseType}}>> = {{returnBaseType}}.serializer().list private val serializer: KSerializer<List<{{returnBaseType}}>> = {{returnBaseType}}.serializer().list
override val descriptor = StringDescriptor.withName("{{operationIdCamelCase}}Response") override val descriptor = StringDescriptor.withName("{{operationIdCamelCase}}Response")
override fun serialize(encoder: Encoder, obj: {{operationIdCamelCase}}Response) = serializer.serialize(encoder, obj.value) override fun serialize(encoder: Encoder, obj: {{operationIdCamelCase}}Response) = serializer.serialize(encoder, obj.value)
override fun deserialize(decoder: Decoder) = {{operationIdCamelCase}}Response(serializer.deserialize(decoder)) override fun deserialize(decoder: Decoder) = {{operationIdCamelCase}}Response(serializer.deserialize(decoder))
} }
} }

View File

@@ -1,10 +1,10 @@
@Serializable @Serializable
private class {{operationIdCamelCase}}Response(val value: Map<kotlin.String, {{returnBaseType}}>) { private class {{operationIdCamelCase}}Response(val value: Map<kotlin.String, {{returnBaseType}}>) {
@Serializer({{operationIdCamelCase}}Response::class) @Serializer({{operationIdCamelCase}}Response::class)
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Response> { {{#nonPublicApi}}internal {{/nonPublicApi}}companion object : KSerializer<{{operationIdCamelCase}}Response> {
private val serializer: KSerializer<Map<kotlin.String, {{returnBaseType}}>> = (kotlin.String.serializer() to {{returnBaseType}}.serializer()).map private val serializer: KSerializer<Map<kotlin.String, {{returnBaseType}}>> = (kotlin.String.serializer() to {{returnBaseType}}.serializer()).map
override val descriptor = StringDescriptor.withName("{{operationIdCamelCase}}Response") override val descriptor = StringDescriptor.withName("{{operationIdCamelCase}}Response")
override fun serialize(encoder: Encoder, obj: {{operationIdCamelCase}}Response) = serializer.serialize(encoder, obj.value) override fun serialize(encoder: Encoder, obj: {{operationIdCamelCase}}Response) = serializer.serialize(encoder, obj.value)
override fun deserialize(decoder: Decoder) = {{operationIdCamelCase}}Response(serializer.deserialize(decoder)) override fun deserialize(decoder: Decoder) = {{operationIdCamelCase}}Response(serializer.deserialize(decoder))
} }
} }

View File

@@ -1,21 +1,11 @@
package org.openapitools.codegen.kotlin.spring; package org.openapitools.codegen.kotlin.spring;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.testing.Helpers; import com.google.common.collect.testing.Helpers;
import io.swagger.parser.OpenAPIParser;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.servers.Server;
import io.swagger.v3.parser.core.models.ParseOptions;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.openapitools.codegen.*; import org.openapitools.codegen.*;
import org.openapitools.codegen.config.CodegenConfigurator;
import org.openapitools.codegen.kotlin.KotlinTestUtils; import org.openapitools.codegen.kotlin.KotlinTestUtils;
import org.openapitools.codegen.languages.AbstractJavaCodegen;
import org.openapitools.codegen.languages.JavaClientCodegen;
import org.openapitools.codegen.languages.KotlinSpringServerCodegen; import org.openapitools.codegen.languages.KotlinSpringServerCodegen;
import org.openapitools.codegen.languages.SpringCodegen;
import org.openapitools.codegen.languages.features.CXFServerFeatures;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@@ -24,6 +14,10 @@ import java.nio.file.Files;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.servers.Server;
public class KotlinSpringServerCodegenTest { public class KotlinSpringServerCodegenTest {
@Test(description = "test embedded enum array") @Test(description = "test embedded enum array")

View File

@@ -5,10 +5,10 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**name** | **kotlin.String** | | **name** | **kotlin.String** | |
**photoUrls** | **kotlin.Array&lt;kotlin.String&gt;** | | **photoUrls** | **kotlin.collections.List&lt;kotlin.String&gt;** | |
**id** | **kotlin.Long** | | [optional] **id** | **kotlin.Long** | | [optional]
**category** | [**Category**](Category.md) | | [optional] **category** | [**Category**](Category.md) | | [optional]
**tags** | [**kotlin.Array&lt;Tag&gt;**](Tag.md) | | [optional] **tags** | [**kotlin.collections.List&lt;Tag&gt;**](Tag.md) | | [optional]
**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] **status** | [**inline**](#StatusEnum) | pet status in the store | [optional]

View File

@@ -110,7 +110,7 @@ Configure petstore_auth:
<a name="findPetsByStatus"></a> <a name="findPetsByStatus"></a>
# **findPetsByStatus** # **findPetsByStatus**
> kotlin.Array&lt;Pet&gt; findPetsByStatus(status) > kotlin.collections.List&lt;Pet&gt; findPetsByStatus(status)
Finds Pets by status Finds Pets by status
@@ -123,9 +123,9 @@ Multiple status values can be provided with comma separated strings
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val status : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Status values that need to be considered for filter val status : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Status values that need to be considered for filter
try { try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByStatus(status) val result : kotlin.collections.List<Pet> = apiInstance.findPetsByStatus(status)
println(result) println(result)
} catch (e: ClientException) { } catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByStatus") println("4xx response calling PetApi#findPetsByStatus")
@@ -140,11 +140,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**status** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] **status** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type ### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md) [**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization ### Authorization
@@ -159,7 +159,7 @@ Configure petstore_auth:
<a name="findPetsByTags"></a> <a name="findPetsByTags"></a>
# **findPetsByTags** # **findPetsByTags**
> kotlin.Array&lt;Pet&gt; findPetsByTags(tags) > kotlin.collections.List&lt;Pet&gt; findPetsByTags(tags)
Finds Pets by tags Finds Pets by tags
@@ -172,9 +172,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val tags : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Tags to filter by val tags : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Tags to filter by
try { try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByTags(tags) val result : kotlin.collections.List<Pet> = apiInstance.findPetsByTags(tags)
println(result) println(result)
} catch (e: ClientException) { } catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByTags") println("4xx response calling PetApi#findPetsByTags")
@@ -189,11 +189,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**tags** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by | **tags** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
### Return type ### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md) [**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization ### Authorization

View File

@@ -73,7 +73,7 @@ Creates list of users with given input array
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val body : kotlin.Array<User> = // kotlin.Array<User> | List of user object val body : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try { try {
apiInstance.createUsersWithArrayInput(body) apiInstance.createUsersWithArrayInput(body)
} catch (e: ClientException) { } catch (e: ClientException) {
@@ -89,7 +89,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object | **body** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type
@@ -117,7 +117,7 @@ Creates list of users with given input array
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val body : kotlin.Array<User> = // kotlin.Array<User> | List of user object val body : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try { try {
apiInstance.createUsersWithListInput(body) apiInstance.createUsersWithListInput(body)
} catch (e: ClientException) { } catch (e: ClientException) {
@@ -133,7 +133,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object | **body** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type

View File

@@ -119,14 +119,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* Finds Pets by status * Finds Pets by status
* Multiple status values can be provided with comma separated strings * Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter * @param status Status values that need to be considered for filter
* @return kotlin.Array<Pet> * @return kotlin.collections.List<Pet>
* @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response * @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatus(status: kotlin.Array<kotlin.String>) : kotlin.Array<Pet> { fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableBody: kotlin.Any? = null val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>() val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply { .apply {
@@ -139,13 +139,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
val localVarResponse = request<kotlin.Array<Pet>>( val localVarResponse = request<kotlin.collections.List<Pet>>(
localVariableConfig, localVariableConfig,
localVariableBody localVariableBody
) )
return when (localVarResponse.responseType) { return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet> ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> { ResponseType.ClientError -> {
@@ -163,7 +163,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* Finds Pets by tags * Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by * @param tags Tags to filter by
* @return kotlin.Array<Pet> * @return kotlin.collections.List<Pet>
* @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response * @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
@@ -171,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.") @Deprecated(message = "This operation is deprecated.")
fun findPetsByTags(tags: kotlin.Array<kotlin.String>) : kotlin.Array<Pet> { fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableBody: kotlin.Any? = null val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>() val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply { .apply {
@@ -184,13 +184,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
val localVarResponse = request<kotlin.Array<Pet>>( val localVarResponse = request<kotlin.collections.List<Pet>>(
localVariableConfig, localVariableConfig,
localVariableBody localVariableBody
) )
return when (localVarResponse.responseType) { return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet> ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> { ResponseType.ClientError -> {

View File

@@ -83,7 +83,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInput(body: kotlin.Array<User>) : Unit { fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableBody: kotlin.Any? = body val localVariableBody: kotlin.Any? = body
val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
@@ -123,7 +123,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInput(body: kotlin.Array<User>) : Unit { fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableBody: kotlin.Any? = body val localVariableBody: kotlin.Any? = body
val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
/** /**
* Describes the result of uploading an image resource * Describes the result of uploading an image resource
* @param code * @param code

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
/** /**
* A category for a pet * A category for a pet
* @param id * @param id

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
/** /**
* An order for a pets from the pet store * An order for a pets from the pet store
* @param id * @param id

View File

@@ -15,6 +15,7 @@ import org.openapitools.client.models.Category
import org.openapitools.client.models.Tag import org.openapitools.client.models.Tag
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
/** /**
* A pet for sale in the pet store * A pet for sale in the pet store
* @param name * @param name
@@ -29,13 +30,13 @@ data class Pet (
@SerializedName("name") @SerializedName("name")
val name: kotlin.String, val name: kotlin.String,
@SerializedName("photoUrls") @SerializedName("photoUrls")
val photoUrls: kotlin.Array<kotlin.String>, val photoUrls: kotlin.collections.List<kotlin.String>,
@SerializedName("id") @SerializedName("id")
val id: kotlin.Long? = null, val id: kotlin.Long? = null,
@SerializedName("category") @SerializedName("category")
val category: Category? = null, val category: Category? = null,
@SerializedName("tags") @SerializedName("tags")
val tags: kotlin.Array<Tag>? = null, val tags: kotlin.collections.List<Tag>? = null,
/* pet status in the store */ /* pet status in the store */
@SerializedName("status") @SerializedName("status")
val status: Pet.Status? = null val status: Pet.Status? = null

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
/** /**
* A tag for a pet * A tag for a pet
* @param id * @param id

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
/** /**
* A User who is purchasing from the pet store * A User who is purchasing from the pet store
* @param id * @param id

View File

@@ -5,10 +5,10 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**name** | **kotlin.String** | | **name** | **kotlin.String** | |
**photoUrls** | **kotlin.Array&lt;kotlin.String&gt;** | | **photoUrls** | **kotlin.collections.List&lt;kotlin.String&gt;** | |
**id** | **kotlin.Long** | | [optional] **id** | **kotlin.Long** | | [optional]
**category** | [**Category**](Category.md) | | [optional] **category** | [**Category**](Category.md) | | [optional]
**tags** | [**kotlin.Array&lt;Tag&gt;**](Tag.md) | | [optional] **tags** | [**kotlin.collections.List&lt;Tag&gt;**](Tag.md) | | [optional]
**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] **status** | [**inline**](#StatusEnum) | pet status in the store | [optional]

View File

@@ -110,7 +110,7 @@ Configure petstore_auth:
<a name="findPetsByStatus"></a> <a name="findPetsByStatus"></a>
# **findPetsByStatus** # **findPetsByStatus**
> kotlin.Array&lt;Pet&gt; findPetsByStatus(status) > kotlin.collections.List&lt;Pet&gt; findPetsByStatus(status)
Finds Pets by status Finds Pets by status
@@ -123,9 +123,9 @@ Multiple status values can be provided with comma separated strings
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val status : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Status values that need to be considered for filter val status : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Status values that need to be considered for filter
try { try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByStatus(status) val result : kotlin.collections.List<Pet> = apiInstance.findPetsByStatus(status)
println(result) println(result)
} catch (e: ClientException) { } catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByStatus") println("4xx response calling PetApi#findPetsByStatus")
@@ -140,11 +140,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**status** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] **status** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type ### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md) [**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization ### Authorization
@@ -159,7 +159,7 @@ Configure petstore_auth:
<a name="findPetsByTags"></a> <a name="findPetsByTags"></a>
# **findPetsByTags** # **findPetsByTags**
> kotlin.Array&lt;Pet&gt; findPetsByTags(tags) > kotlin.collections.List&lt;Pet&gt; findPetsByTags(tags)
Finds Pets by tags Finds Pets by tags
@@ -172,9 +172,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val tags : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Tags to filter by val tags : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Tags to filter by
try { try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByTags(tags) val result : kotlin.collections.List<Pet> = apiInstance.findPetsByTags(tags)
println(result) println(result)
} catch (e: ClientException) { } catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByTags") println("4xx response calling PetApi#findPetsByTags")
@@ -189,11 +189,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**tags** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by | **tags** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
### Return type ### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md) [**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization ### Authorization

View File

@@ -73,7 +73,7 @@ Creates list of users with given input array
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val body : kotlin.Array<User> = // kotlin.Array<User> | List of user object val body : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try { try {
apiInstance.createUsersWithArrayInput(body) apiInstance.createUsersWithArrayInput(body)
} catch (e: ClientException) { } catch (e: ClientException) {
@@ -89,7 +89,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object | **body** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type
@@ -117,7 +117,7 @@ Creates list of users with given input array
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val body : kotlin.Array<User> = // kotlin.Array<User> | List of user object val body : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try { try {
apiInstance.createUsersWithListInput(body) apiInstance.createUsersWithListInput(body)
} catch (e: ClientException) { } catch (e: ClientException) {
@@ -133,7 +133,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object | **body** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type

View File

@@ -10,7 +10,7 @@ fun main() {
println("<top>.main") println("<top>.main")
val inventory = StoreApi().getInventory() val inventory = StoreApi().getInventory()
println("Inventory : $inventory") println("Inventory : $inventory")
val pet = Pet(name = "Elliot", photoUrls = listOf<String>("https://jameshooverstudios.com/wp-content/uploads/2015/04/Majestic-Dog-Photography-Elliot-Nov-5-2014.jpg", "https://express-images.franklymedia.com/6616/sites/981/2020/01/22105725/Elliott.jpg").toTypedArray(), id = 123456453, category = Category(id = 13259476, name = "dog"), tags = listOf<Tag>(Tag(id = 194093, name = "Elliot")).toTypedArray(), status = Pet.Status.AVAILABLE) val pet = Pet(name = "Elliot", photoUrls = listOf<String>("https://jameshooverstudios.com/wp-content/uploads/2015/04/Majestic-Dog-Photography-Elliot-Nov-5-2014.jpg", "https://express-images.franklymedia.com/6616/sites/981/2020/01/22105725/Elliott.jpg"), id = 123456453, category = Category(id = 13259476, name = "dog"), tags = listOf<Tag>(Tag(id = 194093, name = "Elliot")), status = Pet.Status.AVAILABLE)
PetApi().addPet(pet) PetApi().addPet(pet)
val elliot = PetApi().getPetById(123456453) val elliot = PetApi().getPetById(123456453)
println("Elliot : $elliot") println("Elliot : $elliot")

View File

@@ -119,14 +119,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* Finds Pets by status * Finds Pets by status
* Multiple status values can be provided with comma separated strings * Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter * @param status Status values that need to be considered for filter
* @return kotlin.Array<Pet> * @return kotlin.collections.List<Pet>
* @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response * @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatus(status: kotlin.Array<kotlin.String>) : kotlin.Array<Pet> { fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableBody: kotlin.Any? = null val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>() val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply { .apply {
@@ -139,13 +139,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
val localVarResponse = request<kotlin.Array<Pet>>( val localVarResponse = request<kotlin.collections.List<Pet>>(
localVariableConfig, localVariableConfig,
localVariableBody localVariableBody
) )
return when (localVarResponse.responseType) { return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet> ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> { ResponseType.ClientError -> {
@@ -163,7 +163,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* Finds Pets by tags * Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by * @param tags Tags to filter by
* @return kotlin.Array<Pet> * @return kotlin.collections.List<Pet>
* @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response * @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
@@ -171,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.") @Deprecated(message = "This operation is deprecated.")
fun findPetsByTags(tags: kotlin.Array<kotlin.String>) : kotlin.Array<Pet> { fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableBody: kotlin.Any? = null val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>() val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply { .apply {
@@ -184,13 +184,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
val localVarResponse = request<kotlin.Array<Pet>>( val localVarResponse = request<kotlin.collections.List<Pet>>(
localVariableConfig, localVariableConfig,
localVariableBody localVariableBody
) )
return when (localVarResponse.responseType) { return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet> ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> { ResponseType.ClientError -> {

View File

@@ -83,7 +83,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInput(body: kotlin.Array<User>) : Unit { fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableBody: kotlin.Any? = body val localVariableBody: kotlin.Any? = body
val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
@@ -123,7 +123,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInput(body: kotlin.Array<User>) : Unit { fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableBody: kotlin.Any? = body val localVariableBody: kotlin.Any? = body
val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonProperty
/** /**
* Describes the result of uploading an image resource * Describes the result of uploading an image resource
* @param code * @param code

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonProperty
/** /**
* A category for a pet * A category for a pet
* @param id * @param id

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonProperty
/** /**
* An order for a pets from the pet store * An order for a pets from the pet store
* @param id * @param id

View File

@@ -15,6 +15,7 @@ import org.openapitools.client.models.Category
import org.openapitools.client.models.Tag import org.openapitools.client.models.Tag
import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonProperty
/** /**
* A pet for sale in the pet store * A pet for sale in the pet store
* @param name * @param name
@@ -29,13 +30,13 @@ data class Pet (
@field:JsonProperty("name") @field:JsonProperty("name")
val name: kotlin.String, val name: kotlin.String,
@field:JsonProperty("photoUrls") @field:JsonProperty("photoUrls")
val photoUrls: kotlin.Array<kotlin.String>, val photoUrls: kotlin.collections.List<kotlin.String>,
@field:JsonProperty("id") @field:JsonProperty("id")
val id: kotlin.Long? = null, val id: kotlin.Long? = null,
@field:JsonProperty("category") @field:JsonProperty("category")
val category: Category? = null, val category: Category? = null,
@field:JsonProperty("tags") @field:JsonProperty("tags")
val tags: kotlin.Array<Tag>? = null, val tags: kotlin.collections.List<Tag>? = null,
/* pet status in the store */ /* pet status in the store */
@field:JsonProperty("status") @field:JsonProperty("status")
val status: Pet.Status? = null val status: Pet.Status? = null

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonProperty
/** /**
* A tag for a pet * A tag for a pet
* @param id * @param id

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonProperty
/** /**
* A User who is purchasing from the pet store * A User who is purchasing from the pet store
* @param id * @param id

View File

@@ -5,10 +5,10 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**name** | **kotlin.String** | | **name** | **kotlin.String** | |
**photoUrls** | **kotlin.Array&lt;kotlin.String&gt;** | | **photoUrls** | **kotlin.collections.List&lt;kotlin.String&gt;** | |
**id** | **kotlin.Long** | | [optional] **id** | **kotlin.Long** | | [optional]
**category** | [**Category**](Category.md) | | [optional] **category** | [**Category**](Category.md) | | [optional]
**tags** | [**kotlin.Array&lt;Tag&gt;**](Tag.md) | | [optional] **tags** | [**kotlin.collections.List&lt;Tag&gt;**](Tag.md) | | [optional]
**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] **status** | [**inline**](#StatusEnum) | pet status in the store | [optional]

View File

@@ -110,7 +110,7 @@ Configure petstore_auth:
<a name="findPetsByTags"></a> <a name="findPetsByTags"></a>
# **findPetsByTags** # **findPetsByTags**
> kotlin.Array&lt;Pet&gt; findPetsByTags(tags) > kotlin.collections.List&lt;Pet&gt; findPetsByTags(tags)
Finds Pets by tags Finds Pets by tags
@@ -123,9 +123,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val tags : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Tags to filter by val tags : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Tags to filter by
try { try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByTags(tags) val result : kotlin.collections.List<Pet> = apiInstance.findPetsByTags(tags)
println(result) println(result)
} catch (e: ClientException) { } catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByTags") println("4xx response calling PetApi#findPetsByTags")
@@ -140,11 +140,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**tags** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by | **tags** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
### Return type ### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md) [**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization ### Authorization
@@ -159,7 +159,7 @@ Configure petstore_auth:
<a name="getAllPets"></a> <a name="getAllPets"></a>
# **getAllPets** # **getAllPets**
> kotlin.Array&lt;Pet&gt; getAllPets(lastUpdated) > kotlin.collections.List&lt;Pet&gt; getAllPets(lastUpdated)
Get all pets Get all pets
@@ -172,7 +172,7 @@ Get all pets
val apiInstance = PetApi() val apiInstance = PetApi()
val lastUpdated : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | When this endpoint was hit last to help indentify if the client already has the latest copy. val lastUpdated : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | When this endpoint was hit last to help indentify if the client already has the latest copy.
try { try {
val result : kotlin.Array<Pet> = apiInstance.getAllPets(lastUpdated) val result : kotlin.collections.List<Pet> = apiInstance.getAllPets(lastUpdated)
println(result) println(result)
} catch (e: ClientException) { } catch (e: ClientException) {
println("4xx response calling PetApi#getAllPets") println("4xx response calling PetApi#getAllPets")
@@ -191,7 +191,7 @@ Name | Type | Description | Notes
### Return type ### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md) [**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization ### Authorization

View File

@@ -73,7 +73,7 @@ Creates list of users with given input array
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val body : kotlin.Array<User> = // kotlin.Array<User> | List of user object val body : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try { try {
apiInstance.createUsersWithArrayInput(body) apiInstance.createUsersWithArrayInput(body)
} catch (e: ClientException) { } catch (e: ClientException) {
@@ -89,7 +89,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object | **body** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type
@@ -117,7 +117,7 @@ Creates list of users with given input array
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val body : kotlin.Array<User> = // kotlin.Array<User> | List of user object val body : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try { try {
apiInstance.createUsersWithListInput(body) apiInstance.createUsersWithListInput(body)
} catch (e: ClientException) { } catch (e: ClientException) {
@@ -133,7 +133,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object | **body** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type

View File

@@ -119,7 +119,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* Finds Pets by tags * Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by * @param tags Tags to filter by
* @return kotlin.Array<Pet> * @return kotlin.collections.List<Pet>
* @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response * @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
@@ -127,7 +127,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.") @Deprecated(message = "This operation is deprecated.")
fun findPetsByTags(tags: kotlin.Array<kotlin.String>) : kotlin.Array<Pet> { fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableBody: kotlin.Any? = null val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>() val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply { .apply {
@@ -140,13 +140,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
val localVarResponse = request<kotlin.Array<Pet>>( val localVarResponse = request<kotlin.collections.List<Pet>>(
localVariableConfig, localVariableConfig,
localVariableBody localVariableBody
) )
return when (localVarResponse.responseType) { return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet> ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> { ResponseType.ClientError -> {
@@ -164,14 +164,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* Get all pets * Get all pets
* *
* @param lastUpdated When this endpoint was hit last to help indentify if the client already has the latest copy. (optional) * @param lastUpdated When this endpoint was hit last to help indentify if the client already has the latest copy. (optional)
* @return kotlin.Array<Pet> * @return kotlin.collections.List<Pet>
* @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response * @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun getAllPets(lastUpdated: java.time.OffsetDateTime?) : kotlin.Array<Pet> { fun getAllPets(lastUpdated: java.time.OffsetDateTime?) : kotlin.collections.List<Pet> {
val localVariableBody: kotlin.Any? = null val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>() val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply { .apply {
@@ -186,13 +186,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
val localVarResponse = request<kotlin.Array<Pet>>( val localVarResponse = request<kotlin.collections.List<Pet>>(
localVariableConfig, localVariableConfig,
localVariableBody localVariableBody
) )
return when (localVarResponse.responseType) { return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet> ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> { ResponseType.ClientError -> {

View File

@@ -83,7 +83,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInput(body: kotlin.Array<User>) : Unit { fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableBody: kotlin.Any? = body val localVariableBody: kotlin.Any? = body
val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
@@ -123,7 +123,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInput(body: kotlin.Array<User>) : Unit { fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableBody: kotlin.Any? = body val localVariableBody: kotlin.Any? = body
val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
/** /**
* Describes the result of uploading an image resource * Describes the result of uploading an image resource
* @param code * @param code

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
/** /**
* A category for a pet * A category for a pet
* @param id * @param id

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
/** /**
* An order for a pets from the pet store * An order for a pets from the pet store
* @param id * @param id

View File

@@ -15,6 +15,7 @@ import org.openapitools.client.models.Category
import org.openapitools.client.models.Tag import org.openapitools.client.models.Tag
import com.squareup.moshi.Json import com.squareup.moshi.Json
/** /**
* A pet for sale in the pet store * A pet for sale in the pet store
* @param name * @param name
@@ -29,13 +30,13 @@ data class Pet (
@Json(name = "name") @Json(name = "name")
val name: kotlin.String, val name: kotlin.String,
@Json(name = "photoUrls") @Json(name = "photoUrls")
val photoUrls: kotlin.Array<kotlin.String>, val photoUrls: kotlin.collections.List<kotlin.String>,
@Json(name = "id") @Json(name = "id")
val id: kotlin.Long? = null, val id: kotlin.Long? = null,
@Json(name = "category") @Json(name = "category")
val category: Category? = null, val category: Category? = null,
@Json(name = "tags") @Json(name = "tags")
val tags: kotlin.Array<Tag>? = null, val tags: kotlin.collections.List<Tag>? = null,
/* pet status in the store */ /* pet status in the store */
@Json(name = "status") @Json(name = "status")
val status: Pet.Status? = null val status: Pet.Status? = null

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
/** /**
* A tag for a pet * A tag for a pet
* @param id * @param id

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
/** /**
* A User who is purchasing from the pet store * A User who is purchasing from the pet store
* @param id * @param id

View File

@@ -5,10 +5,10 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**name** | **kotlin.String** | | **name** | **kotlin.String** | |
**photoUrls** | **kotlin.Array&lt;kotlin.String&gt;** | | **photoUrls** | **kotlin.collections.List&lt;kotlin.String&gt;** | |
**id** | **kotlin.Long** | | [optional] **id** | **kotlin.Long** | | [optional]
**category** | [**Category**](Category.md) | | [optional] **category** | [**Category**](Category.md) | | [optional]
**tags** | [**kotlin.Array&lt;Tag&gt;**](Tag.md) | | [optional] **tags** | [**kotlin.collections.List&lt;Tag&gt;**](Tag.md) | | [optional]
**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] **status** | [**inline**](#StatusEnum) | pet status in the store | [optional]

View File

@@ -110,7 +110,7 @@ Configure petstore_auth:
<a name="findPetsByStatus"></a> <a name="findPetsByStatus"></a>
# **findPetsByStatus** # **findPetsByStatus**
> kotlin.Array&lt;Pet&gt; findPetsByStatus(status) > kotlin.collections.List&lt;Pet&gt; findPetsByStatus(status)
Finds Pets by status Finds Pets by status
@@ -123,9 +123,9 @@ Multiple status values can be provided with comma separated strings
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val status : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Status values that need to be considered for filter val status : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Status values that need to be considered for filter
try { try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByStatus(status) val result : kotlin.collections.List<Pet> = apiInstance.findPetsByStatus(status)
println(result) println(result)
} catch (e: ClientException) { } catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByStatus") println("4xx response calling PetApi#findPetsByStatus")
@@ -140,11 +140,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**status** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] **status** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type ### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md) [**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization ### Authorization
@@ -159,7 +159,7 @@ Configure petstore_auth:
<a name="findPetsByTags"></a> <a name="findPetsByTags"></a>
# **findPetsByTags** # **findPetsByTags**
> kotlin.Array&lt;Pet&gt; findPetsByTags(tags) > kotlin.collections.List&lt;Pet&gt; findPetsByTags(tags)
Finds Pets by tags Finds Pets by tags
@@ -172,9 +172,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val tags : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Tags to filter by val tags : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Tags to filter by
try { try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByTags(tags) val result : kotlin.collections.List<Pet> = apiInstance.findPetsByTags(tags)
println(result) println(result)
} catch (e: ClientException) { } catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByTags") println("4xx response calling PetApi#findPetsByTags")
@@ -189,11 +189,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**tags** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by | **tags** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
### Return type ### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md) [**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization ### Authorization

View File

@@ -73,7 +73,7 @@ Creates list of users with given input array
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val body : kotlin.Array<User> = // kotlin.Array<User> | List of user object val body : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try { try {
apiInstance.createUsersWithArrayInput(body) apiInstance.createUsersWithArrayInput(body)
} catch (e: ClientException) { } catch (e: ClientException) {
@@ -89,7 +89,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object | **body** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type
@@ -117,7 +117,7 @@ Creates list of users with given input array
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val body : kotlin.Array<User> = // kotlin.Array<User> | List of user object val body : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try { try {
apiInstance.createUsersWithListInput(body) apiInstance.createUsersWithListInput(body)
} catch (e: ClientException) { } catch (e: ClientException) {
@@ -133,7 +133,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object | **body** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type

View File

@@ -119,14 +119,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* Finds Pets by status * Finds Pets by status
* Multiple status values can be provided with comma separated strings * Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter * @param status Status values that need to be considered for filter
* @return kotlin.Array<Pet> * @return kotlin.collections.List<Pet>
* @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response * @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun findPetsByStatus(status: kotlin.Array<kotlin.String>) : kotlin.Array<Pet> { suspend fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableBody: kotlin.Any? = null val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>() val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply { .apply {
@@ -139,13 +139,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
val localVarResponse = request<kotlin.Array<Pet>>( val localVarResponse = request<kotlin.collections.List<Pet>>(
localVariableConfig, localVariableConfig,
localVariableBody localVariableBody
) )
return when (localVarResponse.responseType) { return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet> ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> { ResponseType.ClientError -> {
@@ -163,7 +163,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* Finds Pets by tags * Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by * @param tags Tags to filter by
* @return kotlin.Array<Pet> * @return kotlin.collections.List<Pet>
* @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response * @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
@@ -171,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.") @Deprecated(message = "This operation is deprecated.")
suspend fun findPetsByTags(tags: kotlin.Array<kotlin.String>) : kotlin.Array<Pet> { suspend fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableBody: kotlin.Any? = null val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>() val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply { .apply {
@@ -184,13 +184,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
val localVarResponse = request<kotlin.Array<Pet>>( val localVarResponse = request<kotlin.collections.List<Pet>>(
localVariableConfig, localVariableConfig,
localVariableBody localVariableBody
) )
return when (localVarResponse.responseType) { return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet> ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> { ResponseType.ClientError -> {

View File

@@ -83,7 +83,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun createUsersWithArrayInput(body: kotlin.Array<User>) : Unit { suspend fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableBody: kotlin.Any? = body val localVariableBody: kotlin.Any? = body
val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
@@ -123,7 +123,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
suspend fun createUsersWithListInput(body: kotlin.Array<User>) : Unit { suspend fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableBody: kotlin.Any? = body val localVariableBody: kotlin.Any? = body
val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
import java.io.Serializable import java.io.Serializable
/** /**
* Describes the result of uploading an image resource * Describes the result of uploading an image resource
* @param code * @param code

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
import java.io.Serializable import java.io.Serializable
/** /**
* A category for a pet * A category for a pet
* @param id * @param id

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
import java.io.Serializable import java.io.Serializable
/** /**
* An order for a pets from the pet store * An order for a pets from the pet store
* @param id * @param id

View File

@@ -16,6 +16,7 @@ import org.openapitools.client.models.Tag
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
import java.io.Serializable import java.io.Serializable
/** /**
* A pet for sale in the pet store * A pet for sale in the pet store
* @param name * @param name
@@ -30,13 +31,13 @@ data class Pet (
@SerializedName("name") @SerializedName("name")
val name: kotlin.String, val name: kotlin.String,
@SerializedName("photoUrls") @SerializedName("photoUrls")
val photoUrls: kotlin.Array<kotlin.String>, val photoUrls: kotlin.collections.List<kotlin.String>,
@SerializedName("id") @SerializedName("id")
val id: kotlin.Long? = null, val id: kotlin.Long? = null,
@SerializedName("category") @SerializedName("category")
val category: Category? = null, val category: Category? = null,
@SerializedName("tags") @SerializedName("tags")
val tags: kotlin.Array<Tag>? = null, val tags: kotlin.collections.List<Tag>? = null,
/* pet status in the store */ /* pet status in the store */
@SerializedName("status") @SerializedName("status")
val status: Pet.Status? = null val status: Pet.Status? = null

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
import java.io.Serializable import java.io.Serializable
/** /**
* A tag for a pet * A tag for a pet
* @param id * @param id

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
import java.io.Serializable import java.io.Serializable
/** /**
* A User who is purchasing from the pet store * A User who is purchasing from the pet store
* @param id * @param id

View File

@@ -5,10 +5,10 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**name** | **kotlin.String** | | **name** | **kotlin.String** | |
**photoUrls** | **kotlin.Array&lt;kotlin.String&gt;** | | **photoUrls** | **kotlin.collections.List&lt;kotlin.String&gt;** | |
**id** | **kotlin.Long** | | [optional] **id** | **kotlin.Long** | | [optional]
**category** | [**Category**](Category.md) | | [optional] **category** | [**Category**](Category.md) | | [optional]
**tags** | [**kotlin.Array&lt;Tag&gt;**](Tag.md) | | [optional] **tags** | [**kotlin.collections.List&lt;Tag&gt;**](Tag.md) | | [optional]
**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] **status** | [**inline**](#StatusEnum) | pet status in the store | [optional]

View File

@@ -110,7 +110,7 @@ Configure petstore_auth:
<a name="findPetsByStatus"></a> <a name="findPetsByStatus"></a>
# **findPetsByStatus** # **findPetsByStatus**
> kotlin.Array&lt;Pet&gt; findPetsByStatus(status) > kotlin.collections.List&lt;Pet&gt; findPetsByStatus(status)
Finds Pets by status Finds Pets by status
@@ -123,9 +123,9 @@ Multiple status values can be provided with comma separated strings
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val status : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Status values that need to be considered for filter val status : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Status values that need to be considered for filter
try { try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByStatus(status) val result : kotlin.collections.List<Pet> = apiInstance.findPetsByStatus(status)
println(result) println(result)
} catch (e: ClientException) { } catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByStatus") println("4xx response calling PetApi#findPetsByStatus")
@@ -140,11 +140,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**status** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] **status** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type ### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md) [**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization ### Authorization
@@ -159,7 +159,7 @@ Configure petstore_auth:
<a name="findPetsByTags"></a> <a name="findPetsByTags"></a>
# **findPetsByTags** # **findPetsByTags**
> kotlin.Array&lt;Pet&gt; findPetsByTags(tags) > kotlin.collections.List&lt;Pet&gt; findPetsByTags(tags)
Finds Pets by tags Finds Pets by tags
@@ -172,9 +172,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val tags : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Tags to filter by val tags : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Tags to filter by
try { try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByTags(tags) val result : kotlin.collections.List<Pet> = apiInstance.findPetsByTags(tags)
println(result) println(result)
} catch (e: ClientException) { } catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByTags") println("4xx response calling PetApi#findPetsByTags")
@@ -189,11 +189,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**tags** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by | **tags** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
### Return type ### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md) [**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization ### Authorization

View File

@@ -73,7 +73,7 @@ Creates list of users with given input array
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val body : kotlin.Array<User> = // kotlin.Array<User> | List of user object val body : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try { try {
apiInstance.createUsersWithArrayInput(body) apiInstance.createUsersWithArrayInput(body)
} catch (e: ClientException) { } catch (e: ClientException) {
@@ -89,7 +89,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object | **body** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type
@@ -117,7 +117,7 @@ Creates list of users with given input array
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val body : kotlin.Array<User> = // kotlin.Array<User> | List of user object val body : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try { try {
apiInstance.createUsersWithListInput(body) apiInstance.createUsersWithListInput(body)
} catch (e: ClientException) { } catch (e: ClientException) {
@@ -133,7 +133,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object | **body** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type

View File

@@ -119,14 +119,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* Finds Pets by status * Finds Pets by status
* Multiple status values can be provided with comma separated strings * Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter * @param status Status values that need to be considered for filter
* @return kotlin.Array<Pet> * @return kotlin.collections.List<Pet>
* @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response * @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatus(status: kotlin.Array<kotlin.String>) : kotlin.Array<Pet> { fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableBody: kotlin.Any? = null val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>() val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply { .apply {
@@ -139,13 +139,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
val localVarResponse = request<kotlin.Array<Pet>>( val localVarResponse = request<kotlin.collections.List<Pet>>(
localVariableConfig, localVariableConfig,
localVariableBody localVariableBody
) )
return when (localVarResponse.responseType) { return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet> ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> { ResponseType.ClientError -> {
@@ -163,7 +163,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* Finds Pets by tags * Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by * @param tags Tags to filter by
* @return kotlin.Array<Pet> * @return kotlin.collections.List<Pet>
* @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response * @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
@@ -171,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.") @Deprecated(message = "This operation is deprecated.")
fun findPetsByTags(tags: kotlin.Array<kotlin.String>) : kotlin.Array<Pet> { fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableBody: kotlin.Any? = null val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>() val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply { .apply {
@@ -184,13 +184,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
val localVarResponse = request<kotlin.Array<Pet>>( val localVarResponse = request<kotlin.collections.List<Pet>>(
localVariableConfig, localVariableConfig,
localVariableBody localVariableBody
) )
return when (localVarResponse.responseType) { return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet> ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> { ResponseType.ClientError -> {

View File

@@ -83,7 +83,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInput(body: kotlin.Array<User>) : Unit { fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableBody: kotlin.Any? = body val localVariableBody: kotlin.Any? = body
val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
@@ -123,7 +123,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInput(body: kotlin.Array<User>) : Unit { fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableBody: kotlin.Any? = body val localVariableBody: kotlin.Any? = body
val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass import com.squareup.moshi.JsonClass
/** /**
* Describes the result of uploading an image resource * Describes the result of uploading an image resource
* @param code * @param code

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass import com.squareup.moshi.JsonClass
/** /**
* A category for a pet * A category for a pet
* @param id * @param id

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass import com.squareup.moshi.JsonClass
/** /**
* An order for a pets from the pet store * An order for a pets from the pet store
* @param id * @param id

View File

@@ -16,6 +16,7 @@ import org.openapitools.client.models.Tag
import com.squareup.moshi.Json import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass import com.squareup.moshi.JsonClass
/** /**
* A pet for sale in the pet store * A pet for sale in the pet store
* @param name * @param name
@@ -30,13 +31,13 @@ data class Pet (
@Json(name = "name") @Json(name = "name")
val name: kotlin.String, val name: kotlin.String,
@Json(name = "photoUrls") @Json(name = "photoUrls")
val photoUrls: kotlin.Array<kotlin.String>, val photoUrls: kotlin.collections.List<kotlin.String>,
@Json(name = "id") @Json(name = "id")
val id: kotlin.Long? = null, val id: kotlin.Long? = null,
@Json(name = "category") @Json(name = "category")
val category: Category? = null, val category: Category? = null,
@Json(name = "tags") @Json(name = "tags")
val tags: kotlin.Array<Tag>? = null, val tags: kotlin.collections.List<Tag>? = null,
/* pet status in the store */ /* pet status in the store */
@Json(name = "status") @Json(name = "status")
val status: Pet.Status? = null val status: Pet.Status? = null

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass import com.squareup.moshi.JsonClass
/** /**
* A tag for a pet * A tag for a pet
* @param id * @param id

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass import com.squareup.moshi.JsonClass
/** /**
* A User who is purchasing from the pet store * A User who is purchasing from the pet store
* @param id * @param id

View File

@@ -5,10 +5,10 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**name** | **kotlin.String** | | **name** | **kotlin.String** | |
**photoUrls** | **kotlin.Array&lt;kotlin.String&gt;** | | **photoUrls** | **kotlin.collections.List&lt;kotlin.String&gt;** | |
**id** | **kotlin.Long** | | [optional] **id** | **kotlin.Long** | | [optional]
**category** | [**Category**](Category.md) | | [optional] **category** | [**Category**](Category.md) | | [optional]
**tags** | [**kotlin.Array&lt;Tag&gt;**](Tag.md) | | [optional] **tags** | [**kotlin.collections.List&lt;Tag&gt;**](Tag.md) | | [optional]
**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] **status** | [**inline**](#StatusEnum) | pet status in the store | [optional]

View File

@@ -110,7 +110,7 @@ Configure petstore_auth:
<a name="findPetsByStatus"></a> <a name="findPetsByStatus"></a>
# **findPetsByStatus** # **findPetsByStatus**
> kotlin.Array&lt;Pet&gt; findPetsByStatus(status) > kotlin.collections.List&lt;Pet&gt; findPetsByStatus(status)
Finds Pets by status Finds Pets by status
@@ -123,9 +123,9 @@ Multiple status values can be provided with comma separated strings
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val status : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Status values that need to be considered for filter val status : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Status values that need to be considered for filter
try { try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByStatus(status) val result : kotlin.collections.List<Pet> = apiInstance.findPetsByStatus(status)
println(result) println(result)
} catch (e: ClientException) { } catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByStatus") println("4xx response calling PetApi#findPetsByStatus")
@@ -140,11 +140,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**status** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] **status** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type ### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md) [**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization ### Authorization
@@ -159,7 +159,7 @@ Configure petstore_auth:
<a name="findPetsByTags"></a> <a name="findPetsByTags"></a>
# **findPetsByTags** # **findPetsByTags**
> kotlin.Array&lt;Pet&gt; findPetsByTags(tags) > kotlin.collections.List&lt;Pet&gt; findPetsByTags(tags)
Finds Pets by tags Finds Pets by tags
@@ -172,9 +172,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val tags : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Tags to filter by val tags : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Tags to filter by
try { try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByTags(tags) val result : kotlin.collections.List<Pet> = apiInstance.findPetsByTags(tags)
println(result) println(result)
} catch (e: ClientException) { } catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByTags") println("4xx response calling PetApi#findPetsByTags")
@@ -189,11 +189,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**tags** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by | **tags** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
### Return type ### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md) [**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization ### Authorization

View File

@@ -73,7 +73,7 @@ Creates list of users with given input array
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val body : kotlin.Array<User> = // kotlin.Array<User> | List of user object val body : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try { try {
apiInstance.createUsersWithArrayInput(body) apiInstance.createUsersWithArrayInput(body)
} catch (e: ClientException) { } catch (e: ClientException) {
@@ -89,7 +89,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object | **body** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type
@@ -117,7 +117,7 @@ Creates list of users with given input array
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val body : kotlin.Array<User> = // kotlin.Array<User> | List of user object val body : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try { try {
apiInstance.createUsersWithListInput(body) apiInstance.createUsersWithListInput(body)
} catch (e: ClientException) { } catch (e: ClientException) {
@@ -133,7 +133,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object | **body** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type

View File

@@ -26,25 +26,25 @@ import kotlinx.serialization.*
import kotlinx.serialization.internal.StringDescriptor import kotlinx.serialization.internal.StringDescriptor
class PetApi @UseExperimental(UnstableDefault::class) constructor( class PetApi @UseExperimental(UnstableDefault::class) constructor(
baseUrl: kotlin.String = "http://petstore.swagger.io/v2", baseUrl: kotlin.String = "http://petstore.swagger.io/v2",
httpClientEngine: HttpClientEngine? = null, httpClientEngine: HttpClientEngine? = null,
serializer: KotlinxSerializer) serializer: KotlinxSerializer
: ApiClient(baseUrl, httpClientEngine, serializer) { ) : ApiClient(baseUrl, httpClientEngine, serializer) {
@UseExperimental(UnstableDefault::class) @UseExperimental(UnstableDefault::class)
constructor( constructor(
baseUrl: kotlin.String = "http://petstore.swagger.io/v2", baseUrl: kotlin.String = "http://petstore.swagger.io/v2",
httpClientEngine: HttpClientEngine? = null, httpClientEngine: HttpClientEngine? = null,
jsonConfiguration: JsonConfiguration = JsonConfiguration.Default) jsonConfiguration: JsonConfiguration = JsonConfiguration.Default
: this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) ) : this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration)))
/** /**
* Add a new pet to the store * Add a new pet to the store
* *
* @param body Pet object that needs to be added to the store * @param body Pet object that needs to be added to the store
* @return void * @return void
*/ */
suspend fun addPet(body: Pet) : HttpResponse<Unit> { suspend fun addPet(body: Pet): HttpResponse<Unit> {
val localVariableAuthNames = listOf<String>("petstore_auth") val localVariableAuthNames = listOf<String>("petstore_auth")
@@ -68,16 +68,16 @@ class PetApi @UseExperimental(UnstableDefault::class) constructor(
).wrap() ).wrap()
} }
/** /**
* Deletes a pet * Deletes a pet
* *
* @param petId Pet id to delete * @param petId Pet id to delete
* @param apiKey (optional) * @param apiKey (optional)
* @return void * @return void
*/ */
suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : HttpResponse<Unit> { suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): HttpResponse<Unit> {
val localVariableAuthNames = listOf<String>("petstore_auth") val localVariableAuthNames = listOf<String>("petstore_auth")
@@ -91,7 +91,7 @@ class PetApi @UseExperimental(UnstableDefault::class) constructor(
val localVariableConfig = RequestConfig( val localVariableConfig = RequestConfig(
RequestMethod.DELETE, RequestMethod.DELETE,
"/pet/{petId}".replace("{"+"petId"+"}", "$petId"), "/pet/{petId}".replace("{" + "petId" + "}", "$petId"),
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
@@ -105,13 +105,13 @@ class PetApi @UseExperimental(UnstableDefault::class) constructor(
/** /**
* Finds Pets by status * Finds Pets by status
* Multiple status values can be provided with comma separated strings * Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter * @param status Status values that need to be considered for filter
* @return kotlin.Array<Pet> * @return kotlin.collections.List<Pet>
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
suspend fun findPetsByStatus(status: kotlin.Array<kotlin.String>) : HttpResponse<kotlin.Array<Pet>> { suspend fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>): HttpResponse<kotlin.collections.List<Pet>> {
val localVariableAuthNames = listOf<String>("petstore_auth") val localVariableAuthNames = listOf<String>("petstore_auth")
@@ -134,28 +134,28 @@ class PetApi @UseExperimental(UnstableDefault::class) constructor(
localVariableConfig, localVariableConfig,
localVariableBody, localVariableBody,
localVariableAuthNames localVariableAuthNames
).wrap<FindPetsByStatusResponse>().map { value.toTypedArray() } ).wrap<FindPetsByStatusResponse>().map { value }
} }
@Serializable @Serializable
private class FindPetsByStatusResponse(val value: List<Pet>) { private class FindPetsByStatusResponse(val value: List<Pet>) {
@Serializer(FindPetsByStatusResponse::class) @Serializer(FindPetsByStatusResponse::class)
companion object : KSerializer<FindPetsByStatusResponse> { companion object : KSerializer<FindPetsByStatusResponse> {
private val serializer: KSerializer<List<Pet>> = Pet.serializer().list private val serializer: KSerializer<List<Pet>> = Pet.serializer().list
override val descriptor = StringDescriptor.withName("FindPetsByStatusResponse") override val descriptor = StringDescriptor.withName("FindPetsByStatusResponse")
override fun serialize(encoder: Encoder, obj: FindPetsByStatusResponse) = serializer.serialize(encoder, obj.value) override fun serialize(encoder: Encoder, obj: FindPetsByStatusResponse) = serializer.serialize(encoder, obj.value)
override fun deserialize(decoder: Decoder) = FindPetsByStatusResponse(serializer.deserialize(decoder)) override fun deserialize(decoder: Decoder) = FindPetsByStatusResponse(serializer.deserialize(decoder))
}
} }
}
/** /**
* Finds Pets by tags * Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by * @param tags Tags to filter by
* @return kotlin.Array<Pet> * @return kotlin.collections.List<Pet>
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
suspend fun findPetsByTags(tags: kotlin.Array<kotlin.String>) : HttpResponse<kotlin.Array<Pet>> { suspend fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>): HttpResponse<kotlin.collections.List<Pet>> {
val localVariableAuthNames = listOf<String>("petstore_auth") val localVariableAuthNames = listOf<String>("petstore_auth")
@@ -178,28 +178,28 @@ private class FindPetsByStatusResponse(val value: List<Pet>) {
localVariableConfig, localVariableConfig,
localVariableBody, localVariableBody,
localVariableAuthNames localVariableAuthNames
).wrap<FindPetsByTagsResponse>().map { value.toTypedArray() } ).wrap<FindPetsByTagsResponse>().map { value }
} }
@Serializable @Serializable
private class FindPetsByTagsResponse(val value: List<Pet>) { private class FindPetsByTagsResponse(val value: List<Pet>) {
@Serializer(FindPetsByTagsResponse::class) @Serializer(FindPetsByTagsResponse::class)
companion object : KSerializer<FindPetsByTagsResponse> { companion object : KSerializer<FindPetsByTagsResponse> {
private val serializer: KSerializer<List<Pet>> = Pet.serializer().list private val serializer: KSerializer<List<Pet>> = Pet.serializer().list
override val descriptor = StringDescriptor.withName("FindPetsByTagsResponse") override val descriptor = StringDescriptor.withName("FindPetsByTagsResponse")
override fun serialize(encoder: Encoder, obj: FindPetsByTagsResponse) = serializer.serialize(encoder, obj.value) override fun serialize(encoder: Encoder, obj: FindPetsByTagsResponse) = serializer.serialize(encoder, obj.value)
override fun deserialize(decoder: Decoder) = FindPetsByTagsResponse(serializer.deserialize(decoder)) override fun deserialize(decoder: Decoder) = FindPetsByTagsResponse(serializer.deserialize(decoder))
}
} }
}
/** /**
* Find pet by ID * Find pet by ID
* Returns a single pet * Returns a single pet
* @param petId ID of pet to return * @param petId ID of pet to return
* @return Pet * @return Pet
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
suspend fun getPetById(petId: kotlin.Long) : HttpResponse<Pet> { suspend fun getPetById(petId: kotlin.Long): HttpResponse<Pet> {
val localVariableAuthNames = listOf<String>("api_key") val localVariableAuthNames = listOf<String>("api_key")
@@ -212,7 +212,7 @@ private class FindPetsByTagsResponse(val value: List<Pet>) {
val localVariableConfig = RequestConfig( val localVariableConfig = RequestConfig(
RequestMethod.GET, RequestMethod.GET,
"/pet/{petId}".replace("{"+"petId"+"}", "$petId"), "/pet/{petId}".replace("{" + "petId" + "}", "$petId"),
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
@@ -226,12 +226,12 @@ private class FindPetsByTagsResponse(val value: List<Pet>) {
/** /**
* Update an existing pet * Update an existing pet
* *
* @param body Pet object that needs to be added to the store * @param body Pet object that needs to be added to the store
* @return void * @return void
*/ */
suspend fun updatePet(body: Pet) : HttpResponse<Unit> { suspend fun updatePet(body: Pet): HttpResponse<Unit> {
val localVariableAuthNames = listOf<String>("petstore_auth") val localVariableAuthNames = listOf<String>("petstore_auth")
@@ -255,17 +255,17 @@ private class FindPetsByTagsResponse(val value: List<Pet>) {
).wrap() ).wrap()
} }
/** /**
* Updates a pet in the store with form data * Updates a pet in the store with form data
* *
* @param petId ID of pet that needs to be updated * @param petId ID of pet that needs to be updated
* @param name Updated name of the pet (optional) * @param name Updated name of the pet (optional)
* @param status Updated status of the pet (optional) * @param status Updated status of the pet (optional)
* @return void * @return void
*/ */
suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : HttpResponse<Unit> { suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): HttpResponse<Unit> {
val localVariableAuthNames = listOf<String>("petstore_auth") val localVariableAuthNames = listOf<String>("petstore_auth")
@@ -281,7 +281,7 @@ private class FindPetsByTagsResponse(val value: List<Pet>) {
val localVariableConfig = RequestConfig( val localVariableConfig = RequestConfig(
RequestMethod.POST, RequestMethod.POST,
"/pet/{petId}".replace("{"+"petId"+"}", "$petId"), "/pet/{petId}".replace("{" + "petId" + "}", "$petId"),
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
@@ -295,15 +295,15 @@ private class FindPetsByTagsResponse(val value: List<Pet>) {
/** /**
* uploads an image * uploads an image
* *
* @param petId ID of pet to update * @param petId ID of pet to update
* @param additionalMetadata Additional data to pass to server (optional) * @param additionalMetadata Additional data to pass to server (optional)
* @param file file to upload (optional) * @param file file to upload (optional)
* @return ApiResponse * @return ApiResponse
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: io.ktor.client.request.forms.InputProvider?) : HttpResponse<ApiResponse> { suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: io.ktor.client.request.forms.InputProvider?): HttpResponse<ApiResponse> {
val localVariableAuthNames = listOf<String>("petstore_auth") val localVariableAuthNames = listOf<String>("petstore_auth")
@@ -319,7 +319,7 @@ private class FindPetsByTagsResponse(val value: List<Pet>) {
val localVariableConfig = RequestConfig( val localVariableConfig = RequestConfig(
RequestMethod.POST, RequestMethod.POST,
"/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), "/pet/{petId}/uploadImage".replace("{" + "petId" + "}", "$petId"),
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )

View File

@@ -25,25 +25,25 @@ import kotlinx.serialization.*
import kotlinx.serialization.internal.StringDescriptor import kotlinx.serialization.internal.StringDescriptor
class StoreApi @UseExperimental(UnstableDefault::class) constructor( class StoreApi @UseExperimental(UnstableDefault::class) constructor(
baseUrl: kotlin.String = "http://petstore.swagger.io/v2", baseUrl: kotlin.String = "http://petstore.swagger.io/v2",
httpClientEngine: HttpClientEngine? = null, httpClientEngine: HttpClientEngine? = null,
serializer: KotlinxSerializer) serializer: KotlinxSerializer
: ApiClient(baseUrl, httpClientEngine, serializer) { ) : ApiClient(baseUrl, httpClientEngine, serializer) {
@UseExperimental(UnstableDefault::class) @UseExperimental(UnstableDefault::class)
constructor( constructor(
baseUrl: kotlin.String = "http://petstore.swagger.io/v2", baseUrl: kotlin.String = "http://petstore.swagger.io/v2",
httpClientEngine: HttpClientEngine? = null, httpClientEngine: HttpClientEngine? = null,
jsonConfiguration: JsonConfiguration = JsonConfiguration.Default) jsonConfiguration: JsonConfiguration = JsonConfiguration.Default
: this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) ) : this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration)))
/** /**
* Delete purchase order by ID * Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors * For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @param orderId ID of the order that needs to be deleted * @param orderId ID of the order that needs to be deleted
* @return void * @return void
*/ */
suspend fun deleteOrder(orderId: kotlin.String) : HttpResponse<Unit> { suspend fun deleteOrder(orderId: kotlin.String): HttpResponse<Unit> {
val localVariableAuthNames = listOf<String>() val localVariableAuthNames = listOf<String>()
@@ -56,7 +56,7 @@ class StoreApi @UseExperimental(UnstableDefault::class) constructor(
val localVariableConfig = RequestConfig( val localVariableConfig = RequestConfig(
RequestMethod.DELETE, RequestMethod.DELETE,
"/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), "/store/order/{orderId}".replace("{" + "orderId" + "}", "$orderId"),
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
@@ -70,12 +70,12 @@ class StoreApi @UseExperimental(UnstableDefault::class) constructor(
/** /**
* Returns pet inventories by status * Returns pet inventories by status
* Returns a map of status codes to quantities * Returns a map of status codes to quantities
* @return kotlin.collections.Map<kotlin.String, kotlin.Int> * @return kotlin.collections.Map<kotlin.String, kotlin.Int>
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
suspend fun getInventory() : HttpResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>> { suspend fun getInventory(): HttpResponse<kotlin.collections.Map<kotlin.String, kotlin.Int>> {
val localVariableAuthNames = listOf<String>("api_key") val localVariableAuthNames = listOf<String>("api_key")
@@ -101,24 +101,24 @@ class StoreApi @UseExperimental(UnstableDefault::class) constructor(
} }
@Serializable @Serializable
private class GetInventoryResponse(val value: Map<kotlin.String, kotlin.Int>) { private class GetInventoryResponse(val value: Map<kotlin.String, kotlin.Int>) {
@Serializer(GetInventoryResponse::class) @Serializer(GetInventoryResponse::class)
companion object : KSerializer<GetInventoryResponse> { companion object : KSerializer<GetInventoryResponse> {
private val serializer: KSerializer<Map<kotlin.String, kotlin.Int>> = (kotlin.String.serializer() to kotlin.Int.serializer()).map private val serializer: KSerializer<Map<kotlin.String, kotlin.Int>> = (kotlin.String.serializer() to kotlin.Int.serializer()).map
override val descriptor = StringDescriptor.withName("GetInventoryResponse") override val descriptor = StringDescriptor.withName("GetInventoryResponse")
override fun serialize(encoder: Encoder, obj: GetInventoryResponse) = serializer.serialize(encoder, obj.value) override fun serialize(encoder: Encoder, obj: GetInventoryResponse) = serializer.serialize(encoder, obj.value)
override fun deserialize(decoder: Decoder) = GetInventoryResponse(serializer.deserialize(decoder)) override fun deserialize(decoder: Decoder) = GetInventoryResponse(serializer.deserialize(decoder))
}
} }
}
/** /**
* Find purchase order by ID * Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions * For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param orderId ID of pet that needs to be fetched * @param orderId ID of pet that needs to be fetched
* @return Order * @return Order
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
suspend fun getOrderById(orderId: kotlin.Long) : HttpResponse<Order> { suspend fun getOrderById(orderId: kotlin.Long): HttpResponse<Order> {
val localVariableAuthNames = listOf<String>() val localVariableAuthNames = listOf<String>()
@@ -131,7 +131,7 @@ private class GetInventoryResponse(val value: Map<kotlin.String, kotlin.Int>) {
val localVariableConfig = RequestConfig( val localVariableConfig = RequestConfig(
RequestMethod.GET, RequestMethod.GET,
"/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), "/store/order/{orderId}".replace("{" + "orderId" + "}", "$orderId"),
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
@@ -145,13 +145,13 @@ private class GetInventoryResponse(val value: Map<kotlin.String, kotlin.Int>) {
/** /**
* Place an order for a pet * Place an order for a pet
* *
* @param body order placed for purchasing the pet * @param body order placed for purchasing the pet
* @return Order * @return Order
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
suspend fun placeOrder(body: Order) : HttpResponse<Order> { suspend fun placeOrder(body: Order): HttpResponse<Order> {
val localVariableAuthNames = listOf<String>() val localVariableAuthNames = listOf<String>()
@@ -175,7 +175,7 @@ private class GetInventoryResponse(val value: Map<kotlin.String, kotlin.Int>) {
).wrap() ).wrap()
} }
companion object { companion object {

View File

@@ -25,25 +25,25 @@ import kotlinx.serialization.*
import kotlinx.serialization.internal.StringDescriptor import kotlinx.serialization.internal.StringDescriptor
class UserApi @UseExperimental(UnstableDefault::class) constructor( class UserApi @UseExperimental(UnstableDefault::class) constructor(
baseUrl: kotlin.String = "http://petstore.swagger.io/v2", baseUrl: kotlin.String = "http://petstore.swagger.io/v2",
httpClientEngine: HttpClientEngine? = null, httpClientEngine: HttpClientEngine? = null,
serializer: KotlinxSerializer) serializer: KotlinxSerializer
: ApiClient(baseUrl, httpClientEngine, serializer) { ) : ApiClient(baseUrl, httpClientEngine, serializer) {
@UseExperimental(UnstableDefault::class) @UseExperimental(UnstableDefault::class)
constructor( constructor(
baseUrl: kotlin.String = "http://petstore.swagger.io/v2", baseUrl: kotlin.String = "http://petstore.swagger.io/v2",
httpClientEngine: HttpClientEngine? = null, httpClientEngine: HttpClientEngine? = null,
jsonConfiguration: JsonConfiguration = JsonConfiguration.Default) jsonConfiguration: JsonConfiguration = JsonConfiguration.Default
: this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration))) ) : this(baseUrl, httpClientEngine, KotlinxSerializer(Json(jsonConfiguration)))
/** /**
* Create user * Create user
* This can only be done by the logged in user. * This can only be done by the logged in user.
* @param body Created user object * @param body Created user object
* @return void * @return void
*/ */
suspend fun createUser(body: User) : HttpResponse<Unit> { suspend fun createUser(body: User): HttpResponse<Unit> {
val localVariableAuthNames = listOf<String>() val localVariableAuthNames = listOf<String>()
@@ -67,19 +67,19 @@ class UserApi @UseExperimental(UnstableDefault::class) constructor(
).wrap() ).wrap()
} }
/** /**
* Creates list of users with given input array * Creates list of users with given input array
* *
* @param body List of user object * @param body List of user object
* @return void * @return void
*/ */
suspend fun createUsersWithArrayInput(body: kotlin.Array<User>) : HttpResponse<Unit> { suspend fun createUsersWithArrayInput(body: kotlin.collections.List<User>): HttpResponse<Unit> {
val localVariableAuthNames = listOf<String>() val localVariableAuthNames = listOf<String>()
val localVariableBody = CreateUsersWithArrayInputRequest(body.asList()) val localVariableBody = CreateUsersWithArrayInputRequest(body)
val localVariableQuery = mutableMapOf<String, List<String>>() val localVariableQuery = mutableMapOf<String, List<String>>()
@@ -100,27 +100,27 @@ class UserApi @UseExperimental(UnstableDefault::class) constructor(
} }
@Serializable @Serializable
private class CreateUsersWithArrayInputRequest(val value: List<User>) { private class CreateUsersWithArrayInputRequest(val value: List<User>) {
@Serializer(CreateUsersWithArrayInputRequest::class) @Serializer(CreateUsersWithArrayInputRequest::class)
companion object : KSerializer<CreateUsersWithArrayInputRequest> { companion object : KSerializer<CreateUsersWithArrayInputRequest> {
private val serializer: KSerializer<List<User>> = User.serializer().list private val serializer: KSerializer<List<User>> = User.serializer().list
override val descriptor = StringDescriptor.withName("CreateUsersWithArrayInputRequest") override val descriptor = StringDescriptor.withName("CreateUsersWithArrayInputRequest")
override fun serialize(encoder: Encoder, obj: CreateUsersWithArrayInputRequest) = serializer.serialize(encoder, obj.value) override fun serialize(encoder: Encoder, obj: CreateUsersWithArrayInputRequest) = serializer.serialize(encoder, obj.value)
override fun deserialize(decoder: Decoder) = CreateUsersWithArrayInputRequest(serializer.deserialize(decoder)) override fun deserialize(decoder: Decoder) = CreateUsersWithArrayInputRequest(serializer.deserialize(decoder))
}
} }
}
/** /**
* Creates list of users with given input array * Creates list of users with given input array
* *
* @param body List of user object * @param body List of user object
* @return void * @return void
*/ */
suspend fun createUsersWithListInput(body: kotlin.Array<User>) : HttpResponse<Unit> { suspend fun createUsersWithListInput(body: kotlin.collections.List<User>): HttpResponse<Unit> {
val localVariableAuthNames = listOf<String>() val localVariableAuthNames = listOf<String>()
val localVariableBody = CreateUsersWithListInputRequest(body.asList()) val localVariableBody = CreateUsersWithListInputRequest(body)
val localVariableQuery = mutableMapOf<String, List<String>>() val localVariableQuery = mutableMapOf<String, List<String>>()
@@ -141,23 +141,23 @@ private class CreateUsersWithArrayInputRequest(val value: List<User>) {
} }
@Serializable @Serializable
private class CreateUsersWithListInputRequest(val value: List<User>) { private class CreateUsersWithListInputRequest(val value: List<User>) {
@Serializer(CreateUsersWithListInputRequest::class) @Serializer(CreateUsersWithListInputRequest::class)
companion object : KSerializer<CreateUsersWithListInputRequest> { companion object : KSerializer<CreateUsersWithListInputRequest> {
private val serializer: KSerializer<List<User>> = User.serializer().list private val serializer: KSerializer<List<User>> = User.serializer().list
override val descriptor = StringDescriptor.withName("CreateUsersWithListInputRequest") override val descriptor = StringDescriptor.withName("CreateUsersWithListInputRequest")
override fun serialize(encoder: Encoder, obj: CreateUsersWithListInputRequest) = serializer.serialize(encoder, obj.value) override fun serialize(encoder: Encoder, obj: CreateUsersWithListInputRequest) = serializer.serialize(encoder, obj.value)
override fun deserialize(decoder: Decoder) = CreateUsersWithListInputRequest(serializer.deserialize(decoder)) override fun deserialize(decoder: Decoder) = CreateUsersWithListInputRequest(serializer.deserialize(decoder))
}
} }
}
/** /**
* Delete user * Delete user
* This can only be done by the logged in user. * This can only be done by the logged in user.
* @param username The name that needs to be deleted * @param username The name that needs to be deleted
* @return void * @return void
*/ */
suspend fun deleteUser(username: kotlin.String) : HttpResponse<Unit> { suspend fun deleteUser(username: kotlin.String): HttpResponse<Unit> {
val localVariableAuthNames = listOf<String>() val localVariableAuthNames = listOf<String>()
@@ -170,7 +170,7 @@ private class CreateUsersWithListInputRequest(val value: List<User>) {
val localVariableConfig = RequestConfig( val localVariableConfig = RequestConfig(
RequestMethod.DELETE, RequestMethod.DELETE,
"/user/{username}".replace("{"+"username"+"}", "$username"), "/user/{username}".replace("{" + "username" + "}", "$username"),
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
@@ -184,13 +184,13 @@ private class CreateUsersWithListInputRequest(val value: List<User>) {
/** /**
* Get user by user name * Get user by user name
* *
* @param username The name that needs to be fetched. Use user1 for testing. * @param username The name that needs to be fetched. Use user1 for testing.
* @return User * @return User
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
suspend fun getUserByName(username: kotlin.String) : HttpResponse<User> { suspend fun getUserByName(username: kotlin.String): HttpResponse<User> {
val localVariableAuthNames = listOf<String>() val localVariableAuthNames = listOf<String>()
@@ -203,7 +203,7 @@ private class CreateUsersWithListInputRequest(val value: List<User>) {
val localVariableConfig = RequestConfig( val localVariableConfig = RequestConfig(
RequestMethod.GET, RequestMethod.GET,
"/user/{username}".replace("{"+"username"+"}", "$username"), "/user/{username}".replace("{" + "username" + "}", "$username"),
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
@@ -217,14 +217,14 @@ private class CreateUsersWithListInputRequest(val value: List<User>) {
/** /**
* Logs user into the system * Logs user into the system
* *
* @param username The user name for login * @param username The user name for login
* @param password The password for login in clear text * @param password The password for login in clear text
* @return kotlin.String * @return kotlin.String
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
suspend fun loginUser(username: kotlin.String, password: kotlin.String) : HttpResponse<kotlin.String> { suspend fun loginUser(username: kotlin.String, password: kotlin.String): HttpResponse<kotlin.String> {
val localVariableAuthNames = listOf<String>() val localVariableAuthNames = listOf<String>()
@@ -253,11 +253,11 @@ private class CreateUsersWithListInputRequest(val value: List<User>) {
/** /**
* Logs out current logged in user session * Logs out current logged in user session
* *
* @return void * @return void
*/ */
suspend fun logoutUser() : HttpResponse<Unit> { suspend fun logoutUser(): HttpResponse<Unit> {
val localVariableAuthNames = listOf<String>() val localVariableAuthNames = listOf<String>()
@@ -284,13 +284,13 @@ private class CreateUsersWithListInputRequest(val value: List<User>) {
/** /**
* Updated user * Updated user
* This can only be done by the logged in user. * This can only be done by the logged in user.
* @param username name that need to be deleted * @param username name that need to be deleted
* @param body Updated user object * @param body Updated user object
* @return void * @return void
*/ */
suspend fun updateUser(username: kotlin.String, body: User) : HttpResponse<Unit> { suspend fun updateUser(username: kotlin.String, body: User): HttpResponse<Unit> {
val localVariableAuthNames = listOf<String>() val localVariableAuthNames = listOf<String>()
@@ -302,7 +302,7 @@ private class CreateUsersWithListInputRequest(val value: List<User>) {
val localVariableConfig = RequestConfig( val localVariableConfig = RequestConfig(
RequestMethod.PUT, RequestMethod.PUT,
"/user/{username}".replace("{"+"username"+"}", "$username"), "/user/{username}".replace("{" + "username" + "}", "$username"),
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
@@ -314,7 +314,7 @@ private class CreateUsersWithListInputRequest(val value: List<User>) {
).wrap() ).wrap()
} }
companion object { companion object {

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.CommonEnumSerializer import kotlinx.serialization.internal.CommonEnumSerializer
/** /**
* Describes the result of uploading an image resource * Describes the result of uploading an image resource
* @param code * @param code

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.CommonEnumSerializer import kotlinx.serialization.internal.CommonEnumSerializer
/** /**
* A category for a pet * A category for a pet
* @param id * @param id

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.CommonEnumSerializer import kotlinx.serialization.internal.CommonEnumSerializer
/** /**
* An order for a pets from the pet store * An order for a pets from the pet store
* @param id * @param id

View File

@@ -16,6 +16,7 @@ import org.openapitools.client.models.Tag
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.CommonEnumSerializer import kotlinx.serialization.internal.CommonEnumSerializer
/** /**
* A pet for sale in the pet store * A pet for sale in the pet store
* @param name * @param name
@@ -28,10 +29,10 @@ import kotlinx.serialization.internal.CommonEnumSerializer
@Serializable @Serializable
data class Pet ( data class Pet (
@SerialName(value = "name") @Required val name: kotlin.String, @SerialName(value = "name") @Required val name: kotlin.String,
@SerialName(value = "photoUrls") @Required val photoUrls: kotlin.Array<kotlin.String>, @SerialName(value = "photoUrls") @Required val photoUrls: kotlin.collections.List<kotlin.String>,
@SerialName(value = "id") val id: kotlin.Long? = null, @SerialName(value = "id") val id: kotlin.Long? = null,
@SerialName(value = "category") val category: Category? = null, @SerialName(value = "category") val category: Category? = null,
@SerialName(value = "tags") val tags: kotlin.Array<Tag>? = null, @SerialName(value = "tags") val tags: kotlin.collections.List<Tag>? = null,
/* pet status in the store */ /* pet status in the store */
@SerialName(value = "status") val status: Pet.Status? = null @SerialName(value = "status") val status: Pet.Status? = null
) { ) {

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.CommonEnumSerializer import kotlinx.serialization.internal.CommonEnumSerializer
/** /**
* A tag for a pet * A tag for a pet
* @param id * @param id

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import kotlinx.serialization.* import kotlinx.serialization.*
import kotlinx.serialization.internal.CommonEnumSerializer import kotlinx.serialization.internal.CommonEnumSerializer
/** /**
* A User who is purchasing from the pet store * A User who is purchasing from the pet store
* @param id * @param id

View File

@@ -5,10 +5,10 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**name** | **kotlin.String** | | **name** | **kotlin.String** | |
**photoUrls** | **kotlin.Array&lt;kotlin.String&gt;** | | **photoUrls** | **kotlin.collections.List&lt;kotlin.String&gt;** | |
**id** | **kotlin.Long** | | [optional] **id** | **kotlin.Long** | | [optional]
**category** | [**Category**](Category.md) | | [optional] **category** | [**Category**](Category.md) | | [optional]
**tags** | [**kotlin.Array&lt;Tag&gt;**](Tag.md) | | [optional] **tags** | [**kotlin.collections.List&lt;Tag&gt;**](Tag.md) | | [optional]
**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] **status** | [**inline**](#StatusEnum) | pet status in the store | [optional]

View File

@@ -110,7 +110,7 @@ Configure petstore_auth:
<a name="findPetsByStatus"></a> <a name="findPetsByStatus"></a>
# **findPetsByStatus** # **findPetsByStatus**
> kotlin.Array&lt;Pet&gt; findPetsByStatus(status) > kotlin.collections.List&lt;Pet&gt; findPetsByStatus(status)
Finds Pets by status Finds Pets by status
@@ -123,9 +123,9 @@ Multiple status values can be provided with comma separated strings
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val status : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Status values that need to be considered for filter val status : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Status values that need to be considered for filter
try { try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByStatus(status) val result : kotlin.collections.List<Pet> = apiInstance.findPetsByStatus(status)
println(result) println(result)
} catch (e: ClientException) { } catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByStatus") println("4xx response calling PetApi#findPetsByStatus")
@@ -140,11 +140,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**status** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] **status** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type ### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md) [**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization ### Authorization
@@ -159,7 +159,7 @@ Configure petstore_auth:
<a name="findPetsByTags"></a> <a name="findPetsByTags"></a>
# **findPetsByTags** # **findPetsByTags**
> kotlin.Array&lt;Pet&gt; findPetsByTags(tags) > kotlin.collections.List&lt;Pet&gt; findPetsByTags(tags)
Finds Pets by tags Finds Pets by tags
@@ -172,9 +172,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val tags : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Tags to filter by val tags : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Tags to filter by
try { try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByTags(tags) val result : kotlin.collections.List<Pet> = apiInstance.findPetsByTags(tags)
println(result) println(result)
} catch (e: ClientException) { } catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByTags") println("4xx response calling PetApi#findPetsByTags")
@@ -189,11 +189,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**tags** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by | **tags** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
### Return type ### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md) [**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization ### Authorization

View File

@@ -73,7 +73,7 @@ Creates list of users with given input array
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val body : kotlin.Array<User> = // kotlin.Array<User> | List of user object val body : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try { try {
apiInstance.createUsersWithArrayInput(body) apiInstance.createUsersWithArrayInput(body)
} catch (e: ClientException) { } catch (e: ClientException) {
@@ -89,7 +89,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object | **body** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type
@@ -117,7 +117,7 @@ Creates list of users with given input array
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val body : kotlin.Array<User> = // kotlin.Array<User> | List of user object val body : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try { try {
apiInstance.createUsersWithListInput(body) apiInstance.createUsersWithListInput(body)
} catch (e: ClientException) { } catch (e: ClientException) {
@@ -133,7 +133,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object | **body** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type

View File

@@ -119,14 +119,14 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
* Finds Pets by status * Finds Pets by status
* Multiple status values can be provided with comma separated strings * Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter * @param status Status values that need to be considered for filter
* @return kotlin.Array<Pet> * @return kotlin.collections.List<Pet>
* @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response * @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatus(status: kotlin.Array<kotlin.String>) : kotlin.Array<Pet> { fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableBody: kotlin.Any? = null val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>() val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply { .apply {
@@ -139,13 +139,13 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
val localVarResponse = request<kotlin.Array<Pet>>( val localVarResponse = request<kotlin.collections.List<Pet>>(
localVariableConfig, localVariableConfig,
localVariableBody localVariableBody
) )
return when (localVarResponse.responseType) { return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet> ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> { ResponseType.ClientError -> {
@@ -163,7 +163,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
* Finds Pets by tags * Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by * @param tags Tags to filter by
* @return kotlin.Array<Pet> * @return kotlin.collections.List<Pet>
* @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response * @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
@@ -171,7 +171,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.") @Deprecated(message = "This operation is deprecated.")
fun findPetsByTags(tags: kotlin.Array<kotlin.String>) : kotlin.Array<Pet> { fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
val localVariableBody: kotlin.Any? = null val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>() val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply { .apply {
@@ -184,13 +184,13 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
val localVarResponse = request<kotlin.Array<Pet>>( val localVarResponse = request<kotlin.collections.List<Pet>>(
localVariableConfig, localVariableConfig,
localVariableBody localVariableBody
) )
return when (localVarResponse.responseType) { return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet> ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> { ResponseType.ClientError -> {

View File

@@ -83,7 +83,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInput(body: kotlin.Array<User>) : Unit { fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableBody: kotlin.Any? = body val localVariableBody: kotlin.Any? = body
val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
@@ -123,7 +123,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInput(body: kotlin.Array<User>) : Unit { fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableBody: kotlin.Any? = body val localVariableBody: kotlin.Any? = body
val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
/** /**
* Describes the result of uploading an image resource * Describes the result of uploading an image resource
* @param code * @param code

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
/** /**
* A category for a pet * A category for a pet
* @param id * @param id

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
/** /**
* An order for a pets from the pet store * An order for a pets from the pet store
* @param id * @param id

View File

@@ -15,6 +15,7 @@ import org.openapitools.client.models.Category
import org.openapitools.client.models.Tag import org.openapitools.client.models.Tag
import com.squareup.moshi.Json import com.squareup.moshi.Json
/** /**
* A pet for sale in the pet store * A pet for sale in the pet store
* @param name * @param name
@@ -29,13 +30,13 @@ internal data class Pet (
@Json(name = "name") @Json(name = "name")
val name: kotlin.String, val name: kotlin.String,
@Json(name = "photoUrls") @Json(name = "photoUrls")
val photoUrls: kotlin.Array<kotlin.String>, val photoUrls: kotlin.collections.List<kotlin.String>,
@Json(name = "id") @Json(name = "id")
val id: kotlin.Long? = null, val id: kotlin.Long? = null,
@Json(name = "category") @Json(name = "category")
val category: Category? = null, val category: Category? = null,
@Json(name = "tags") @Json(name = "tags")
val tags: kotlin.Array<Tag>? = null, val tags: kotlin.collections.List<Tag>? = null,
/* pet status in the store */ /* pet status in the store */
@Json(name = "status") @Json(name = "status")
val status: Pet.Status? = null val status: Pet.Status? = null

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
/** /**
* A tag for a pet * A tag for a pet
* @param id * @param id

View File

@@ -13,6 +13,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
/** /**
* A User who is purchasing from the pet store * A User who is purchasing from the pet store
* @param id * @param id

View File

@@ -5,10 +5,10 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**name** | **kotlin.String** | | **name** | **kotlin.String** | |
**photoUrls** | **kotlin.Array&lt;kotlin.String&gt;** | | **photoUrls** | **kotlin.collections.List&lt;kotlin.String&gt;** | |
**id** | **kotlin.Long** | | [optional] **id** | **kotlin.Long** | | [optional]
**category** | [**Category**](Category.md) | | [optional] **category** | [**Category**](Category.md) | | [optional]
**tags** | [**kotlin.Array&lt;Tag&gt;**](Tag.md) | | [optional] **tags** | [**kotlin.collections.List&lt;Tag&gt;**](Tag.md) | | [optional]
**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] **status** | [**inline**](#StatusEnum) | pet status in the store | [optional]

View File

@@ -110,7 +110,7 @@ Configure petstore_auth:
<a name="findPetsByStatus"></a> <a name="findPetsByStatus"></a>
# **findPetsByStatus** # **findPetsByStatus**
> kotlin.Array&lt;Pet&gt; findPetsByStatus(status) > kotlin.collections.List&lt;Pet&gt; findPetsByStatus(status)
Finds Pets by status Finds Pets by status
@@ -123,9 +123,9 @@ Multiple status values can be provided with comma separated strings
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val status : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Status values that need to be considered for filter val status : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Status values that need to be considered for filter
try { try {
val result : kotlin.Array<Pet>? = apiInstance.findPetsByStatus(status) val result : kotlin.collections.List<Pet>? = apiInstance.findPetsByStatus(status)
println(result) println(result)
} catch (e: ClientException) { } catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByStatus") println("4xx response calling PetApi#findPetsByStatus")
@@ -140,11 +140,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**status** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] **status** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type ### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md) [**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization ### Authorization
@@ -159,7 +159,7 @@ Configure petstore_auth:
<a name="findPetsByTags"></a> <a name="findPetsByTags"></a>
# **findPetsByTags** # **findPetsByTags**
> kotlin.Array&lt;Pet&gt; findPetsByTags(tags) > kotlin.collections.List&lt;Pet&gt; findPetsByTags(tags)
Finds Pets by tags Finds Pets by tags
@@ -172,9 +172,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val tags : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Tags to filter by val tags : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Tags to filter by
try { try {
val result : kotlin.Array<Pet>? = apiInstance.findPetsByTags(tags) val result : kotlin.collections.List<Pet>? = apiInstance.findPetsByTags(tags)
println(result) println(result)
} catch (e: ClientException) { } catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByTags") println("4xx response calling PetApi#findPetsByTags")
@@ -189,11 +189,11 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**tags** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by | **tags** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
### Return type ### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md) [**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization ### Authorization

View File

@@ -73,7 +73,7 @@ Creates list of users with given input array
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val body : kotlin.Array<User> = // kotlin.Array<User> | List of user object val body : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try { try {
apiInstance.createUsersWithArrayInput(body) apiInstance.createUsersWithArrayInput(body)
} catch (e: ClientException) { } catch (e: ClientException) {
@@ -89,7 +89,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object | **body** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type
@@ -117,7 +117,7 @@ Creates list of users with given input array
//import org.openapitools.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val body : kotlin.Array<User> = // kotlin.Array<User> | List of user object val body : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try { try {
apiInstance.createUsersWithListInput(body) apiInstance.createUsersWithListInput(body)
} catch (e: ClientException) { } catch (e: ClientException) {
@@ -133,7 +133,7 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**body** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object | **body** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type ### Return type

View File

@@ -119,14 +119,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* Finds Pets by status * Finds Pets by status
* Multiple status values can be provided with comma separated strings * Multiple status values can be provided with comma separated strings
* @param status Status values that need to be considered for filter * @param status Status values that need to be considered for filter
* @return kotlin.Array<Pet> or null * @return kotlin.collections.List<Pet> or null
* @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response * @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun findPetsByStatus(status: kotlin.Array<kotlin.String>) : kotlin.Array<Pet>? { fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet>? {
val localVariableBody: kotlin.Any? = null val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>() val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply { .apply {
@@ -139,13 +139,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
val localVarResponse = request<kotlin.Array<Pet>>( val localVarResponse = request<kotlin.collections.List<Pet>>(
localVariableConfig, localVariableConfig,
localVariableBody localVariableBody
) )
return when (localVarResponse.responseType) { return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>? ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>?
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> { ResponseType.ClientError -> {
@@ -163,7 +163,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* Finds Pets by tags * Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param tags Tags to filter by * @param tags Tags to filter by
* @return kotlin.Array<Pet> or null * @return kotlin.collections.List<Pet> or null
* @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws UnsupportedOperationException If the API returns an informational or redirection response
* @throws ClientException If the API returns a client error response * @throws ClientException If the API returns a client error response
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
@@ -171,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
@Deprecated(message = "This operation is deprecated.") @Deprecated(message = "This operation is deprecated.")
fun findPetsByTags(tags: kotlin.Array<kotlin.String>) : kotlin.Array<Pet>? { fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet>? {
val localVariableBody: kotlin.Any? = null val localVariableBody: kotlin.Any? = null
val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>() val localVariableQuery: MultiValueMap = mutableMapOf<kotlin.String, List<kotlin.String>>()
.apply { .apply {
@@ -184,13 +184,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
query = localVariableQuery, query = localVariableQuery,
headers = localVariableHeaders headers = localVariableHeaders
) )
val localVarResponse = request<kotlin.Array<Pet>>( val localVarResponse = request<kotlin.collections.List<Pet>>(
localVariableConfig, localVariableConfig,
localVariableBody localVariableBody
) )
return when (localVarResponse.responseType) { return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array<Pet>? ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List<Pet>?
ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
ResponseType.ClientError -> { ResponseType.ClientError -> {

View File

@@ -83,7 +83,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithArrayInput(body: kotlin.Array<User>) : Unit { fun createUsersWithArrayInput(body: kotlin.collections.List<User>) : Unit {
val localVariableBody: kotlin.Any? = body val localVariableBody: kotlin.Any? = body
val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
@@ -123,7 +123,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
* @throws ServerException If the API returns a server error response * @throws ServerException If the API returns a server error response
*/ */
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
fun createUsersWithListInput(body: kotlin.Array<User>) : Unit { fun createUsersWithListInput(body: kotlin.collections.List<User>) : Unit {
val localVariableBody: kotlin.Any? = body val localVariableBody: kotlin.Any? = body
val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap<String, String> = mutableMapOf() val localVariableHeaders: MutableMap<String, String> = mutableMapOf()

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
import java.io.Serializable import java.io.Serializable
/** /**
* Describes the result of uploading an image resource * Describes the result of uploading an image resource
* @param code * @param code

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
import java.io.Serializable import java.io.Serializable
/** /**
* A category for a pet * A category for a pet
* @param id * @param id

View File

@@ -14,6 +14,7 @@ package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json
import java.io.Serializable import java.io.Serializable
/** /**
* An order for a pets from the pet store * An order for a pets from the pet store
* @param id * @param id

Some files were not shown because too many files have changed in this diff Show More