[Kotlin][Client] Added supporting Retrofit2(RxJava/RxJava2/Coroutines) (#5750)

* Added support Retrofit2(RxJava/RxJava2/Coroutines) to Kotlin client code generator

* Added generated samples for Retrofit2(RxJava/RxJava2/Coroutines) on Kotlin

* Fixed generating retrofit2 without Rx/Coroutines

* Fixed MultipartBody template, remove redundant space after MultipartBody.Part annotation

* Fix documentation diff.

* Fix generating build.gradle file for samples.
Add dependencies for rxJava/rxJava2 and rx retrofit's adapter.

* Update generated sample with rx dependencies

* Update generated sample with coroutines

* Update generated sample with RxJava 2 dependencies

* Update and refactoring scripts for sample generation

* Update generated sample code

* revert changes by mistake

* revert changes by mistake #2

* Fix return type for first RxJava

* Add RxJavaCallAdapterFactory to ApiClient scheme for RxJava 1/2

* Fix script loggin

* Update generated code for RxJava 1/2

* Fix kotlin.md documentation by script export_docs_generators.sh

* Update Kotlin samples project in pom.xml

* Revert "Update Kotlin samples project in pom.xml"

This reverts commit 9de4d0ba

* Fixed "" wrapping number types for annotation value
Fixed generating polymorphic interfaces for Gson, interface fields can't be marked with @SerializedName annotation, it's enough to mark it in child model.
Fixed instantiationTypes(array, list, map) for Kotlin generator

* Update Kotlin samples project after last fixes

* Update Kotlin samples project for kotlin-jvm-*

* Update Kotlin readme.md documentations

* Update Kotlin client sample changes

* Fixed encoding braces for generics model

* Update Kotlin client sample changes

* Update Kotlin client sample after merge with master

* Fixed adding empty braces for inherit from Map/Array

* Update sample model after last fix with empty braces

* Revert adding @SerializedName to Kotlin interface fields through @get:SerializedName as for Jackson

* Update Kotlin client samples with adding @get:SerializedName
This commit is contained in:
Nikita Karnaukh 2020-05-18 11:26:27 +03:00 committed by GitHub
parent d1e8d632ef
commit eefcd62d5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
529 changed files with 17828 additions and 725 deletions

View File

@ -0,0 +1,10 @@
#!/bin/sh
./bin/openapi3/kotlin-client-petstore.sh
./bin/openapi3/kotlin-client-petstore-multiplatform.sh
./bin/openapi3/kotlin-client-petstore-nullable-required.sh
./bin/openapi3/kotlin-client-petstore-retrofit2-coroutines.sh
./bin/openapi3/kotlin-client-petstore-retrofit2-rx.sh
./bin/openapi3/kotlin-client-petstore-retrofit2-rx2.sh

View File

@ -25,11 +25,13 @@ then
mvn clean package
fi
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-client-petstore-multiplatform --library multiplatform -o samples/openapi3/client/petstore/kotlin-multiplatform $@"
samplePath="samples/openapi3/client/petstore/kotlin-multiplatform"
echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin-multiplatform"
rm -rf samples/openapi3/client/petstore/kotlin-multiplatform
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-client-petstore-multiplatform --library multiplatform -o $samplePath $@"
echo "Cleaning previously generated files if any from $samplePath"
rm -rf $samplePath
echo "Generating Kotling client..."
java $JAVA_OPTS -jar $executable $ags

View File

@ -25,11 +25,13 @@ then
mvn clean package
fi
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-nullable-required.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-nullable-required --additional-properties allowRequiredAsNullable=true -o samples/openapi3/client/petstore/kotlin-nullable-required $@"
samplePath="samples/openapi3/client/petstore/kotlin-nullable-required"
echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin-nullable-required"
rm -rf samples/openapi3/client/petstore/kotlin-nullable-required
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-nullable-required.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-nullable-required --additional-properties allowRequiredAsNullable=true -o $samplePath $@"
echo "Cleaning previously generated files if any from $samplePath"
rm -rf $samplePath
echo "Generating Kotling client..."
java $JAVA_OPTS -jar $executable $ags

View File

@ -0,0 +1,37 @@
#!/bin/sh
SCRIPT="$0"
echo "# START SCRIPT: $SCRIPT"
while [ -h "$SCRIPT" ] ; do
ls=$(ls -ld "$SCRIPT")
link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=$(dirname "$SCRIPT")/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=$(dirname "$SCRIPT")/..
APP_DIR=$(cd "${APP_DIR}"; pwd)
fi
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
samplePath="samples/openapi3/client/petstore/kotlin-jvm-retrofit2-coroutines"
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-coroutines-client --library jvm-retrofit2 --additional-properties serializationLibrary=gson,dateLibrary=java8,serializableModel=true,useCoroutines=true -o $samplePath $@"
echo "Cleaning previously generated files if any from $samplePath"
rm -rf $samplePath
echo "Generating Kotling client..."
java $JAVA_OPTS -jar $executable $ags

View File

@ -0,0 +1,37 @@
#!/bin/sh
SCRIPT="$0"
echo "# START SCRIPT: $SCRIPT"
while [ -h "$SCRIPT" ] ; do
ls=$(ls -ld "$SCRIPT")
link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=$(dirname "$SCRIPT")/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=$(dirname "$SCRIPT")/..
APP_DIR=$(cd "${APP_DIR}"; pwd)
fi
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
samplePath="samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx"
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-rx-client --library jvm-retrofit2 --additional-properties serializationLibrary=gson,dateLibrary=java8,serializableModel=true,useRxJava=true -o $samplePath $@"
echo "Cleaning previously generated files if any from $samplePath"
rm -rf $samplePath
echo "Generating Kotling client..."
java $JAVA_OPTS -jar $executable $ags

View File

@ -0,0 +1,37 @@
#!/bin/sh
SCRIPT="$0"
echo "# START SCRIPT: $SCRIPT"
while [ -h "$SCRIPT" ] ; do
ls=$(ls -ld "$SCRIPT")
link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=$(dirname "$SCRIPT")/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=$(dirname "$SCRIPT")/..
APP_DIR=$(cd "${APP_DIR}"; pwd)
fi
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
samplePath="samples/openapi3/client/petstore/kotlin-jvm-retrofit2-rx2"
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-rx2-client --library jvm-retrofit2 --additional-properties serializationLibrary=gson,dateLibrary=java8,serializableModel=true,useRxJava2=true -o $samplePath $@"
echo "Cleaning previously generated files if any from $samplePath"
rm -rf $samplePath
echo "Generating Kotling client..."
java $JAVA_OPTS -jar $executable $ags

View File

@ -25,11 +25,13 @@ then
mvn clean package
fi
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8,serializableModel=true -o samples/openapi3/client/petstore/kotlin $@"
samplePath="samples/openapi3/client/petstore/kotlin"
echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin"
rm -rf samples/openapi3/client/petstore/kotlin
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8,serializableModel=true -o $samplePath $@"
echo "Cleaning previously generated files if any from $samplePath"
rm -rf $samplePath
echo "Generating Kotling client..."
java $JAVA_OPTS -jar $executable $ags

View File

@ -45,9 +45,9 @@ sidebar_label: kotlin-server
| Type/Alias | Instantiated By |
| ---------- | --------------- |
|array|kotlin.arrayOf|
|list|kotlin.arrayOf|
|map|kotlin.mapOf|
|array|kotlin.Array|
|list|kotlin.collections.ArrayList|
|map|kotlin.collections.HashMap|
## LANGUAGE PRIMITIVES

View File

@ -54,9 +54,9 @@ sidebar_label: kotlin-spring
| Type/Alias | Instantiated By |
| ---------- | --------------- |
|array|kotlin.arrayOf|
|list|kotlin.arrayOf|
|map|kotlin.mapOf|
|array|kotlin.Array|
|list|kotlin.collections.ArrayList|
|map|kotlin.collections.HashMap|
## LANGUAGE PRIMITIVES

View File

@ -39,9 +39,9 @@ sidebar_label: kotlin-vertx
| Type/Alias | Instantiated By |
| ---------- | --------------- |
|array|kotlin.arrayOf|
|list|kotlin.arrayOf|
|map|kotlin.mapOf|
|array|kotlin.Array|
|list|kotlin.collections.ArrayList|
|map|kotlin.collections.HashMap|
## LANGUAGE PRIMITIVES

View File

@ -22,6 +22,9 @@ sidebar_label: kotlin
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |null|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |null|
|sourceFolder|source folder for generated code| |src/main/kotlin|
|useCoroutines|Whether to use the Coroutines adapter with the retrofit2 library.| |false|
|useRxJava|Whether to use the RxJava adapter with the retrofit2 library.| |false|
|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library.| |false|
## IMPORT MAPPING
@ -43,9 +46,9 @@ sidebar_label: kotlin
| Type/Alias | Instantiated By |
| ---------- | --------------- |
|array|kotlin.arrayOf|
|list|kotlin.arrayOf|
|map|kotlin.mapOf|
|array|kotlin.Array|
|list|kotlin.collections.ArrayList|
|map|kotlin.collections.HashMap|
## LANGUAGE PRIMITIVES

View File

@ -162,9 +162,9 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
typeMapping.put("Date", "java.time.LocalDate");
typeMapping.put("DateTime", "java.time.LocalDateTime");
instantiationTypes.put("array", "kotlin.arrayOf");
instantiationTypes.put("list", "kotlin.arrayOf");
instantiationTypes.put("map", "kotlin.mapOf");
instantiationTypes.put("array", "kotlin.Array");
instantiationTypes.put("list", "kotlin.collections.ArrayList");
instantiationTypes.put("map", "kotlin.collections.HashMap");
importMapping = new HashMap<String, String>();
importMapping.put("BigDecimal", "java.math.BigDecimal");

View File

@ -26,17 +26,20 @@ import org.openapitools.codegen.CodegenProperty;
import org.openapitools.codegen.CodegenType;
import org.openapitools.codegen.SupportingFile;
import org.openapitools.codegen.meta.features.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class KotlinClientCodegen extends AbstractKotlinCodegen {
private static final Logger LOGGER = LoggerFactory.getLogger(KotlinClientCodegen.class);
protected static final String JVM = "jvm";
protected static final String JVM_OKHTTP = "jvm-okhttp";
protected static final String JVM_OKHTTP4 = "jvm-okhttp4";
@ -44,6 +47,11 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
protected static final String JVM_RETROFIT2 = "jvm-retrofit2";
protected static final String MULTIPLATFORM = "multiplatform";
public static final String USE_RX_JAVA = "useRxJava";
public static final String USE_RX_JAVA2 = "useRxJava2";
public static final String USE_COROUTINES = "useCoroutines";
public static final String DO_NOT_USE_RX_AND_COROUTINES = "doNotUseRxAndCoroutines";
public static final String DATE_LIBRARY = "dateLibrary";
public static final String REQUEST_DATE_CONVERTER = "requestDateConverter";
public static final String COLLECTION_TYPE = "collectionType";
@ -53,6 +61,12 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
protected String dateLibrary = DateLibrary.JAVA8.value;
protected String requestDateConverter = RequestDateConverter.TO_JSON.value;
protected String collectionType = CollectionType.ARRAY.value;
protected boolean useRxJava = false;
protected boolean useRxJava2 = false;
protected boolean useCoroutines = false;
// backwards compatibility for openapi configs that specify neither rx1 nor rx2
// (mustache does not allow for boolean operators so we need this extra field)
protected boolean doNotUseRxAndCoroutines = true;
public enum DateLibrary {
STRING("string"),
@ -177,6 +191,10 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
requestDateConverter.setEnum(requestDateConverterOptions);
requestDateConverter.setDefault(this.requestDateConverter);
cliOptions.add(requestDateConverter);
cliOptions.add(CliOption.newBoolean(USE_RX_JAVA, "Whether to use the RxJava adapter with the retrofit2 library."));
cliOptions.add(CliOption.newBoolean(USE_RX_JAVA2, "Whether to use the RxJava2 adapter with the retrofit2 library."));
cliOptions.add(CliOption.newBoolean(USE_COROUTINES, "Whether to use the Coroutines adapter with the retrofit2 library."));
}
public CodegenType getTag() {
@ -191,6 +209,43 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
return "Generates a Kotlin client.";
}
public void setUseRxJava(boolean useRxJava) {
if (useRxJava) {
this.useRxJava2 = false;
this.doNotUseRxAndCoroutines = false;
this.useCoroutines = false;
}
this.useRxJava = useRxJava;
}
public void setUseRxJava2(boolean useRxJava2) {
if (useRxJava2) {
this.useRxJava = false;
this.doNotUseRxAndCoroutines = false;
this.useCoroutines = false;
}
this.useRxJava2 = useRxJava2;
}
public void setDoNotUseRxAndCoroutines(boolean doNotUseRxAndCoroutines) {
if (doNotUseRxAndCoroutines) {
this.useRxJava = false;
this.useRxJava2 = false;
this.useCoroutines = false;
}
this.doNotUseRxAndCoroutines = doNotUseRxAndCoroutines;
}
public void setUseCoroutines(boolean useCoroutines) {
if (useCoroutines) {
this.useRxJava = false;
this.useRxJava2 = false;
this.doNotUseRxAndCoroutines = false;
}
this.useCoroutines = useCoroutines;
}
public void setDateLibrary(String library) {
this.dateLibrary = library;
}
@ -211,6 +266,38 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
sourceFolder = "src/commonMain/kotlin";
}
boolean hasRx = additionalProperties.containsKey(USE_RX_JAVA);
boolean hasRx2 = additionalProperties.containsKey(USE_RX_JAVA2);
boolean hasCoroutines = additionalProperties.containsKey(USE_COROUTINES);
int optionCount = 0;
if (hasRx) {
optionCount++;
}
if (hasRx2) {
optionCount++;
}
if (hasCoroutines) {
optionCount++;
}
boolean hasConflict = optionCount > 1;
// RxJava & Coroutines
if (hasConflict) {
LOGGER.warn("You specified both RxJava versions 1 and 2 or Coroutines together, please choose one them.");
} else if (hasRx) {
this.setUseRxJava(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA).toString()));
} else if (hasRx2) {
this.setUseRxJava2(Boolean.valueOf(additionalProperties.get(USE_RX_JAVA2).toString()));
} else if (hasCoroutines) {
this.setUseCoroutines(Boolean.valueOf(additionalProperties.get(USE_COROUTINES).toString()));
}
if (!hasRx && !hasRx2 && !hasCoroutines) {
setDoNotUseRxAndCoroutines(true);
additionalProperties.put(DO_NOT_USE_RX_AND_COROUTINES, true);
}
// infrastructure destination folder
final String infrastructureFolder = (sourceFolder + File.separator + packageName + File.separator + "infrastructure").replace(".", "/");

