forked from loafle/openapi-generator-original
[kotlin-client][kotlin-server] feature: allow creation of kotlin data classes that implement java.io.Serializable (#3997)
* feat: allow creation of kotlin data classes that implement java.io.Serializable, by adding the config option serializableModel=(true|false) * docs: add markdown docu for new configOption serializableModel * fix: do not use parcelize in script * update kotlin samples * add the option, update the doc
This commit is contained in:
parent
31827f5f35
commit
baa53cbf57
@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8 -o samples/client/petstore/kotlin $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8,serializableModel=true -o samples/client/petstore/kotlin $@"
|
||||
|
||||
java ${JAVA_OPTS} -jar ${executable} ${ags}
|
||||
|
@ -27,7 +27,7 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-string --additional-properties dateLibrary=string -o samples/client/petstore/kotlin-string $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-string --additional-properties dateLibrary=string,serializableModel=true -o samples/client/petstore/kotlin-string $@"
|
||||
|
||||
java ${JAVA_OPTS} -jar ${executable} ${ags}
|
||||
|
||||
|
@ -27,7 +27,7 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-server -g kotlin-server --library=ktor -o samples/server/petstore/kotlin-server/ktor --additional-properties hideGenerationTimestamp=true $@"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-server -g kotlin-server --library=ktor -o samples/server/petstore/kotlin-server/ktor --additional-properties hideGenerationTimestamp=true,serializableModel=true $@"
|
||||
|
||||
java ${JAVA_OPTS} -jar ${executable} ${ags}
|
||||
|
||||
|
@ -26,7 +26,7 @@ then
|
||||
fi
|
||||
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/server/petstore/kotlin-springboot --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true"
|
||||
ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/server/petstore/kotlin-springboot --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,serializableModel=true"
|
||||
|
||||
echo "Cleaning previously generated files if any from samples/server/petstore/kotlin-springboot"
|
||||
rm -rf samples/server/petstore/kotlin-springboot
|
||||
|
@ -26,7 +26,7 @@ then
|
||||
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 -o samples/openapi3/client/petstore/kotlin $@"
|
||||
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 $@"
|
||||
|
||||
echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin"
|
||||
rm -rf samples/openapi3/client/petstore/kotlin
|
||||
|
@ -26,7 +26,7 @@ then
|
||||
fi
|
||||
|
||||
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/openapi3/server/petstore/kotlin-springboot --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true"
|
||||
ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/openapi3/server/petstore/kotlin-springboot --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,serializableModel=true"
|
||||
|
||||
echo "Cleaning previously generated files if any from samples/server/openapi3/petstore/kotlin-springboot"
|
||||
rm -rf samples/server/openapi3/petstore/kotlin-springboot
|
||||
|
@ -16,6 +16,7 @@ sidebar_label: kotlin-server
|
||||
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase|
|
||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|
||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||
|library|library template (sub-template)|<dl><dt>**ktor**</dt><dd>ktor framework</dd><dl>|ktor|
|
||||
|featureAutoHead|Automatically provide responses to HEAD requests for existing routes that have the GET verb defined.| |true|
|
||||
|featureConditionalHeaders|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |false|
|
||||
|
@ -16,6 +16,7 @@ sidebar_label: kotlin-spring
|
||||
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase|
|
||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|
||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||
|title|server title name or client service name| |OpenAPI Kotlin Spring|
|
||||
|basePackage|base package (invokerPackage) for generated code| |org.openapitools|
|
||||
|serverPort|configuration the port in which the sever is to run on| |8080|
|
||||
|
@ -16,3 +16,4 @@ sidebar_label: kotlin-vertx
|
||||
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase|
|
||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|
||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||
|
@ -16,6 +16,7 @@ sidebar_label: kotlin
|
||||
|enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase|
|
||||
|serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi|
|
||||
|parcelizeModels|toggle "@Parcelize" for generated models| |null|
|
||||
|serializableModel|boolean - toggle "implements Serializable" for generated models| |null|
|
||||
|dateLibrary|Option. Date library to use|<dl><dt>**string**</dt><dd>String</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (jvm only)</dd><dt>**threetenbp**</dt><dd>Threetenbp (jvm only)</dd><dl>|java8|
|
||||
|collectionType|Option. Collection type to use|<dl><dt>**array**</dt><dd>kotlin.Array</dd><dt>**list**</dt><dd>kotlin.collections.List</dd><dl>|array|
|
||||
|library|Library template (sub-template) to use|<dl><dt>**jvm**</dt><dd>Platform: Java Virtual Machine. HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.8.1.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.2.4. JSON processing: Kotlinx Serialization: 0.12.0.</dd><dl>|jvm|
|
||||
|
@ -54,6 +54,8 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
protected String modelDocPath = "docs/";
|
||||
protected boolean parcelizeModels = false;
|
||||
|
||||
protected boolean serializableModel = false;
|
||||
|
||||
protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.camelCase;
|
||||
protected SERIALIZATION_LIBRARY_TYPE serializationLibrary = SERIALIZATION_LIBRARY_TYPE.moshi;
|
||||
|
||||
@ -215,6 +217,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
cliOptions.add(serializationLibraryOpt.defaultValue(serializationLibrary.name()));
|
||||
|
||||
cliOptions.add(new CliOption(CodegenConstants.PARCELIZE_MODELS, CodegenConstants.PARCELIZE_MODELS_DESC));
|
||||
cliOptions.add(new CliOption(CodegenConstants.SERIALIZABLE_MODEL, CodegenConstants.SERIALIZABLE_MODEL_DESC));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -411,6 +414,12 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
LOGGER.warn(CodegenConstants.INVOKER_PACKAGE + " with " + this.getName() + " generator is ignored. Use " + CodegenConstants.PACKAGE_NAME + ".");
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.SERIALIZABLE_MODEL)) {
|
||||
this.setSerializableModel(Boolean.valueOf((String) additionalProperties.get(CodegenConstants.SERIALIZABLE_MODEL)));
|
||||
} else {
|
||||
additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel);
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.PARCELIZE_MODELS)) {
|
||||
this.setParcelizeModels(Boolean.valueOf((String) additionalProperties.get(CodegenConstants.PARCELIZE_MODELS)));
|
||||
} else {
|
||||
@ -460,6 +469,13 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
this.parcelizeModels = parcelizeModels;
|
||||
}
|
||||
|
||||
public boolean isSerializableModel() {
|
||||
return serializableModel;
|
||||
}
|
||||
|
||||
public void setSerializableModel(boolean serializableModel) {
|
||||
this.serializableModel = serializableModel;
|
||||
}
|
||||
/**
|
||||
* Return the sanitized variable name for enum
|
||||
*
|
||||
|
@ -15,6 +15,9 @@ import kotlinx.android.parcel.Parcelize
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.internal.CommonEnumSerializer
|
||||
{{/multiplatform}}
|
||||
{{#serializableModel}}
|
||||
import java.io.Serializable
|
||||
{{/serializableModel}}
|
||||
/**
|
||||
* {{{description}}}
|
||||
{{#vars}}
|
||||
@ -31,7 +34,9 @@ data class {{classname}} (
|
||||
{{/-last}}{{/requiredVars}}{{#hasRequired}}{{#hasOptional}},
|
||||
{{/hasOptional}}{{/hasRequired}}{{#optionalVars}}{{>data_class_opt_var}}{{^-last}},
|
||||
{{/-last}}{{/optionalVars}}
|
||||
){{#parcelizeModels}} : Parcelable{{/parcelizeModels}}
|
||||
) {{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}}
|
||||
{{^parcelizeModels}}{{#serializableModel}}: Serializable {{/serializableModel}}{{/parcelizeModels}}
|
||||
{{#parcelizeModels}}{{#serializableModel}} : Parcelable, Serializable {{/serializableModel}}{{/parcelizeModels}}
|
||||
{{#hasEnums}}
|
||||
{
|
||||
{{#vars}}{{#isEnum}}
|
||||
|
@ -3,6 +3,9 @@ import android.os.Parcelable
|
||||
import kotlinx.android.parcel.Parcelize
|
||||
|
||||
{{/parcelizeModels}}
|
||||
{{#serializableModel}}
|
||||
import java.io.Serializable
|
||||
{{/serializableModel}}
|
||||
/**
|
||||
* {{{description}}}
|
||||
{{#vars}}
|
||||
@ -18,7 +21,10 @@ data class {{classname}} (
|
||||
{{/-last}}{{/requiredVars}}{{#hasRequired}}{{#hasOptional}},
|
||||
{{/hasOptional}}{{/hasRequired}}{{#optionalVars}}{{>data_class_opt_var}}{{^-last}},
|
||||
{{/-last}}{{/optionalVars}}
|
||||
){{#parcelizeModels}} : Parcelable{{/parcelizeModels}} {
|
||||
) {{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}}
|
||||
{{^parcelizeModels}}{{#serializableModel}}: Serializable {{/serializableModel}}{{/parcelizeModels}}
|
||||
{{#parcelizeModels}}{{#serializableModel}} : Parcelable, Serializable {{/serializableModel}}{{/parcelizeModels}}
|
||||
{
|
||||
{{#hasEnums}}{{#vars}}{{#isEnum}}
|
||||
/**
|
||||
* {{{description}}}
|
||||
|
@ -27,3 +27,5 @@ data class ApiResponse (
|
||||
@SerialName(value = "message") val message: kotlin.String? = null
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
@ -25,3 +25,5 @@ data class Category (
|
||||
@SerialName(value = "name") val name: kotlin.String? = null
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
@ -33,6 +33,8 @@ data class Order (
|
||||
@SerialName(value = "status") val status: Order.Status? = null,
|
||||
@SerialName(value = "complete") val complete: kotlin.Boolean? = null
|
||||
)
|
||||
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
|
@ -35,6 +35,8 @@ data class Pet (
|
||||
/* pet status in the store */
|
||||
@SerialName(value = "status") val status: Pet.Status? = null
|
||||
)
|
||||
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
|
@ -25,3 +25,5 @@ data class Tag (
|
||||
@SerialName(value = "name") val name: kotlin.String? = null
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
@ -38,3 +38,5 @@ data class User (
|
||||
@SerialName(value = "userStatus") val userStatus: kotlin.Int? = null
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* Describes the result of uploading an image resource
|
||||
* @param code
|
||||
@ -28,4 +29,6 @@ data class ApiResponse (
|
||||
@Json(name = "message")
|
||||
val message: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* A category for a pet
|
||||
* @param id
|
||||
@ -25,4 +26,6 @@ data class Category (
|
||||
@Json(name = "name")
|
||||
val name: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* An order for a pets from the pet store
|
||||
* @param id
|
||||
@ -38,6 +39,8 @@ data class Order (
|
||||
@Json(name = "complete")
|
||||
val complete: kotlin.Boolean? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
|
@ -15,6 +15,7 @@ import org.openapitools.client.models.Category
|
||||
import org.openapitools.client.models.Tag
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* A pet for sale in the pet store
|
||||
* @param id
|
||||
@ -40,6 +41,8 @@ data class Pet (
|
||||
@Json(name = "status")
|
||||
val status: Pet.Status? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* A tag for a pet
|
||||
* @param id
|
||||
@ -25,4 +26,6 @@ data class Tag (
|
||||
@Json(name = "name")
|
||||
val name: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* A User who is purchasing from the pet store
|
||||
* @param id
|
||||
@ -44,4 +45,6 @@ data class User (
|
||||
@Json(name = "userStatus")
|
||||
val userStatus: kotlin.Int? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -29,3 +29,5 @@ data class ApiResponse (
|
||||
val message: kotlin.String? = null
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
@ -26,3 +26,5 @@ data class Category (
|
||||
val name: kotlin.String? = null
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
@ -38,6 +38,8 @@ data class Order (
|
||||
@Json(name = "complete")
|
||||
val complete: kotlin.Boolean? = null
|
||||
)
|
||||
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
|
@ -40,6 +40,8 @@ data class Pet (
|
||||
@Json(name = "status")
|
||||
val status: Pet.Status? = null
|
||||
)
|
||||
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
|
@ -26,3 +26,5 @@ data class Tag (
|
||||
val name: kotlin.String? = null
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
@ -45,3 +45,5 @@ data class User (
|
||||
val userStatus: kotlin.Int? = null
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* Describes the result of uploading an image resource
|
||||
* @param code
|
||||
@ -28,4 +29,6 @@ data class ApiResponse (
|
||||
@Json(name = "message")
|
||||
val message: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* A category for a pet
|
||||
* @param id
|
||||
@ -25,4 +26,6 @@ data class Category (
|
||||
@Json(name = "name")
|
||||
val name: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* An order for a pets from the pet store
|
||||
* @param id
|
||||
@ -38,6 +39,8 @@ data class Order (
|
||||
@Json(name = "complete")
|
||||
val complete: kotlin.Boolean? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
|
@ -15,6 +15,7 @@ import org.openapitools.client.models.Category
|
||||
import org.openapitools.client.models.Tag
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* A pet for sale in the pet store
|
||||
* @param id
|
||||
@ -40,6 +41,8 @@ data class Pet (
|
||||
@Json(name = "status")
|
||||
val status: Pet.Status? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* A tag for a pet
|
||||
* @param id
|
||||
@ -25,4 +26,6 @@ data class Tag (
|
||||
@Json(name = "name")
|
||||
val name: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* A User who is purchasing from the pet store
|
||||
* @param id
|
||||
@ -44,4 +45,6 @@ data class User (
|
||||
@Json(name = "userStatus")
|
||||
val userStatus: kotlin.Int? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -1 +1 @@
|
||||
4.1.1-SNAPSHOT
|
||||
5.0.0-SNAPSHOT
|
@ -2,8 +2,8 @@
|
||||
|
||||
## Requires
|
||||
|
||||
* Kotlin 1.1.2
|
||||
* Gradle 3.3
|
||||
* Kotlin 1.3.41
|
||||
* Gradle 4.9
|
||||
|
||||
## Build
|
||||
|
||||
@ -50,6 +50,7 @@ Class | Method | HTTP request | Description
|
||||
*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
|
||||
|
@ -1,13 +1,13 @@
|
||||
group 'org.openapitools'
|
||||
version '1.0.0'
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion = '3.3'
|
||||
wrapper {
|
||||
gradleVersion = '4.9'
|
||||
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
|
||||
}
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.1.2'
|
||||
ext.kotlin_version = '1.3.41'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@ -23,11 +23,15 @@ repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
|
||||
compile "com.squareup.moshi:moshi-kotlin:1.5.0"
|
||||
compile "com.squareup.moshi:moshi-adapters:1.5.0"
|
||||
compile "com.squareup.okhttp3:okhttp:3.8.0"
|
||||
compile "org.threeten:threetenbp:1.3.6"
|
||||
testCompile "io.kotlintest:kotlintest:2.0.2"
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
||||
compile "com.squareup.moshi:moshi-kotlin:1.8.0"
|
||||
compile "com.squareup.moshi:moshi-adapters:1.8.0"
|
||||
compile "com.squareup.okhttp3:okhttp:4.0.1"
|
||||
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.1.0"
|
||||
}
|
||||
|
@ -1 +1,2 @@
|
||||
|
||||
rootProject.name = 'kotlin-petstore-client'
|
@ -12,9 +12,12 @@ fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
|
||||
|
||||
val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" }
|
||||
|
||||
fun <T: Any?> toMultiValue(items: List<T>, collectionFormat: String, map: (item: Any?) -> String = defaultMultiValueConverter): List<String> {
|
||||
fun <T : Any?> toMultiValue(items: Array<T>, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter)
|
||||
= toMultiValue(items.asIterable(), collectionFormat, map)
|
||||
|
||||
fun <T : Any?> toMultiValue(items: Iterable<T>, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List<String> {
|
||||
return when(collectionFormat) {
|
||||
"multi" -> items.map(map)
|
||||
else -> listOf(items.map(map).joinToString(separator = collectionDelimiter(collectionFormat)))
|
||||
else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map))
|
||||
}
|
||||
}
|
@ -13,16 +13,19 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param mapProperty
|
||||
* @param mapOfMapProperty
|
||||
*/
|
||||
|
||||
data class AdditionalPropertiesClass (
|
||||
@Json(name = "map_property")
|
||||
val mapProperty: kotlin.collections.Map<kotlin.String, kotlin.String>? = null,
|
||||
@Json(name = "map_of_map_property")
|
||||
val mapOfMapProperty: kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,16 +13,19 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param className
|
||||
* @param color
|
||||
*/
|
||||
|
||||
data class Animal (
|
||||
@Json(name = "className")
|
||||
val className: kotlin.String,
|
||||
@Json(name = "color")
|
||||
val color: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,12 +13,14 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param code
|
||||
* @param type
|
||||
* @param message
|
||||
*/
|
||||
|
||||
data class ApiResponse (
|
||||
@Json(name = "code")
|
||||
val code: kotlin.Int? = null,
|
||||
@ -27,5 +29,6 @@ data class ApiResponse (
|
||||
@Json(name = "message")
|
||||
val message: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,13 +13,16 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param arrayArrayNumber
|
||||
*/
|
||||
|
||||
data class ArrayOfArrayOfNumberOnly (
|
||||
@Json(name = "ArrayArrayNumber")
|
||||
val arrayArrayNumber: kotlin.Array<kotlin.Array<java.math.BigDecimal>>? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,13 +13,16 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param arrayNumber
|
||||
*/
|
||||
|
||||
data class ArrayOfNumberOnly (
|
||||
@Json(name = "ArrayNumber")
|
||||
val arrayNumber: kotlin.Array<java.math.BigDecimal>? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -14,12 +14,14 @@ package org.openapitools.client.models
|
||||
import org.openapitools.client.models.ReadOnlyFirst
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param arrayOfString
|
||||
* @param arrayArrayOfInteger
|
||||
* @param arrayArrayOfModel
|
||||
*/
|
||||
|
||||
data class ArrayTest (
|
||||
@Json(name = "array_of_string")
|
||||
val arrayOfString: kotlin.Array<kotlin.String>? = null,
|
||||
@ -28,5 +30,6 @@ data class ArrayTest (
|
||||
@Json(name = "array_array_of_model")
|
||||
val arrayArrayOfModel: kotlin.Array<kotlin.Array<ReadOnlyFirst>>? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param smallCamel
|
||||
@ -22,6 +23,7 @@ import com.squareup.moshi.Json
|
||||
* @param scAETHFlowPoints
|
||||
* @param ATT_NAME Name of the pet
|
||||
*/
|
||||
|
||||
data class Capitalization (
|
||||
@Json(name = "smallCamel")
|
||||
val smallCamel: kotlin.String? = null,
|
||||
@ -37,5 +39,6 @@ data class Capitalization (
|
||||
@Json(name = "ATT_NAME")
|
||||
val ATT_NAME: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -15,10 +15,12 @@ import org.openapitools.client.models.Animal
|
||||
import org.openapitools.client.models.CatAllOf
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param declawed
|
||||
*/
|
||||
|
||||
data class Cat (
|
||||
@Json(name = "className")
|
||||
val className: kotlin.String,
|
||||
@ -27,5 +29,6 @@ data class Cat (
|
||||
@Json(name = "color")
|
||||
val color: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,13 +13,16 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param declawed
|
||||
*/
|
||||
|
||||
data class CatAllOf (
|
||||
@Json(name = "declawed")
|
||||
val declawed: kotlin.Boolean? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,16 +13,19 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @param name
|
||||
*/
|
||||
|
||||
data class Category (
|
||||
@Json(name = "name")
|
||||
val name: kotlin.String,
|
||||
@Json(name = "id")
|
||||
val id: kotlin.Long? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,13 +13,16 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* Model for testing model with \"_class\" property
|
||||
* @param propertyClass
|
||||
*/
|
||||
|
||||
data class ClassModel (
|
||||
@Json(name = "_class")
|
||||
val propertyClass: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,13 +13,16 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param client
|
||||
*/
|
||||
|
||||
data class Client (
|
||||
@Json(name = "client")
|
||||
val client: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -15,10 +15,12 @@ import org.openapitools.client.models.Animal
|
||||
import org.openapitools.client.models.DogAllOf
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param breed
|
||||
*/
|
||||
|
||||
data class Dog (
|
||||
@Json(name = "className")
|
||||
val className: kotlin.String,
|
||||
@ -27,5 +29,6 @@ data class Dog (
|
||||
@Json(name = "color")
|
||||
val color: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,13 +13,16 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param breed
|
||||
*/
|
||||
|
||||
data class DogAllOf (
|
||||
@Json(name = "breed")
|
||||
val breed: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,44 +13,50 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param justSymbol
|
||||
* @param arrayEnum
|
||||
*/
|
||||
|
||||
data class EnumArrays (
|
||||
@Json(name = "just_symbol")
|
||||
val justSymbol: EnumArrays.JustSymbol? = null,
|
||||
@Json(name = "array_enum")
|
||||
val arrayEnum: kotlin.Array<EnumArrays.ArrayEnum>? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* Values: greaterThanEqual,dollar
|
||||
*/
|
||||
|
||||
enum class JustSymbol(val value: kotlin.String){
|
||||
|
||||
@Json(name = ">=") greaterThanEqual(">="),
|
||||
|
||||
@Json(name = "$") dollar("$");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
/**
|
||||
*
|
||||
* Values: fish,crab
|
||||
*/
|
||||
|
||||
enum class ArrayEnum(val value: kotlin.String){
|
||||
|
||||
@Json(name = "fish") fish("fish"),
|
||||
|
||||
@Json(name = "crab") crab("crab");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ import com.squareup.moshi.Json
|
||||
*
|
||||
* Values: abc,minusEfg,leftParenthesisXyzRightParenthesis
|
||||
*/
|
||||
|
||||
enum class EnumClass(val value: kotlin.String){
|
||||
|
||||
|
||||
@ -33,5 +34,6 @@ enum class EnumClass(val value: kotlin.String){
|
||||
leftParenthesisXyzRightParenthesis("(xyz)");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@ import org.openapitools.client.models.OuterEnumInteger
|
||||
import org.openapitools.client.models.OuterEnumIntegerDefaultValue
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param enumString
|
||||
@ -28,6 +29,7 @@ import com.squareup.moshi.Json
|
||||
* @param outerEnumDefaultValue
|
||||
* @param outerEnumIntegerDefaultValue
|
||||
*/
|
||||
|
||||
data class EnumTest (
|
||||
@Json(name = "enum_string_required")
|
||||
val enumStringRequired: EnumTest.EnumStringRequired,
|
||||
@ -46,12 +48,15 @@ data class EnumTest (
|
||||
@Json(name = "outerEnumIntegerDefaultValue")
|
||||
val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* Values: uPPER,lower,eMPTY
|
||||
*/
|
||||
|
||||
enum class EnumString(val value: kotlin.String){
|
||||
|
||||
@Json(name = "UPPER") uPPER("UPPER"),
|
||||
@ -60,14 +65,14 @@ data class EnumTest (
|
||||
|
||||
@Json(name = "") eMPTY("");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
/**
|
||||
*
|
||||
* Values: uPPER,lower,eMPTY
|
||||
*/
|
||||
|
||||
enum class EnumStringRequired(val value: kotlin.String){
|
||||
|
||||
@Json(name = "UPPER") uPPER("UPPER"),
|
||||
@ -76,35 +81,36 @@ data class EnumTest (
|
||||
|
||||
@Json(name = "") eMPTY("");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
/**
|
||||
*
|
||||
* Values: _1,minus1
|
||||
*/
|
||||
|
||||
enum class EnumInteger(val value: kotlin.Int){
|
||||
|
||||
@Json(name = 1) _1(1),
|
||||
|
||||
@Json(name = -1) minus1(-1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
/**
|
||||
*
|
||||
* Values: _1period1,minus1Period2
|
||||
*/
|
||||
|
||||
enum class EnumNumber(val value: kotlin.Double){
|
||||
|
||||
@Json(name = 1.1) _1period1(1.1),
|
||||
|
||||
@Json(name = -1.2) minus1Period2(-1.2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -13,16 +13,19 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param file
|
||||
* @param files
|
||||
*/
|
||||
|
||||
data class FileSchemaTestClass (
|
||||
@Json(name = "file")
|
||||
val file: java.io.File? = null,
|
||||
@Json(name = "files")
|
||||
val files: kotlin.Array<java.io.File>? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,13 +13,16 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param bar
|
||||
*/
|
||||
|
||||
data class Foo (
|
||||
@Json(name = "bar")
|
||||
val bar: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param integer
|
||||
@ -31,6 +32,7 @@ import com.squareup.moshi.Json
|
||||
* @param patternWithDigits A string that is a 10 digit number. Can have leading zeros.
|
||||
* @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
|
||||
*/
|
||||
|
||||
data class FormatTest (
|
||||
@Json(name = "number")
|
||||
val number: java.math.BigDecimal,
|
||||
@ -65,5 +67,6 @@ data class FormatTest (
|
||||
@Json(name = "pattern_with_digits_and_delimiter")
|
||||
val patternWithDigitsAndDelimiter: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,16 +13,19 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param bar
|
||||
* @param foo
|
||||
*/
|
||||
|
||||
data class HasOnlyReadOnly (
|
||||
@Json(name = "bar")
|
||||
val bar: kotlin.String? = null,
|
||||
@Json(name = "foo")
|
||||
val foo: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,13 +13,16 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
|
||||
* @param nullableMessage
|
||||
*/
|
||||
|
||||
data class HealthCheckResult (
|
||||
@Json(name = "NullableMessage")
|
||||
val nullableMessage: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,11 +13,13 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
|
||||
data class InlineObject (
|
||||
/* Updated name of the pet */
|
||||
@Json(name = "name")
|
||||
@ -26,5 +28,6 @@ data class InlineObject (
|
||||
@Json(name = "status")
|
||||
val status: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,11 +13,13 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param file file to upload
|
||||
*/
|
||||
|
||||
data class InlineObject1 (
|
||||
/* Additional data to pass to server */
|
||||
@Json(name = "additionalMetadata")
|
||||
@ -26,5 +28,6 @@ data class InlineObject1 (
|
||||
@Json(name = "file")
|
||||
val file: java.io.File? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,11 +13,13 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param enumFormStringArray Form parameter enum test (string array)
|
||||
* @param enumFormString Form parameter enum test (string)
|
||||
*/
|
||||
|
||||
data class InlineObject2 (
|
||||
/* Form parameter enum test (string array) */
|
||||
@Json(name = "enum_form_string_array")
|
||||
@ -26,26 +28,29 @@ data class InlineObject2 (
|
||||
@Json(name = "enum_form_string")
|
||||
val enumFormString: InlineObject2.EnumFormString? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
* Form parameter enum test (string array)
|
||||
* Values: greaterThan,dollar
|
||||
*/
|
||||
|
||||
enum class EnumFormStringArray(val value: kotlin.String){
|
||||
|
||||
@Json(name = ">") greaterThan(">"),
|
||||
|
||||
@Json(name = "$") dollar("$");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
/**
|
||||
* Form parameter enum test (string)
|
||||
* Values: abc,minusEfg,leftParenthesisXyzRightParenthesis
|
||||
*/
|
||||
|
||||
enum class EnumFormString(val value: kotlin.String){
|
||||
|
||||
@Json(name = "_abc") abc("_abc"),
|
||||
@ -54,7 +59,8 @@ data class InlineObject2 (
|
||||
|
||||
@Json(name = "(xyz)") leftParenthesisXyzRightParenthesis("(xyz)");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param integer None
|
||||
@ -30,6 +31,7 @@ import com.squareup.moshi.Json
|
||||
* @param password None
|
||||
* @param callback None
|
||||
*/
|
||||
|
||||
data class InlineObject3 (
|
||||
/* None */
|
||||
@Json(name = "number")
|
||||
@ -74,5 +76,6 @@ data class InlineObject3 (
|
||||
@Json(name = "callback")
|
||||
val callback: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,11 +13,13 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param param field1
|
||||
* @param param2 field2
|
||||
*/
|
||||
|
||||
data class InlineObject4 (
|
||||
/* field1 */
|
||||
@Json(name = "param")
|
||||
@ -26,5 +28,6 @@ data class InlineObject4 (
|
||||
@Json(name = "param2")
|
||||
val param2: kotlin.String
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,11 +13,13 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param requiredFile file to upload
|
||||
*/
|
||||
|
||||
data class InlineObject5 (
|
||||
/* file to upload */
|
||||
@Json(name = "requiredFile")
|
||||
@ -26,5 +28,6 @@ data class InlineObject5 (
|
||||
@Json(name = "additionalMetadata")
|
||||
val additionalMetadata: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -14,13 +14,16 @@ package org.openapitools.client.models
|
||||
import org.openapitools.client.models.Foo
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param string
|
||||
*/
|
||||
|
||||
data class InlineResponseDefault (
|
||||
@Json(name = "string")
|
||||
val string: Foo? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,13 +13,16 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param `123minusList`
|
||||
* @param ``123minusList``
|
||||
*/
|
||||
|
||||
data class List (
|
||||
@Json(name = "123-list")
|
||||
val `123minusList`: kotlin.String? = null
|
||||
val ``123minusList``: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param mapMapOfString
|
||||
@ -20,6 +21,7 @@ import com.squareup.moshi.Json
|
||||
* @param directMap
|
||||
* @param indirectMap
|
||||
*/
|
||||
|
||||
data class MapTest (
|
||||
@Json(name = "map_map_of_string")
|
||||
val mapMapOfString: kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>? = null,
|
||||
@ -30,19 +32,23 @@ data class MapTest (
|
||||
@Json(name = "indirect_map")
|
||||
val indirectMap: kotlin.collections.Map<kotlin.String, kotlin.Boolean>? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* Values: uPPER,lower
|
||||
*/
|
||||
|
||||
enum class MapOfEnumString(val value: kotlin.collections.Map<kotlin.String, kotlin.String>){
|
||||
|
||||
@Json(name = "UPPER") uPPER("UPPER"),
|
||||
|
||||
@Json(name = "lower") lower("lower");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -14,12 +14,14 @@ package org.openapitools.client.models
|
||||
import org.openapitools.client.models.Animal
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param uuid
|
||||
* @param dateTime
|
||||
* @param map
|
||||
*/
|
||||
|
||||
data class MixedPropertiesAndAdditionalPropertiesClass (
|
||||
@Json(name = "uuid")
|
||||
val uuid: java.util.UUID? = null,
|
||||
@ -28,5 +30,6 @@ data class MixedPropertiesAndAdditionalPropertiesClass (
|
||||
@Json(name = "map")
|
||||
val map: kotlin.collections.Map<kotlin.String, Animal>? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,16 +13,19 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* Model for testing model name starting with number
|
||||
* @param name
|
||||
* @param propertyClass
|
||||
*/
|
||||
|
||||
data class Model200Response (
|
||||
@Json(name = "name")
|
||||
val name: kotlin.Int? = null,
|
||||
@Json(name = "class")
|
||||
val propertyClass: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,13 +13,15 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* Model for testing model name same as property name
|
||||
* @param name
|
||||
* @param snakeCase
|
||||
* @param property
|
||||
* @param `123number`
|
||||
* @param ``123number``
|
||||
*/
|
||||
|
||||
data class Name (
|
||||
@Json(name = "name")
|
||||
val name: kotlin.Int,
|
||||
@ -28,7 +30,8 @@ data class Name (
|
||||
@Json(name = "property")
|
||||
val property: kotlin.String? = null,
|
||||
@Json(name = "123Number")
|
||||
val `123number`: kotlin.Int? = null
|
||||
val ``123number``: kotlin.Int? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param integerProp
|
||||
@ -28,6 +29,7 @@ import com.squareup.moshi.Json
|
||||
* @param objectAndItemsNullableProp
|
||||
* @param objectItemsNullable
|
||||
*/
|
||||
|
||||
data class NullableClass (
|
||||
@Json(name = "integer_prop")
|
||||
val integerProp: kotlin.Int? = null,
|
||||
@ -54,5 +56,6 @@ data class NullableClass (
|
||||
@Json(name = "object_items_nullable")
|
||||
val objectItemsNullable: kotlin.collections.Map<kotlin.String, kotlin.Any>? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,13 +13,16 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param justNumber
|
||||
*/
|
||||
|
||||
data class NumberOnly (
|
||||
@Json(name = "JustNumber")
|
||||
val justNumber: java.math.BigDecimal? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
@ -22,6 +23,7 @@ import com.squareup.moshi.Json
|
||||
* @param status Order Status
|
||||
* @param complete
|
||||
*/
|
||||
|
||||
data class Order (
|
||||
@Json(name = "id")
|
||||
val id: kotlin.Long? = null,
|
||||
@ -37,12 +39,15 @@ data class Order (
|
||||
@Json(name = "complete")
|
||||
val complete: kotlin.Boolean? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
* Order Status
|
||||
* Values: placed,approved,delivered
|
||||
*/
|
||||
|
||||
enum class Status(val value: kotlin.String){
|
||||
|
||||
@Json(name = "placed") placed("placed"),
|
||||
@ -51,7 +56,8 @@ data class Order (
|
||||
|
||||
@Json(name = "delivered") delivered("delivered");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -13,12 +13,14 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param myNumber
|
||||
* @param myString
|
||||
* @param myBoolean
|
||||
*/
|
||||
|
||||
data class OuterComposite (
|
||||
@Json(name = "my_number")
|
||||
val myNumber: java.math.BigDecimal? = null,
|
||||
@ -27,5 +29,6 @@ data class OuterComposite (
|
||||
@Json(name = "my_boolean")
|
||||
val myBoolean: kotlin.Boolean? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -18,6 +18,7 @@ import com.squareup.moshi.Json
|
||||
*
|
||||
* Values: placed,approved,delivered
|
||||
*/
|
||||
|
||||
enum class OuterEnum(val value: kotlin.String){
|
||||
|
||||
|
||||
@ -33,5 +34,6 @@ enum class OuterEnum(val value: kotlin.String){
|
||||
delivered("delivered");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ import com.squareup.moshi.Json
|
||||
*
|
||||
* Values: placed,approved,delivered
|
||||
*/
|
||||
|
||||
enum class OuterEnumDefaultValue(val value: kotlin.String){
|
||||
|
||||
|
||||
@ -33,5 +34,6 @@ enum class OuterEnumDefaultValue(val value: kotlin.String){
|
||||
delivered("delivered");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ import com.squareup.moshi.Json
|
||||
*
|
||||
* Values: _0,_1,_2
|
||||
*/
|
||||
|
||||
enum class OuterEnumInteger(val value: kotlin.Int){
|
||||
|
||||
|
||||
@ -33,5 +34,6 @@ enum class OuterEnumInteger(val value: kotlin.Int){
|
||||
_2(2);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ import com.squareup.moshi.Json
|
||||
*
|
||||
* Values: _0,_1,_2
|
||||
*/
|
||||
|
||||
enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){
|
||||
|
||||
|
||||
@ -33,5 +34,6 @@ enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){
|
||||
_2(2);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,7 @@ import org.openapitools.client.models.Category
|
||||
import org.openapitools.client.models.Tag
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
@ -24,6 +25,7 @@ import com.squareup.moshi.Json
|
||||
* @param tags
|
||||
* @param status pet status in the store
|
||||
*/
|
||||
|
||||
data class Pet (
|
||||
@Json(name = "name")
|
||||
val name: kotlin.String,
|
||||
@ -39,12 +41,15 @@ data class Pet (
|
||||
@Json(name = "status")
|
||||
val status: Pet.Status? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
* Values: available,pending,sold
|
||||
*/
|
||||
|
||||
enum class Status(val value: kotlin.String){
|
||||
|
||||
@Json(name = "available") available("available"),
|
||||
@ -53,7 +58,8 @@ data class Pet (
|
||||
|
||||
@Json(name = "sold") sold("sold");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -13,16 +13,19 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param bar
|
||||
* @param baz
|
||||
*/
|
||||
|
||||
data class ReadOnlyFirst (
|
||||
@Json(name = "bar")
|
||||
val bar: kotlin.String? = null,
|
||||
@Json(name = "baz")
|
||||
val baz: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,13 +13,16 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* Model for testing reserved words
|
||||
* @param `return`
|
||||
* @param ``return``
|
||||
*/
|
||||
|
||||
data class Return (
|
||||
@Json(name = "return")
|
||||
val `return`: kotlin.Int? = null
|
||||
val ``return``: kotlin.Int? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,13 +13,16 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket
|
||||
*/
|
||||
|
||||
data class SpecialModelname (
|
||||
@Json(name = "$special[property.name]")
|
||||
val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,16 +13,19 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @param name
|
||||
*/
|
||||
|
||||
data class Tag (
|
||||
@Json(name = "id")
|
||||
val id: kotlin.Long? = null,
|
||||
@Json(name = "name")
|
||||
val name: kotlin.String? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import java.io.Serializable
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
@ -24,6 +25,7 @@ import com.squareup.moshi.Json
|
||||
* @param phone
|
||||
* @param userStatus User Status
|
||||
*/
|
||||
|
||||
data class User (
|
||||
@Json(name = "id")
|
||||
val id: kotlin.Long? = null,
|
||||
@ -43,5 +45,6 @@ data class User (
|
||||
@Json(name = "userStatus")
|
||||
val userStatus: kotlin.Int? = null
|
||||
)
|
||||
: Serializable
|
||||
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
package org.openapitools.server.models
|
||||
|
||||
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* Describes the result of uploading an image resource
|
||||
* @param code
|
||||
@ -22,7 +23,10 @@ data class ApiResponse (
|
||||
val code: kotlin.Int? = null,
|
||||
val type: kotlin.String? = null,
|
||||
val message: kotlin.String? = null
|
||||
) {
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
package org.openapitools.server.models
|
||||
|
||||
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* A category for a pet
|
||||
* @param id
|
||||
@ -20,7 +21,10 @@ package org.openapitools.server.models
|
||||
data class Category (
|
||||
val id: kotlin.Long? = null,
|
||||
val name: kotlin.String? = null
|
||||
) {
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
package org.openapitools.server.models
|
||||
|
||||
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* An order for a pets from the pet store
|
||||
* @param id
|
||||
@ -29,7 +30,10 @@ data class Order (
|
||||
/* Order Status */
|
||||
val status: Order.Status? = null,
|
||||
val complete: kotlin.Boolean? = null
|
||||
) {
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
* Order Status
|
||||
|
@ -14,6 +14,7 @@ package org.openapitools.server.models
|
||||
import org.openapitools.server.models.Category
|
||||
import org.openapitools.server.models.Tag
|
||||
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* A pet for sale in the pet store
|
||||
* @param id
|
||||
@ -31,7 +32,10 @@ data class Pet (
|
||||
val tags: kotlin.Array<Tag>? = null,
|
||||
/* pet status in the store */
|
||||
val status: Pet.Status? = null
|
||||
) {
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
/**
|
||||
* pet status in the store
|
||||
|
@ -12,6 +12,7 @@
|
||||
package org.openapitools.server.models
|
||||
|
||||
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* A tag for a pet
|
||||
* @param id
|
||||
@ -20,7 +21,10 @@ package org.openapitools.server.models
|
||||
data class Tag (
|
||||
val id: kotlin.Long? = null,
|
||||
val name: kotlin.String? = null
|
||||
) {
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
package org.openapitools.server.models
|
||||
|
||||
|
||||
import java.io.Serializable
|
||||
/**
|
||||
* A User who is purchasing from the pet store
|
||||
* @param id
|
||||
@ -33,7 +34,10 @@ data class User (
|
||||
val phone: kotlin.String? = null,
|
||||
/* User Status */
|
||||
val userStatus: kotlin.Int? = null
|
||||
) {
|
||||
)
|
||||
: Serializable
|
||||
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user