View File

@ -11,6 +11,12 @@ buildscript {
{{#jvm-retrofit2}}
ext.retrofitVersion = '2.6.2'
{{/jvm-retrofit2}}
{{#useRxJava}}
ext.rxJavaVersion = '1.3.8'
{{/useRxJava}}
{{#useRxJava2}}
ext.rxJava2Version = '2.2.17'
{{/useRxJava2}}
repositories {
maven { url "https://repo1.maven.org/maven2" }
@ -80,6 +86,14 @@ dependencies {
compile "org.threeten:threetenbp:1.4.0"
{{/threetenbp}}
{{#jvm-retrofit2}}
{{#useRxJava}}
compile "io.reactivex:rxjava:$rxJavaVersion"
compile "com.squareup.retrofit2:adapter-rxjava:$retrofitVersion"
{{/useRxJava}}
{{#useRxJava2}}
compile "io.reactivex.rxjava2:rxjava:$rxJava2Version"
compile "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
{{/useRxJava2}}
compile "com.squareup.retrofit2:retrofit:$retrofitVersion"
{{#gson}}
compile "com.squareup.retrofit2:converter-gson:$retrofitVersion"

View File

@ -45,7 +45,7 @@ import java.io.Serializable
{{#allVars}}
{{#required}}{{>data_class_req_var}}{{/required}}{{^required}}{{>data_class_opt_var}}{{/required}}{{^-last}},{{/-last}}
{{/allVars}}
){{/discriminator}}{{#parent}}{{^serializableModel}}{{^parcelizeModels}} : {{parent}}{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{^parcelizeModels}} : {{parent}}, Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{^serializableModel}}{{#parcelizeModels}} : {{parent}}, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{#parcelizeModels}} : {{parent}}, Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{^parcelizeModels}} : Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{#parcelizeModels}} : Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#vendorExtensions.x-has-data-class-body}} {
){{/discriminator}}{{#parent}}{{^serializableModel}}{{^parcelizeModels}} : {{{parent}}}{{#isMapModel}}(){{/isMapModel}}{{#isArrayModel}}(){{/isArrayModel}}{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{^parcelizeModels}} : {{{parent}}}{{#isMapModel}}(){{/isMapModel}}{{#isArrayModel}}(){{/isArrayModel}}, Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{^serializableModel}}{{#parcelizeModels}} : {{{parent}}}{{#isMapModel}}(){{/isMapModel}}{{#isArrayModel}}(){{/isArrayModel}}, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{#parcelizeModels}} : {{{parent}}}{{#isMapModel}}(){{/isMapModel}}{{#isArrayModel}}(){{/isArrayModel}}, Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{^parcelizeModels}} : Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{#parcelizeModels}} : Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#vendorExtensions.x-has-data-class-body}} {
{{/vendorExtensions.x-has-data-class-body}}
{{#serializableModel}}
{{#nonPublicApi}}internal {{/nonPublicApi}}companion object {
@ -71,10 +71,10 @@ import java.io.Serializable
@Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
{{/moshi}}
{{#gson}}
@SerializedName(value={{{value}}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
@SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
{{/gson}}
{{#jackson}}
@JsonProperty(value={{{value}}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
@JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
{{/jackson}}
{{/multiplatform}}
{{#multiplatform}}

View File

@ -6,7 +6,7 @@
@Json(name = "{{{vendorExtensions.x-base-name-literal}}}")
{{/moshi}}
{{#gson}}
@SerializedName("{{{vendorExtensions.x-base-name-literal}}}")
@get:SerializedName("{{{vendorExtensions.x-base-name-literal}}}")
{{/gson}}
{{#jackson}}
@get:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}")

View File

@ -6,7 +6,7 @@
@Json(name = "{{{vendorExtensions.x-base-name-literal}}}")
{{/moshi}}
{{#gson}}
@SerializedName("{{{vendorExtensions.x-base-name-literal}}}")
@get:SerializedName("{{{vendorExtensions.x-base-name-literal}}}")
{{/gson}}
{{#jackson}}
@get:JsonProperty("{{{vendorExtensions.x-base-name-literal}}}")

View File

@ -2,10 +2,25 @@ package {{apiPackage}}
import {{packageName}}.infrastructure.CollectionFormats.*
import retrofit2.http.*
{{#doNotUseRxAndCoroutines}}
import retrofit2.Call
{{/doNotUseRxAndCoroutines}}
import okhttp3.RequestBody
import okhttp3.ResponseBody
import okhttp3.MultipartBody
{{^doNotUseRxAndCoroutines}}
{{#useRxJava}}
import rx.Observable
{{/useRxJava}}
{{#useRxJava2}}
import io.reactivex.Single
{{/useRxJava2}}
{{^returnType}}
{{#useRxJava2}}
import io.reactivex.Completable
{{/useRxJava2}}
{{/returnType}}
{{/doNotUseRxAndCoroutines}}
{{#imports}}import {{import}}
{{/imports}}
@ -31,7 +46,7 @@ interface {{classname}} {
{{/prioritizedContentTypes}}
{{/formParams}}
@{{httpMethod}}("{{{path}}}")
fun {{operationId}}({{^allParams}}){{/allParams}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}){{/hasMore}}{{/allParams}}: Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}>
{{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{^allParams}}){{/allParams}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{^hasMore}}){{/hasMore}}{{/allParams}}: {{^doNotUseRxAndCoroutines}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Single<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useCoroutines}}{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}{{/useCoroutines}}{{/doNotUseRxAndCoroutines}}{{#doNotUseRxAndCoroutines}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{/isResponseFile}}>{{/doNotUseRxAndCoroutines}}
{{/operation}}
}

View File

@ -1 +1 @@
{{#isFormParam}}{{^isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field{{/isMultipart}}("{{baseName}}") {{{paramName}}}: {{{dataType}}}{{/isFile}}{{#isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field("{{baseName}}"){{/isMultipart}} {{{paramName}}}: MultipartBody.Part {{/isFile}}{{/isFormParam}}
{{#isFormParam}}{{^isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field{{/isMultipart}}("{{baseName}}") {{{paramName}}}: {{{dataType}}}{{/isFile}}{{#isFile}}{{#isMultipart}}@Part{{/isMultipart}}{{^isMultipart}}@Field("{{baseName}}"){{/isMultipart}} {{{paramName}}}: MultipartBody.Part{{/isFile}}{{/isFormParam}}

View File

@ -3,6 +3,12 @@ package {{packageName}}.infrastructure
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import retrofit2.converter.scalars.ScalarsConverterFactory
{{#useRxJava}}
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory
{{/useRxJava}}
{{#useRxJava2}}
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
{{/useRxJava2}}
{{#gson}}
import retrofit2.converter.gson.GsonConverterFactory
{{/gson}}
@ -33,6 +39,12 @@ import retrofit2.converter.moshi.MoshiConverterFactory
{{#gson}}
.addConverterFactory(GsonConverterFactory.create(Serializer.gson))
{{/gson}}
{{#useRxJava}}
.addCallAdapterFactory(RxJavaCallAdapterFactory.create())
{{/useRxJava}}
{{#useRxJava2}}
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
{{/useRxJava2}}
{{#moshi}}
.addConverterFactory(MoshiConverterFactory.create(Serializer.moshi))
{{/moshi}}

View File

@ -45,9 +45,9 @@ data class Order (
*/
enum class Status(val value: kotlin.String){
@SerializedName(value="placed") placed("placed"),
@SerializedName(value="approved") approved("approved"),
@SerializedName(value="delivered") delivered("delivered");
@SerializedName(value = "placed") placed("placed"),
@SerializedName(value = "approved") approved("approved"),
@SerializedName(value = "delivered") delivered("delivered");
}
}

View File

@ -47,9 +47,9 @@ data class Pet (
*/
enum class Status(val value: kotlin.String){
@SerializedName(value="available") available("available"),
@SerializedName(value="pending") pending("pending"),
@SerializedName(value="sold") sold("sold");
@SerializedName(value = "available") available("available"),
@SerializedName(value = "pending") pending("pending"),
@SerializedName(value = "sold") sold("sold");
}
}

View File

@ -45,9 +45,9 @@ data class Order (
*/
enum class Status(val value: kotlin.String){
@JsonProperty(value="placed") PLACED("placed"),
@JsonProperty(value="approved") APPROVED("approved"),
@JsonProperty(value="delivered") DELIVERED("delivered");
@JsonProperty(value = "placed") PLACED("placed"),
@JsonProperty(value = "approved") APPROVED("approved"),
@JsonProperty(value = "delivered") DELIVERED("delivered");
}
}

View File

@ -47,9 +47,9 @@ data class Pet (
*/
enum class Status(val value: kotlin.String){
@JsonProperty(value="available") AVAILABLE("available"),
@JsonProperty(value="pending") PENDING("pending"),
@JsonProperty(value="sold") SOLD("sold");
@JsonProperty(value = "available") AVAILABLE("available"),
@JsonProperty(value = "pending") PENDING("pending"),
@JsonProperty(value = "sold") SOLD("sold");
}
}

View File

@ -36,6 +36,6 @@ interface PetApi {
@Multipart
@POST("/pet/{petId}/uploadImage")
fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part ): Call<ApiResponse>
fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part): Call<ApiResponse>
}

View File

@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@ -0,0 +1,173 @@
# org.openapitools.client - Kotlin client library for OpenAPI Petstore
## Requires
* Kotlin 1.3.41
* Gradle 4.9
## Build
First, create the gradle wrapper script:
```
gradle wrapper
```
Then, run:
```
./gradlew check assemble
```
This runs all tests and packages the library.
## Features/Implementation Notes
* Supports JSON inputs/outputs, File inputs, and Form inputs.
* Supports collection formats for query parameters: csv, tsv, ssv, pipes.
* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions.
* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets.
<a name="documentation-for-api-endpoints"></a>
## Documentation for API Endpoints
All URIs are relative to *http://petstore.swagger.io:80/v2*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooget) | **GET** /foo |
*FakeApi* | [**fakeHealthGet**](docs/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint
*FakeApi* | [**fakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication
*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**testClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters
*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data
*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters |
*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case
*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store
*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet
*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status
*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user
*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
<a name="documentation-for-models"></a>
## Documentation for Models
- [org.openapitools.client.models.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
- [org.openapitools.client.models.Animal](docs/Animal.md)
- [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md)
- [org.openapitools.client.models.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- [org.openapitools.client.models.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [org.openapitools.client.models.ArrayTest](docs/ArrayTest.md)
- [org.openapitools.client.models.Capitalization](docs/Capitalization.md)
- [org.openapitools.client.models.Cat](docs/Cat.md)
- [org.openapitools.client.models.CatAllOf](docs/CatAllOf.md)
- [org.openapitools.client.models.Category](docs/Category.md)
- [org.openapitools.client.models.ClassModel](docs/ClassModel.md)
- [org.openapitools.client.models.Client](docs/Client.md)
- [org.openapitools.client.models.Dog](docs/Dog.md)
- [org.openapitools.client.models.DogAllOf](docs/DogAllOf.md)
- [org.openapitools.client.models.EnumArrays](docs/EnumArrays.md)
- [org.openapitools.client.models.EnumClass](docs/EnumClass.md)
- [org.openapitools.client.models.EnumTest](docs/EnumTest.md)
- [org.openapitools.client.models.FileSchemaTestClass](docs/FileSchemaTestClass.md)
- [org.openapitools.client.models.Foo](docs/Foo.md)
- [org.openapitools.client.models.FormatTest](docs/FormatTest.md)
- [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
- [org.openapitools.client.models.HealthCheckResult](docs/HealthCheckResult.md)
- [org.openapitools.client.models.InlineObject](docs/InlineObject.md)
- [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md)
- [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md)
- [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md)
- [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md)
- [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md)
- [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md)
- [org.openapitools.client.models.List](docs/List.md)
- [org.openapitools.client.models.MapTest](docs/MapTest.md)
- [org.openapitools.client.models.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
- [org.openapitools.client.models.Model200Response](docs/Model200Response.md)
- [org.openapitools.client.models.Name](docs/Name.md)
- [org.openapitools.client.models.NullableClass](docs/NullableClass.md)
- [org.openapitools.client.models.NumberOnly](docs/NumberOnly.md)
- [org.openapitools.client.models.Order](docs/Order.md)
- [org.openapitools.client.models.OuterComposite](docs/OuterComposite.md)
- [org.openapitools.client.models.OuterEnum](docs/OuterEnum.md)
- [org.openapitools.client.models.OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md)
- [org.openapitools.client.models.OuterEnumInteger](docs/OuterEnumInteger.md)
- [org.openapitools.client.models.OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md)
- [org.openapitools.client.models.Pet](docs/Pet.md)
- [org.openapitools.client.models.ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [org.openapitools.client.models.Return](docs/Return.md)
- [org.openapitools.client.models.SpecialModelname](docs/SpecialModelname.md)
- [org.openapitools.client.models.Tag](docs/Tag.md)
- [org.openapitools.client.models.User](docs/User.md)
<a name="documentation-for-authorization"></a>
## Documentation for Authorization
<a name="api_key"></a>
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header
<a name="api_key_query"></a>
### api_key_query
- **Type**: API key
- **API key parameter name**: api_key_query
- **Location**: URL query string
<a name="bearer_test"></a>
### bearer_test
- **Type**: HTTP basic authentication
<a name="http_basic_test"></a>
### http_basic_test
- **Type**: HTTP basic authentication
<a name="http_signature_test"></a>
### http_signature_test
- **Type**: HTTP basic authentication
<a name="petstore_auth"></a>
### petstore_auth
- **Type**: OAuth
- **Flow**: implicit
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
- **Scopes**:
- write:pets: modify pets in your account
- read:pets: read your pets

View File

@ -0,0 +1,38 @@
group 'org.openapitools'
version '1.0.0'
wrapper {
gradleVersion = '4.9'
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}
buildscript {
ext.kotlin_version = '1.3.61'
ext.retrofitVersion = '2.6.2'
repositories {
maven { url "https://repo1.maven.org/maven2" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin'
repositories {
maven { url "https://repo1.maven.org/maven2" }
}
test {
useJUnitPlatform()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compile "com.google.code.gson:gson:2.8.6"
compile "com.squareup.retrofit2:retrofit:$retrofitVersion"
compile "com.squareup.retrofit2:converter-gson:$retrofitVersion"
compile "com.squareup.retrofit2:converter-scalars:$retrofitVersion"
testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0"
}

View File

@ -0,0 +1,11 @@
# Model200Response
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **kotlin.Int** | | [optional]
**propertyClass** | **kotlin.String** | | [optional]

View File

@ -0,0 +1,11 @@
# AdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**mapProperty** | **kotlin.collections.Map&lt;kotlin.String, kotlin.String&gt;** | | [optional]
**mapOfMapProperty** | **kotlin.collections.Map&lt;kotlin.String, kotlin.collections.Map&lt;kotlin.String, kotlin.String&gt;&gt;** | | [optional]

View File

@ -0,0 +1,11 @@
# Animal
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**className** | **kotlin.String** | |
**color** | **kotlin.String** | | [optional]

View File

@ -0,0 +1,56 @@
# AnotherFakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
<a name="call123testSpecialTags"></a>
# **call123testSpecialTags**
> Client call123testSpecialTags(client)
To test special tags
To test special tags and operation ID starting with number
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = AnotherFakeApi()
val client : Client = // Client | client model
try {
val result : Client = apiInstance.call123testSpecialTags(client)
println(result)
} catch (e: ClientException) {
println("4xx response calling AnotherFakeApi#call123testSpecialTags")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AnotherFakeApi#call123testSpecialTags")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**client** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@ -0,0 +1,12 @@
# ApiResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **kotlin.Int** | | [optional]
**type** | **kotlin.String** | | [optional]
**message** | **kotlin.String** | | [optional]

View File

@ -0,0 +1,10 @@
# ArrayOfArrayOfNumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrayArrayNumber** | **kotlin.Array&lt;kotlin.Array&lt;java.math.BigDecimal&gt;&gt;** | | [optional]

View File

@ -0,0 +1,10 @@
# ArrayOfNumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrayNumber** | [**kotlin.Array&lt;java.math.BigDecimal&gt;**](java.math.BigDecimal.md) | | [optional]

View File

@ -0,0 +1,12 @@
# ArrayTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**arrayOfString** | **kotlin.Array&lt;kotlin.String&gt;** | | [optional]
**arrayArrayOfInteger** | **kotlin.Array&lt;kotlin.Array&lt;kotlin.Long&gt;&gt;** | | [optional]
**arrayArrayOfModel** | **kotlin.Array&lt;kotlin.Array&lt;ReadOnlyFirst&gt;&gt;** | | [optional]

View File

@ -0,0 +1,15 @@
# Capitalization
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**smallCamel** | **kotlin.String** | | [optional]
**capitalCamel** | **kotlin.String** | | [optional]
**smallSnake** | **kotlin.String** | | [optional]
**capitalSnake** | **kotlin.String** | | [optional]
**scAETHFlowPoints** | **kotlin.String** | | [optional]
**ATT_NAME** | **kotlin.String** | Name of the pet | [optional]

View File

@ -0,0 +1,10 @@
# Cat
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**declawed** | **kotlin.Boolean** | | [optional]

View File

@ -0,0 +1,10 @@
# CatAllOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**declawed** | **kotlin.Boolean** | | [optional]

View File

@ -0,0 +1,11 @@
# Category
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **kotlin.String** | |
**id** | **kotlin.Long** | | [optional]

View File

@ -0,0 +1,10 @@
# ClassModel
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**propertyClass** | **kotlin.String** | | [optional]

View File

@ -0,0 +1,10 @@
# Client
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**client** | **kotlin.String** | | [optional]

View File

@ -0,0 +1,50 @@
# DefaultApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo |
<a name="fooGet"></a>
# **fooGet**
> InlineResponseDefault fooGet()
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = DefaultApi()
try {
val result : InlineResponseDefault = apiInstance.fooGet()
println(result)
} catch (e: ClientException) {
println("4xx response calling DefaultApi#fooGet")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling DefaultApi#fooGet")
e.printStackTrace()
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**InlineResponseDefault**](InlineResponseDefault.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json

View File

@ -0,0 +1,10 @@
# Dog
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**breed** | **kotlin.String** | | [optional]

View File

@ -0,0 +1,10 @@
# DogAllOf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**breed** | **kotlin.String** | | [optional]

View File

@ -0,0 +1,25 @@
# EnumArrays
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**justSymbol** | [**inline**](#JustSymbolEnum) | | [optional]
**arrayEnum** | [**inline**](#kotlin.Array&lt;ArrayEnumEnum&gt;) | | [optional]
<a name="JustSymbolEnum"></a>
## Enum: just_symbol
Name | Value
---- | -----
justSymbol | &gt;&#x3D;, $
<a name="kotlin.Array<ArrayEnumEnum>"></a>
## Enum: array_enum
Name | Value
---- | -----
arrayEnum | fish, crab

View File

@ -0,0 +1,14 @@
# EnumClass
## Enum
* `abc` (value: `"_abc"`)
* `minusEfg` (value: `"-efg"`)
* `leftParenthesisXyzRightParenthesis` (value: `"(xyz)"`)

View File

@ -0,0 +1,45 @@
# EnumTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enumStringRequired** | [**inline**](#EnumStringRequiredEnum) | |
**enumString** | [**inline**](#EnumStringEnum) | | [optional]
**enumInteger** | [**inline**](#EnumIntegerEnum) | | [optional]
**enumNumber** | [**inline**](#EnumNumberEnum) | | [optional]
**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional]
**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional]
**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional]
**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional]
<a name="EnumStringRequiredEnum"></a>
## Enum: enum_string_required
Name | Value
---- | -----
enumStringRequired | UPPER, lower,
<a name="EnumStringEnum"></a>
## Enum: enum_string
Name | Value
---- | -----
enumString | UPPER, lower,
<a name="EnumIntegerEnum"></a>
## Enum: enum_integer
Name | Value
---- | -----
enumInteger | 1, -1
<a name="EnumNumberEnum"></a>
## Enum: enum_number
Name | Value
---- | -----
enumNumber | 1.1, -1.2

View File

@ -0,0 +1,776 @@
# FakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint
[**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication
[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \&quot;client\&quot; model
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters |
<a name="fakeHealthGet"></a>
# **fakeHealthGet**
> HealthCheckResult fakeHealthGet()
Health check endpoint
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = FakeApi()
try {
val result : HealthCheckResult = apiInstance.fakeHealthGet()
println(result)
} catch (e: ClientException) {
println("4xx response calling FakeApi#fakeHealthGet")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#fakeHealthGet")
e.printStackTrace()
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**HealthCheckResult**](HealthCheckResult.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="fakeHttpSignatureTest"></a>
# **fakeHttpSignatureTest**
> fakeHttpSignatureTest(pet, query1, header1)
test http signature authentication
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = FakeApi()
val pet : Pet = // Pet | Pet object that needs to be added to the store
val query1 : kotlin.String = query1_example // kotlin.String | query parameter
val header1 : kotlin.String = header1_example // kotlin.String | header parameter
try {
apiInstance.fakeHttpSignatureTest(pet, query1, header1)
} catch (e: ClientException) {
println("4xx response calling FakeApi#fakeHttpSignatureTest")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#fakeHttpSignatureTest")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
**query1** | **kotlin.String**| query parameter | [optional]
**header1** | **kotlin.String**| header parameter | [optional]
### Return type
null (empty response body)
### Authorization
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
<a name="fakeOuterBooleanSerialize"></a>
# **fakeOuterBooleanSerialize**
> kotlin.Boolean fakeOuterBooleanSerialize(body)
Test serialization of outer boolean types
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = FakeApi()
val body : kotlin.Boolean = true // kotlin.Boolean | Input boolean as post body
try {
val result : kotlin.Boolean = apiInstance.fakeOuterBooleanSerialize(body)
println(result)
} catch (e: ClientException) {
println("4xx response calling FakeApi#fakeOuterBooleanSerialize")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#fakeOuterBooleanSerialize")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **kotlin.Boolean**| Input boolean as post body | [optional]
### Return type
**kotlin.Boolean**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
<a name="fakeOuterCompositeSerialize"></a>
# **fakeOuterCompositeSerialize**
> OuterComposite fakeOuterCompositeSerialize(outerComposite)
Test serialization of object with outer number type
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = FakeApi()
val outerComposite : OuterComposite = // OuterComposite | Input composite as post body
try {
val result : OuterComposite = apiInstance.fakeOuterCompositeSerialize(outerComposite)
println(result)
} catch (e: ClientException) {
println("4xx response calling FakeApi#fakeOuterCompositeSerialize")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#fakeOuterCompositeSerialize")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
### Return type
[**OuterComposite**](OuterComposite.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
<a name="fakeOuterNumberSerialize"></a>
# **fakeOuterNumberSerialize**
> java.math.BigDecimal fakeOuterNumberSerialize(body)
Test serialization of outer number types
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = FakeApi()
val body : java.math.BigDecimal = 8.14 // java.math.BigDecimal | Input number as post body
try {
val result : java.math.BigDecimal = apiInstance.fakeOuterNumberSerialize(body)
println(result)
} catch (e: ClientException) {
println("4xx response calling FakeApi#fakeOuterNumberSerialize")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#fakeOuterNumberSerialize")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **java.math.BigDecimal**| Input number as post body | [optional]
### Return type
[**java.math.BigDecimal**](java.math.BigDecimal.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
<a name="fakeOuterStringSerialize"></a>
# **fakeOuterStringSerialize**
> kotlin.String fakeOuterStringSerialize(body)
Test serialization of outer string types
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = FakeApi()
val body : kotlin.String = body_example // kotlin.String | Input string as post body
try {
val result : kotlin.String = apiInstance.fakeOuterStringSerialize(body)
println(result)
} catch (e: ClientException) {
println("4xx response calling FakeApi#fakeOuterStringSerialize")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#fakeOuterStringSerialize")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **kotlin.String**| Input string as post body | [optional]
### Return type
**kotlin.String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
<a name="testBodyWithFileSchema"></a>
# **testBodyWithFileSchema**
> testBodyWithFileSchema(fileSchemaTestClass)
For this test, the body for this request much reference a schema named &#x60;File&#x60;.
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = FakeApi()
val fileSchemaTestClass : FileSchemaTestClass = // FileSchemaTestClass |
try {
apiInstance.testBodyWithFileSchema(fileSchemaTestClass)
} catch (e: ClientException) {
println("4xx response calling FakeApi#testBodyWithFileSchema")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#testBodyWithFileSchema")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
<a name="testBodyWithQueryParams"></a>
# **testBodyWithQueryParams**
> testBodyWithQueryParams(query, user)
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = FakeApi()
val query : kotlin.String = query_example // kotlin.String |
val user : User = // User |
try {
apiInstance.testBodyWithQueryParams(query, user)
} catch (e: ClientException) {
println("4xx response calling FakeApi#testBodyWithQueryParams")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#testBodyWithQueryParams")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**query** | **kotlin.String**| |
**user** | [**User**](User.md)| |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
<a name="testClientModel"></a>
# **testClientModel**
> Client testClientModel(client)
To test \&quot;client\&quot; model
To test \&quot;client\&quot; model
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = FakeApi()
val client : Client = // Client | client model
try {
val result : Client = apiInstance.testClientModel(client)
println(result)
} catch (e: ClientException) {
println("4xx response calling FakeApi#testClientModel")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#testClientModel")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**client** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
<a name="testEndpointParameters"></a>
# **testEndpointParameters**
> testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback)
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = FakeApi()
val number : java.math.BigDecimal = 8.14 // java.math.BigDecimal | None
val double : kotlin.Double = 1.2 // kotlin.Double | None
val patternWithoutDelimiter : kotlin.String = patternWithoutDelimiter_example // kotlin.String | None
val byte : kotlin.ByteArray = BYTE_ARRAY_DATA_HERE // kotlin.ByteArray | None
val integer : kotlin.Int = 56 // kotlin.Int | None
val int32 : kotlin.Int = 56 // kotlin.Int | None
val int64 : kotlin.Long = 789 // kotlin.Long | None
val float : kotlin.Float = 3.4 // kotlin.Float | None
val string : kotlin.String = string_example // kotlin.String | None
val binary : java.io.File = BINARY_DATA_HERE // java.io.File | None
val date : java.time.LocalDate = 2013-10-20 // java.time.LocalDate | None
val dateTime : java.time.OffsetDateTime = 2013-10-20T19:20:30+01:00 // java.time.OffsetDateTime | None
val password : kotlin.String = password_example // kotlin.String | None
val paramCallback : kotlin.String = paramCallback_example // kotlin.String | None
try {
apiInstance.testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback)
} catch (e: ClientException) {
println("4xx response calling FakeApi#testEndpointParameters")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#testEndpointParameters")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**number** | **java.math.BigDecimal**| None |
**double** | **kotlin.Double**| None |
**patternWithoutDelimiter** | **kotlin.String**| None |
**byte** | **kotlin.ByteArray**| None |
**integer** | **kotlin.Int**| None | [optional]
**int32** | **kotlin.Int**| None | [optional]
**int64** | **kotlin.Long**| None | [optional]
**float** | **kotlin.Float**| None | [optional]
**string** | **kotlin.String**| None | [optional]
**binary** | **java.io.File**| None | [optional]
**date** | **java.time.LocalDate**| None | [optional]
**dateTime** | **java.time.OffsetDateTime**| None | [optional]
**password** | **kotlin.String**| None | [optional]
**paramCallback** | **kotlin.String**| None | [optional]
### Return type
null (empty response body)
### Authorization
Configure http_basic_test:
ApiClient.username = ""
ApiClient.password = ""
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
<a name="testEnumParameters"></a>
# **testEnumParameters**
> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString)
To test enum parameters
To test enum parameters
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = FakeApi()
val enumHeaderStringArray : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Header parameter enum test (string array)
val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string)
val enumQueryStringArray : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Query parameter enum test (string array)
val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string)
val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double)
val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double)
val enumFormStringArray : kotlin.Array<kotlin.String> = enumFormStringArray_example // kotlin.Array<kotlin.String> | Form parameter enum test (string array)
val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string)
try {
apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString)
} catch (e: ClientException) {
println("4xx response calling FakeApi#testEnumParameters")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#testEnumParameters")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enumHeaderStringArray** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [enum: >, $]
**enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to &#39;-efg&#39;] [enum: _abc, -efg, (xyz)]
**enumQueryStringArray** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [enum: >, $]
**enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to &#39;-efg&#39;] [enum: _abc, -efg, (xyz)]
**enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [enum: 1, -2]
**enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2]
**enumFormStringArray** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to &#39;$&#39;] [enum: >, $]
**enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to &#39;-efg&#39;] [enum: _abc, -efg, (xyz)]
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
<a name="testGroupParameters"></a>
# **testGroupParameters**
> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group)
Fake endpoint to test group parameters (optional)
Fake endpoint to test group parameters (optional)
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = FakeApi()
val requiredStringGroup : kotlin.Int = 56 // kotlin.Int | Required String in group parameters
val requiredBooleanGroup : kotlin.Boolean = true // kotlin.Boolean | Required Boolean in group parameters
val requiredInt64Group : kotlin.Long = 789 // kotlin.Long | Required Integer in group parameters
val stringGroup : kotlin.Int = 56 // kotlin.Int | String in group parameters
val booleanGroup : kotlin.Boolean = true // kotlin.Boolean | Boolean in group parameters
val int64Group : kotlin.Long = 789 // kotlin.Long | Integer in group parameters
try {
apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group)
} catch (e: ClientException) {
println("4xx response calling FakeApi#testGroupParameters")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#testGroupParameters")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**requiredStringGroup** | **kotlin.Int**| Required String in group parameters |
**requiredBooleanGroup** | **kotlin.Boolean**| Required Boolean in group parameters |
**requiredInt64Group** | **kotlin.Long**| Required Integer in group parameters |
**stringGroup** | **kotlin.Int**| String in group parameters | [optional]
**booleanGroup** | **kotlin.Boolean**| Boolean in group parameters | [optional]
**int64Group** | **kotlin.Long**| Integer in group parameters | [optional]
### Return type
null (empty response body)
### Authorization
Configure bearer_test:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a name="testInlineAdditionalProperties"></a>
# **testInlineAdditionalProperties**
> testInlineAdditionalProperties(requestBody)
test inline additionalProperties
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = FakeApi()
val requestBody : kotlin.collections.Map<kotlin.String, kotlin.String> = // kotlin.collections.Map<kotlin.String, kotlin.String> | request body
try {
apiInstance.testInlineAdditionalProperties(requestBody)
} catch (e: ClientException) {
println("4xx response calling FakeApi#testInlineAdditionalProperties")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#testInlineAdditionalProperties")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**requestBody** | [**kotlin.collections.Map&lt;kotlin.String, kotlin.String&gt;**](kotlin.String.md)| request body |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
<a name="testJsonFormData"></a>
# **testJsonFormData**
> testJsonFormData(param, param2)
test json serialization of form data
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = FakeApi()
val param : kotlin.String = param_example // kotlin.String | field1
val param2 : kotlin.String = param2_example // kotlin.String | field2
try {
apiInstance.testJsonFormData(param, param2)
} catch (e: ClientException) {
println("4xx response calling FakeApi#testJsonFormData")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#testJsonFormData")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**param** | **kotlin.String**| field1 |
**param2** | **kotlin.String**| field2 |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
<a name="testQueryParameterCollectionFormat"></a>
# **testQueryParameterCollectionFormat**
> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context)
To test the collection format in query parameters
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = FakeApi()
val pipe : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val ioutil : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val http : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val url : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
val context : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> |
try {
apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context)
} catch (e: ClientException) {
println("4xx response calling FakeApi#testQueryParameterCollectionFormat")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#testQueryParameterCollectionFormat")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pipe** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**ioutil** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**http** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**url** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
**context** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined

View File

@ -0,0 +1,59 @@
# FakeClassnameTags123Api
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
<a name="testClassname"></a>
# **testClassname**
> Client testClassname(client)
To test class name in snake case
To test class name in snake case
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = FakeClassnameTags123Api()
val client : Client = // Client | client model
try {
val result : Client = apiInstance.testClassname(client)
println(result)
} catch (e: ClientException) {
println("4xx response calling FakeClassnameTags123Api#testClassname")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeClassnameTags123Api#testClassname")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**client** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
Configure api_key_query:
ApiClient.apiKey["api_key_query"] = ""
ApiClient.apiKeyPrefix["api_key_query"] = ""
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json

View File

@ -0,0 +1,11 @@
# FileSchemaTestClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**file** | [**java.io.File**](java.io.File.md) | | [optional]
**files** | [**kotlin.Array&lt;java.io.File&gt;**](java.io.File.md) | | [optional]

View File

@ -0,0 +1,10 @@
# Foo
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bar** | **kotlin.String** | | [optional]

View File

@ -0,0 +1,24 @@
# FormatTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | |
**byte** | **kotlin.ByteArray** | |
**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | |
**password** | **kotlin.String** | |
**integer** | **kotlin.Int** | | [optional]
**int32** | **kotlin.Int** | | [optional]
**int64** | **kotlin.Long** | | [optional]
**float** | **kotlin.Float** | | [optional]
**double** | **kotlin.Double** | | [optional]
**string** | **kotlin.String** | | [optional]
**binary** | [**java.io.File**](java.io.File.md) | | [optional]
**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional]
**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional]
**patternWithDigits** | **kotlin.String** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**patternWithDigitsAndDelimiter** | **kotlin.String** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]

View File

@ -0,0 +1,11 @@
# HasOnlyReadOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bar** | **kotlin.String** | | [optional] [readonly]
**foo** | **kotlin.String** | | [optional] [readonly]

View File

@ -0,0 +1,10 @@
# HealthCheckResult
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**nullableMessage** | **kotlin.String** | | [optional]

View File

@ -0,0 +1,11 @@
# InlineObject
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **kotlin.String** | Updated name of the pet | [optional]
**status** | **kotlin.String** | Updated status of the pet | [optional]

View File

@ -0,0 +1,11 @@
# InlineObject1
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional]
**file** | [**java.io.File**](java.io.File.md) | file to upload | [optional]

View File

@ -0,0 +1,25 @@
# InlineObject2
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enumFormStringArray** | [**inline**](#kotlin.Array&lt;EnumFormStringArrayEnum&gt;) | Form parameter enum test (string array) | [optional]
**enumFormString** | [**inline**](#EnumFormStringEnum) | Form parameter enum test (string) | [optional]
<a name="kotlin.Array<EnumFormStringArrayEnum>"></a>
## Enum: enum_form_string_array
Name | Value
---- | -----
enumFormStringArray | &gt;, $
<a name="EnumFormStringEnum"></a>
## Enum: enum_form_string
Name | Value
---- | -----
enumFormString | _abc, -efg, (xyz)

View File

@ -0,0 +1,23 @@
# InlineObject3
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | None |
**double** | **kotlin.Double** | None |
**patternWithoutDelimiter** | **kotlin.String** | None |
**byte** | **kotlin.ByteArray** | None |
**integer** | **kotlin.Int** | None | [optional]
**int32** | **kotlin.Int** | None | [optional]
**int64** | **kotlin.Long** | None | [optional]
**float** | **kotlin.Float** | None | [optional]
**string** | **kotlin.String** | None | [optional]
**binary** | [**java.io.File**](java.io.File.md) | None | [optional]
**date** | [**java.time.LocalDate**](java.time.LocalDate.md) | None | [optional]
**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | None | [optional]
**password** | **kotlin.String** | None | [optional]
**callback** | **kotlin.String** | None | [optional]

View File

@ -0,0 +1,11 @@
# InlineObject4
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**param** | **kotlin.String** | field1 |
**param2** | **kotlin.String** | field2 |

View File

@ -0,0 +1,11 @@
# InlineObject5
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**requiredFile** | [**java.io.File**](java.io.File.md) | file to upload |
**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional]

View File

@ -0,0 +1,10 @@
# InlineResponseDefault
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**string** | [**Foo**](Foo.md) | | [optional]

View File

@ -0,0 +1,10 @@
# List
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**&#x60;123minusList&#x60;** | **kotlin.String** | | [optional]

View File

@ -0,0 +1,20 @@
# MapTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**mapMapOfString** | **kotlin.collections.Map&lt;kotlin.String, kotlin.collections.Map&lt;kotlin.String, kotlin.String&gt;&gt;** | | [optional]
**mapOfEnumString** | [**inline**](#kotlin.collections.Map&lt;kotlin.String, InnerEnum&gt;) | | [optional]
**directMap** | **kotlin.collections.Map&lt;kotlin.String, kotlin.Boolean&gt;** | | [optional]
**indirectMap** | **kotlin.collections.Map&lt;kotlin.String, kotlin.Boolean&gt;** | | [optional]
<a name="kotlin.collections.Map<kotlin.String, InnerEnum>"></a>
## Enum: map_of_enum_string
Name | Value
---- | -----
mapOfEnumString | UPPER, lower

View File

@ -0,0 +1,12 @@
# MixedPropertiesAndAdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional]
**dateTime** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional]
**map** | [**kotlin.collections.Map&lt;kotlin.String, Animal&gt;**](Animal.md) | | [optional]

View File

@ -0,0 +1,13 @@
# Name
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **kotlin.Int** | |
**snakeCase** | **kotlin.Int** | | [optional] [readonly]
**property** | **kotlin.String** | | [optional]
**&#x60;123number&#x60;** | **kotlin.Int** | | [optional] [readonly]

View File

@ -0,0 +1,21 @@
# NullableClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**integerProp** | **kotlin.Int** | | [optional]
**numberProp** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
**booleanProp** | **kotlin.Boolean** | | [optional]
**stringProp** | **kotlin.String** | | [optional]
**dateProp** | [**java.time.LocalDate**](java.time.LocalDate.md) | | [optional]
**datetimeProp** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional]
**arrayNullableProp** | [**kotlin.Array&lt;kotlin.Any&gt;**](kotlin.Any.md) | | [optional]
**arrayAndItemsNullableProp** | [**kotlin.Array&lt;kotlin.Any&gt;**](kotlin.Any.md) | | [optional]
**arrayItemsNullable** | [**kotlin.Array&lt;kotlin.Any&gt;**](kotlin.Any.md) | | [optional]
**objectNullableProp** | [**kotlin.collections.Map&lt;kotlin.String, kotlin.Any&gt;**](kotlin.Any.md) | | [optional]
**objectAndItemsNullableProp** | [**kotlin.collections.Map&lt;kotlin.String, kotlin.Any&gt;**](kotlin.Any.md) | | [optional]
**objectItemsNullable** | [**kotlin.collections.Map&lt;kotlin.String, kotlin.Any&gt;**](kotlin.Any.md) | | [optional]

View File

@ -0,0 +1,10 @@
# NumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**justNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]

View File

@ -0,0 +1,22 @@
# Order
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **kotlin.Long** | | [optional]
**petId** | **kotlin.Long** | | [optional]
**quantity** | **kotlin.Int** | | [optional]
**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional]
**status** | [**inline**](#StatusEnum) | Order Status | [optional]
**complete** | **kotlin.Boolean** | | [optional]
<a name="StatusEnum"></a>
## Enum: status
Name | Value
---- | -----
status | placed, approved, delivered

View File

@ -0,0 +1,12 @@
# OuterComposite
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**myNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
**myString** | **kotlin.String** | | [optional]
**myBoolean** | **kotlin.Boolean** | | [optional]

View File

@ -0,0 +1,14 @@
# OuterEnum
## Enum
* `placed` (value: `"placed"`)
* `approved` (value: `"approved"`)
* `delivered` (value: `"delivered"`)

View File

@ -0,0 +1,14 @@
# OuterEnumDefaultValue
## Enum
* `placed` (value: `"placed"`)
* `approved` (value: `"approved"`)
* `delivered` (value: `"delivered"`)

View File

@ -0,0 +1,14 @@
# OuterEnumInteger
## Enum
* `_0` (value: `0`)
* `_1` (value: `1`)
* `_2` (value: `2`)

View File

@ -0,0 +1,14 @@
# OuterEnumIntegerDefaultValue
## Enum
* `_0` (value: `0`)
* `_1` (value: `1`)
* `_2` (value: `2`)

View File

@ -0,0 +1,22 @@
# Pet
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **kotlin.String** | |
**photoUrls** | **kotlin.Array&lt;kotlin.String&gt;** | |
**id** | **kotlin.Long** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
**tags** | [**kotlin.Array&lt;Tag&gt;**](Tag.md) | | [optional]
**status** | [**inline**](#StatusEnum) | pet status in the store | [optional]
<a name="StatusEnum"></a>
## Enum: status
Name | Value
---- | -----
status | available, pending, sold

View File

@ -0,0 +1,457 @@
# PetApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
<a name="addPet"></a>
# **addPet**
> addPet(pet)
Add a new pet to the store
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
val pet : Pet = // Pet | Pet object that needs to be added to the store
try {
apiInstance.addPet(pet)
} catch (e: ClientException) {
println("4xx response calling PetApi#addPet")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#addPet")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
null (empty response body)
### Authorization
Configure petstore_auth:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
<a name="deletePet"></a>
# **deletePet**
> deletePet(petId, apiKey)
Deletes a pet
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete
val apiKey : kotlin.String = apiKey_example // kotlin.String |
try {
apiInstance.deletePet(petId, apiKey)
} catch (e: ClientException) {
println("4xx response calling PetApi#deletePet")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#deletePet")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **kotlin.Long**| Pet id to delete |
**apiKey** | **kotlin.String**| | [optional]
### Return type
null (empty response body)
### Authorization
Configure petstore_auth:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a name="findPetsByStatus"></a>
# **findPetsByStatus**
> kotlin.Array&lt;Pet&gt; findPetsByStatus(status)
Finds Pets by status
Multiple status values can be provided with comma separated strings
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
val status : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Status values that need to be considered for filter
try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByStatus(status)
println(result)
} catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByStatus")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#findPetsByStatus")
e.printStackTrace()
}
```
### Parameters
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]
### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md)
### Authorization
Configure petstore_auth:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="findPetsByTags"></a>
# **findPetsByTags**
> kotlin.Array&lt;Pet&gt; findPetsByTags(tags)
Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
val tags : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Tags to filter by
try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByTags(tags)
println(result)
} catch (e: ClientException) {
println("4xx response calling PetApi#findPetsByTags")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#findPetsByTags")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tags** | [**kotlin.Array&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md)
### Authorization
Configure petstore_auth:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="getPetById"></a>
# **getPetById**
> Pet getPetById(petId)
Find pet by ID
Returns a single pet
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return
try {
val result : Pet = apiInstance.getPetById(petId)
println(result)
} catch (e: ClientException) {
println("4xx response calling PetApi#getPetById")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#getPetById")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **kotlin.Long**| ID of pet to return |
### Return type
[**Pet**](Pet.md)
### Authorization
Configure api_key:
ApiClient.apiKey["api_key"] = ""
ApiClient.apiKeyPrefix["api_key"] = ""
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="updatePet"></a>
# **updatePet**
> updatePet(pet)
Update an existing pet
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
val pet : Pet = // Pet | Pet object that needs to be added to the store
try {
apiInstance.updatePet(pet)
} catch (e: ClientException) {
println("4xx response calling PetApi#updatePet")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#updatePet")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
null (empty response body)
### Authorization
Configure petstore_auth:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
<a name="updatePetWithForm"></a>
# **updatePetWithForm**
> updatePetWithForm(petId, name, status)
Updates a pet in the store with form data
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated
val name : kotlin.String = name_example // kotlin.String | Updated name of the pet
val status : kotlin.String = status_example // kotlin.String | Updated status of the pet
try {
apiInstance.updatePetWithForm(petId, name, status)
} catch (e: ClientException) {
println("4xx response calling PetApi#updatePetWithForm")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#updatePetWithForm")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **kotlin.Long**| ID of pet that needs to be updated |
**name** | **kotlin.String**| Updated name of the pet | [optional]
**status** | **kotlin.String**| Updated status of the pet | [optional]
### Return type
null (empty response body)
### Authorization
Configure petstore_auth:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
<a name="uploadFile"></a>
# **uploadFile**
> ApiResponse uploadFile(petId, additionalMetadata, file)
uploads an image
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update
val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server
val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload
try {
val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file)
println(result)
} catch (e: ClientException) {
println("4xx response calling PetApi#uploadFile")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#uploadFile")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **kotlin.Long**| ID of pet to update |
**additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional]
**file** | **java.io.File**| file to upload | [optional]
### Return type
[**ApiResponse**](ApiResponse.md)
### Authorization
Configure petstore_auth:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json
<a name="uploadFileWithRequiredFile"></a>
# **uploadFileWithRequiredFile**
> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata)
uploads an image (required)
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = PetApi()
val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update
val requiredFile : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload
val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server
try {
val result : ApiResponse = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata)
println(result)
} catch (e: ClientException) {
println("4xx response calling PetApi#uploadFileWithRequiredFile")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling PetApi#uploadFileWithRequiredFile")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **kotlin.Long**| ID of pet to update |
**requiredFile** | **java.io.File**| file to upload |
**additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional]
### Return type
[**ApiResponse**](ApiResponse.md)
### Authorization
Configure petstore_auth:
ApiClient.accessToken = ""
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json

View File

@ -0,0 +1,11 @@
# ReadOnlyFirst
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bar** | **kotlin.String** | | [optional] [readonly]
**baz** | **kotlin.String** | | [optional]

View File

@ -0,0 +1,10 @@
# Return
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**&#x60;return&#x60;** | **kotlin.Int** | | [optional]

View File

@ -0,0 +1,10 @@
# SpecialModelname
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **kotlin.Long** | | [optional]

View File

@ -0,0 +1,196 @@
# StoreApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
<a name="deleteOrder"></a>
# **deleteOrder**
> deleteOrder(orderId)
Delete purchase order by ID
For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = StoreApi()
val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted
try {
apiInstance.deleteOrder(orderId)
} catch (e: ClientException) {
println("4xx response calling StoreApi#deleteOrder")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling StoreApi#deleteOrder")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**orderId** | **kotlin.String**| ID of the order that needs to be deleted |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a name="getInventory"></a>
# **getInventory**
> kotlin.collections.Map&lt;kotlin.String, kotlin.Int&gt; getInventory()
Returns pet inventories by status
Returns a map of status codes to quantities
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = StoreApi()
try {
val result : kotlin.collections.Map<kotlin.String, kotlin.Int> = apiInstance.getInventory()
println(result)
} catch (e: ClientException) {
println("4xx response calling StoreApi#getInventory")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling StoreApi#getInventory")
e.printStackTrace()
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
**kotlin.collections.Map&lt;kotlin.String, kotlin.Int&gt;**
### Authorization
Configure api_key:
ApiClient.apiKey["api_key"] = ""
ApiClient.apiKeyPrefix["api_key"] = ""
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
<a name="getOrderById"></a>
# **getOrderById**
> Order getOrderById(orderId)
Find purchase order by ID
For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = StoreApi()
val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched
try {
val result : Order = apiInstance.getOrderById(orderId)
println(result)
} catch (e: ClientException) {
println("4xx response calling StoreApi#getOrderById")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling StoreApi#getOrderById")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**orderId** | **kotlin.Long**| ID of pet that needs to be fetched |
### Return type
[**Order**](Order.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="placeOrder"></a>
# **placeOrder**
> Order placeOrder(order)
Place an order for a pet
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = StoreApi()
val order : Order = // Order | order placed for purchasing the pet
try {
val result : Order = apiInstance.placeOrder(order)
println(result)
} catch (e: ClientException) {
println("4xx response calling StoreApi#placeOrder")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling StoreApi#placeOrder")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**order** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type
[**Order**](Order.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/xml, application/json

View File

@ -0,0 +1,11 @@
# Tag
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **kotlin.Long** | | [optional]
**name** | **kotlin.String** | | [optional]

View File

@ -0,0 +1,17 @@
# User
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **kotlin.Long** | | [optional]
**username** | **kotlin.String** | | [optional]
**firstName** | **kotlin.String** | | [optional]
**lastName** | **kotlin.String** | | [optional]
**email** | **kotlin.String** | | [optional]
**password** | **kotlin.String** | | [optional]
**phone** | **kotlin.String** | | [optional]
**userStatus** | **kotlin.Int** | User Status | [optional]

View File

@ -0,0 +1,376 @@
# UserApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**createUser**](UserApi.md#createUser) | **POST** /user | Create user
[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
<a name="createUser"></a>
# **createUser**
> createUser(user)
Create user
This can only be done by the logged in user.
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = UserApi()
val user : User = // User | Created user object
try {
apiInstance.createUser(user)
} catch (e: ClientException) {
println("4xx response calling UserApi#createUser")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling UserApi#createUser")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**User**](User.md)| Created user object |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
<a name="createUsersWithArrayInput"></a>
# **createUsersWithArrayInput**
> createUsersWithArrayInput(user)
Creates list of users with given input array
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = UserApi()
val user : kotlin.Array<User> = // kotlin.Array<User> | List of user object
try {
apiInstance.createUsersWithArrayInput(user)
} catch (e: ClientException) {
println("4xx response calling UserApi#createUsersWithArrayInput")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling UserApi#createUsersWithArrayInput")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
<a name="createUsersWithListInput"></a>
# **createUsersWithListInput**
> createUsersWithListInput(user)
Creates list of users with given input array
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = UserApi()
val user : kotlin.Array<User> = // kotlin.Array<User> | List of user object
try {
apiInstance.createUsersWithListInput(user)
} catch (e: ClientException) {
println("4xx response calling UserApi#createUsersWithListInput")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling UserApi#createUsersWithListInput")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
<a name="deleteUser"></a>
# **deleteUser**
> deleteUser(username)
Delete user
This can only be done by the logged in user.
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = UserApi()
val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted
try {
apiInstance.deleteUser(username)
} catch (e: ClientException) {
println("4xx response calling UserApi#deleteUser")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling UserApi#deleteUser")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **kotlin.String**| The name that needs to be deleted |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a name="getUserByName"></a>
# **getUserByName**
> User getUserByName(username)
Get user by user name
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = UserApi()
val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing.
try {
val result : User = apiInstance.getUserByName(username)
println(result)
} catch (e: ClientException) {
println("4xx response calling UserApi#getUserByName")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling UserApi#getUserByName")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. |
### Return type
[**User**](User.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="loginUser"></a>
# **loginUser**
> kotlin.String loginUser(username, password)
Logs user into the system
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = UserApi()
val username : kotlin.String = username_example // kotlin.String | The user name for login
val password : kotlin.String = password_example // kotlin.String | The password for login in clear text
try {
val result : kotlin.String = apiInstance.loginUser(username, password)
println(result)
} catch (e: ClientException) {
println("4xx response calling UserApi#loginUser")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling UserApi#loginUser")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **kotlin.String**| The user name for login |
**password** | **kotlin.String**| The password for login in clear text |
### Return type
**kotlin.String**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
<a name="logoutUser"></a>
# **logoutUser**
> logoutUser()
Logs out current logged in user session
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = UserApi()
try {
apiInstance.logoutUser()
} catch (e: ClientException) {
println("4xx response calling UserApi#logoutUser")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling UserApi#logoutUser")
e.printStackTrace()
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
<a name="updateUser"></a>
# **updateUser**
> updateUser(username, user)
Updated user
This can only be done by the logged in user.
### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*
val apiInstance = UserApi()
val username : kotlin.String = username_example // kotlin.String | name that need to be deleted
val user : User = // User | Updated user object
try {
apiInstance.updateUser(username, user)
} catch (e: ClientException) {
println("4xx response calling UserApi#updateUser")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling UserApi#updateUser")
e.printStackTrace()
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **kotlin.String**| name that need to be deleted |
**user** | [**User**](User.md)| Updated user object |
### Return type
null (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined

View File

@ -0,0 +1,2 @@
rootProject.name = 'kotlin-petstore-coroutines-client'

View File

@ -0,0 +1,15 @@
package org.openapitools.client.apis
import org.openapitools.client.infrastructure.CollectionFormats.*
import retrofit2.http.*
import okhttp3.RequestBody
import okhttp3.ResponseBody
import okhttp3.MultipartBody
import org.openapitools.client.models.Client
interface AnotherFakeApi {
@PATCH("/another-fake/dummy")
suspend fun call123testSpecialTags(@Body client: Client): Client
}

View File

@ -0,0 +1,15 @@
package org.openapitools.client.apis
import org.openapitools.client.infrastructure.CollectionFormats.*
import retrofit2.http.*
import okhttp3.RequestBody
import okhttp3.ResponseBody
import okhttp3.MultipartBody
import org.openapitools.client.models.InlineResponseDefault
interface DefaultApi {
@GET("/foo")
suspend fun fooGet(): InlineResponseDefault
}

View File

@ -0,0 +1,65 @@
package org.openapitools.client.apis
import org.openapitools.client.infrastructure.CollectionFormats.*
import retrofit2.http.*
import okhttp3.RequestBody
import okhttp3.ResponseBody
import okhttp3.MultipartBody
import org.openapitools.client.models.Client
import org.openapitools.client.models.FileSchemaTestClass
import org.openapitools.client.models.HealthCheckResult
import org.openapitools.client.models.OuterComposite
import org.openapitools.client.models.Pet
import org.openapitools.client.models.User
interface FakeApi {
@GET("/fake/health")
suspend fun fakeHealthGet(): HealthCheckResult
@GET("/fake/http-signature-test")
suspend fun fakeHttpSignatureTest(@Body pet: Pet, @Query("query_1") query1: kotlin.String, @Header("header_1") header1: kotlin.String): Unit
@POST("/fake/outer/boolean")
suspend fun fakeOuterBooleanSerialize(@Body body: kotlin.Boolean): kotlin.Boolean
@POST("/fake/outer/composite")
suspend fun fakeOuterCompositeSerialize(@Body outerComposite: OuterComposite): OuterComposite
@POST("/fake/outer/number")
suspend fun fakeOuterNumberSerialize(@Body body: java.math.BigDecimal): java.math.BigDecimal
@POST("/fake/outer/string")
suspend fun fakeOuterStringSerialize(@Body body: kotlin.String): kotlin.String
@PUT("/fake/body-with-file-schema")
suspend fun testBodyWithFileSchema(@Body fileSchemaTestClass: FileSchemaTestClass): Unit
@PUT("/fake/body-with-query-params")
suspend fun testBodyWithQueryParams(@Query("query") query: kotlin.String, @Body user: User): Unit
@PATCH("/fake")
suspend fun testClientModel(@Body client: Client): Client
@FormUrlEncoded
@POST("/fake")
suspend fun testEndpointParameters(@Field("number") number: java.math.BigDecimal, @Field("double") double: kotlin.Double, @Field("pattern_without_delimiter") patternWithoutDelimiter: kotlin.String, @Field("byte") byte: kotlin.ByteArray, @Field("integer") integer: kotlin.Int, @Field("int32") int32: kotlin.Int, @Field("int64") int64: kotlin.Long, @Field("float") float: kotlin.Float, @Field("string") string: kotlin.String, @Field("binary") binary: MultipartBody.Part, @Field("date") date: java.time.LocalDate, @Field("dateTime") dateTime: java.time.OffsetDateTime, @Field("password") password: kotlin.String, @Field("callback") paramCallback: kotlin.String): Unit
@FormUrlEncoded
@GET("/fake")
suspend fun testEnumParameters(@Header("enum_header_string_array") enumHeaderStringArray: kotlin.Array<kotlin.String>, @Header("enum_header_string") enumHeaderString: kotlin.String, @Query("enum_query_string_array") enumQueryStringArray: kotlin.Array<kotlin.String>, @Query("enum_query_string") enumQueryString: kotlin.String, @Query("enum_query_integer") enumQueryInteger: kotlin.Int, @Query("enum_query_double") enumQueryDouble: kotlin.Double, @Field("enum_form_string_array") enumFormStringArray: kotlin.Array<kotlin.String>, @Field("enum_form_string") enumFormString: kotlin.String): Unit
@DELETE("/fake")
suspend fun testGroupParameters(@Query("required_string_group") requiredStringGroup: kotlin.Int, @Header("required_boolean_group") requiredBooleanGroup: kotlin.Boolean, @Query("required_int64_group") requiredInt64Group: kotlin.Long, @Query("string_group") stringGroup: kotlin.Int, @Header("boolean_group") booleanGroup: kotlin.Boolean, @Query("int64_group") int64Group: kotlin.Long): Unit
@POST("/fake/inline-additionalProperties")
suspend fun testInlineAdditionalProperties(@Body requestBody: kotlin.collections.Map<kotlin.String, kotlin.String>): Unit
@FormUrlEncoded
@GET("/fake/jsonFormData")
suspend fun testJsonFormData(@Field("param") param: kotlin.String, @Field("param2") param2: kotlin.String): Unit
@PUT("/fake/test-query-paramters")
suspend fun testQueryParameterCollectionFormat(@Query("pipe") pipe: kotlin.Array<kotlin.String>, @Query("ioutil") ioutil: CSVParams, @Query("http") http: SPACEParams, @Query("url") url: CSVParams, @Query("context") context: kotlin.Array<kotlin.String>): Unit
}

View File

@ -0,0 +1,15 @@
package org.openapitools.client.apis
import org.openapitools.client.infrastructure.CollectionFormats.*
import retrofit2.http.*
import okhttp3.RequestBody
import okhttp3.ResponseBody
import okhttp3.MultipartBody
import org.openapitools.client.models.Client
interface FakeClassnameTags123Api {
@PATCH("/fake_classname_test")
suspend fun testClassname(@Body client: Client): Client
}

View File

@ -0,0 +1,44 @@
package org.openapitools.client.apis
import org.openapitools.client.infrastructure.CollectionFormats.*
import retrofit2.http.*
import okhttp3.RequestBody
import okhttp3.ResponseBody
import okhttp3.MultipartBody
import org.openapitools.client.models.ApiResponse
import org.openapitools.client.models.Pet
interface PetApi {
@POST("/pet")
suspend fun addPet(@Body pet: Pet): Unit
@DELETE("/pet/{petId}")
suspend fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Unit
@GET("/pet/findByStatus")
suspend fun findPetsByStatus(@Query("status") status: CSVParams): kotlin.Array<Pet>
@Deprecated("This api was deprecated")
@GET("/pet/findByTags")
suspend fun findPetsByTags(@Query("tags") tags: CSVParams): kotlin.Array<Pet>
@GET("/pet/{petId}")
suspend fun getPetById(@Path("petId") petId: kotlin.Long): Pet
@PUT("/pet")
suspend fun updatePet(@Body pet: Pet): Unit
@FormUrlEncoded
@POST("/pet/{petId}")
suspend fun updatePetWithForm(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String, @Field("status") status: kotlin.String): Unit
@Multipart
@POST("/pet/{petId}/uploadImage")
suspend fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part): ApiResponse
@Multipart
@POST("/fake/{petId}/uploadImageWithRequiredFile")
suspend fun uploadFileWithRequiredFile(@Path("petId") petId: kotlin.Long, @Part requiredFile: MultipartBody.Part, @Part("additionalMetadata") additionalMetadata: kotlin.String): ApiResponse
}

View File

@ -0,0 +1,24 @@
package org.openapitools.client.apis
import org.openapitools.client.infrastructure.CollectionFormats.*
import retrofit2.http.*
import okhttp3.RequestBody
import okhttp3.ResponseBody
import okhttp3.MultipartBody
import org.openapitools.client.models.Order
interface StoreApi {
@DELETE("/store/order/{order_id}")
suspend fun deleteOrder(@Path("order_id") orderId: kotlin.String): Unit
@GET("/store/inventory")
suspend fun getInventory(): kotlin.collections.Map<kotlin.String, kotlin.Int>
@GET("/store/order/{order_id}")
suspend fun getOrderById(@Path("order_id") orderId: kotlin.Long): Order
@POST("/store/order")
suspend fun placeOrder(@Body order: Order): Order
}

View File

@ -0,0 +1,36 @@
package org.openapitools.client.apis
import org.openapitools.client.infrastructure.CollectionFormats.*
import retrofit2.http.*
import okhttp3.RequestBody
import okhttp3.ResponseBody
import okhttp3.MultipartBody
import org.openapitools.client.models.User
interface UserApi {
@POST("/user")
suspend fun createUser(@Body user: User): Unit
@POST("/user/createWithArray")
suspend fun createUsersWithArrayInput(@Body user: kotlin.Array<User>): Unit
@POST("/user/createWithList")
suspend fun createUsersWithListInput(@Body user: kotlin.Array<User>): Unit
@DELETE("/user/{username}")
suspend fun deleteUser(@Path("username") username: kotlin.String): Unit
@GET("/user/{username}")
suspend fun getUserByName(@Path("username") username: kotlin.String): User
@GET("/user/login")
suspend fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): kotlin.String
@GET("/user/logout")
suspend fun logoutUser(): Unit
@PUT("/user/{username}")
suspend fun updateUser(@Path("username") username: kotlin.String, @Body user: User): Unit
}

View File

@ -0,0 +1,40 @@
package org.openapitools.client.infrastructure
import okhttp3.OkHttpClient
import retrofit2.Retrofit
import retrofit2.converter.scalars.ScalarsConverterFactory
import retrofit2.converter.gson.GsonConverterFactory
class ApiClient(
private var baseUrl: String = defaultBasePath,
private var okHttpClient: OkHttpClient
) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io:80/v2")
}
}
init {
normalizeBaseUrl()
}
val retrofitBuilder: Retrofit.Builder by lazy {
Retrofit.Builder()
.baseUrl(baseUrl)
.addConverterFactory(ScalarsConverterFactory.create())
.addConverterFactory(GsonConverterFactory.create(Serializer.gson))
}
fun <S> createService(serviceClass: Class<S>): S {
return retrofitBuilder.client(okHttpClient).build().create(serviceClass)
}
private fun normalizeBaseUrl() {
if (!baseUrl.endsWith("/")) {
baseUrl += "/"
}
}
}

View File

@ -0,0 +1,33 @@
package org.openapitools.client.infrastructure
import com.google.gson.TypeAdapter
import com.google.gson.stream.JsonReader
import com.google.gson.stream.JsonWriter
import com.google.gson.stream.JsonToken.NULL
import java.io.IOException
class ByteArrayAdapter : TypeAdapter<ByteArray>() {
@Throws(IOException::class)
override fun write(out: JsonWriter?, value: ByteArray?) {
if (value == null) {
out?.nullValue()
} else {
out?.value(String(value))
}
}
@Throws(IOException::class)
override fun read(out: JsonReader?): ByteArray? {
out ?: return null
when (out.peek()) {
NULL -> {
out.nextNull()
return null
}
else -> {
return out.nextString().toByteArray()
}
}
}
}

View File

@ -0,0 +1,56 @@
package org.openapitools.client.infrastructure
class CollectionFormats {
open class CSVParams {
var params: List<String>
constructor(params: List<String>) {
this.params = params
}
constructor(vararg params: String) {
this.params = listOf(*params)
}
override fun toString(): String {
return params.joinToString(",")
}
}
open class SSVParams : CSVParams {
constructor(params: List<String>) : super(params)
constructor(vararg params: String) : super(*params)
override fun toString(): String {
return params.joinToString(" ")
}
}
class TSVParams : CSVParams {
constructor(params: List<String>) : super(params)
constructor(vararg params: String) : super(*params)
override fun toString(): String {
return params.joinToString("\t")
}
}
class PIPESParams : CSVParams {
constructor(params: List<String>) : super(params)
constructor(vararg params: String) : super(*params)
override fun toString(): String {
return params.joinToString("|")
}
}
class SPACEParams : SSVParams()
}

View File

@ -0,0 +1,37 @@
package org.openapitools.client.infrastructure
import com.google.gson.TypeAdapter
import com.google.gson.stream.JsonReader
import com.google.gson.stream.JsonWriter
import com.google.gson.stream.JsonToken.NULL
import java.io.IOException
import java.text.DateFormat
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter<Date>() {
@Throws(IOException::class)
override fun write(out: JsonWriter?, value: Date?) {
if (value == null) {
out?.nullValue()
} else {
out?.value(formatter.format(value))
}
}
@Throws(IOException::class)
override fun read(out: JsonReader?): Date? {
out ?: return null
when (out.peek()) {
NULL -> {
out.nextNull()
return null
}
else -> {
return formatter.parse(out.nextString())
}
}
}
}

View File

@ -0,0 +1,35 @@
package org.openapitools.client.infrastructure
import com.google.gson.TypeAdapter
import com.google.gson.stream.JsonReader
import com.google.gson.stream.JsonWriter
import com.google.gson.stream.JsonToken.NULL
import java.io.IOException
import java.time.LocalDate
import java.time.format.DateTimeFormatter
class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter<LocalDate>() {
@Throws(IOException::class)
override fun write(out: JsonWriter?, value: LocalDate?) {
if (value == null) {
out?.nullValue()
} else {
out?.value(formatter.format(value))
}
}
@Throws(IOException::class)
override fun read(out: JsonReader?): LocalDate? {
out ?: return null
when (out.peek()) {
NULL -> {
out.nextNull()
return null
}
else -> {
return LocalDate.parse(out.nextString(), formatter)
}
}
}
}

View File

@ -0,0 +1,35 @@
package org.openapitools.client.infrastructure
import com.google.gson.TypeAdapter
import com.google.gson.stream.JsonReader
import com.google.gson.stream.JsonWriter
import com.google.gson.stream.JsonToken.NULL
import java.io.IOException
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter<LocalDateTime>() {
@Throws(IOException::class)
override fun write(out: JsonWriter?, value: LocalDateTime?) {
if (value == null) {
out?.nullValue()
} else {
out?.value(formatter.format(value))
}
}
@Throws(IOException::class)
override fun read(out: JsonReader?): LocalDateTime? {
out ?: return null
when (out.peek()) {
NULL -> {
out.nextNull()
return null
}
else -> {
return LocalDateTime.parse(out.nextString(), formatter)
}
}
}
}

View File

@ -0,0 +1,35 @@
package org.openapitools.client.infrastructure
import com.google.gson.TypeAdapter
import com.google.gson.stream.JsonReader
import com.google.gson.stream.JsonWriter
import com.google.gson.stream.JsonToken.NULL
import java.io.IOException
import java.time.OffsetDateTime
import java.time.format.DateTimeFormatter
class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter<OffsetDateTime>() {
@Throws(IOException::class)
override fun write(out: JsonWriter?, value: OffsetDateTime?) {
if (value == null) {
out?.nullValue()
} else {
out?.value(formatter.format(value))
}
}
@Throws(IOException::class)
override fun read(out: JsonReader?): OffsetDateTime? {
out ?: return null
when (out.peek()) {
NULL -> {
out.nextNull()
return null
}
else -> {
return OffsetDateTime.parse(out.nextString(), formatter)
}
}
}
}

View File

@ -0,0 +1,24 @@
package org.openapitools.client.infrastructure
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import java.time.LocalDate
import java.time.LocalDateTime
import java.time.OffsetDateTime
import java.util.UUID
import java.util.Date
object Serializer {
@JvmStatic
val gsonBuilder: GsonBuilder = GsonBuilder()
.registerTypeAdapter(Date::class.java, DateAdapter())
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())
.registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter())
@JvmStatic
val gson: Gson by lazy {
gsonBuilder.create()
}
}

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