diff --git a/bin/openapi3/kotlin-client-petstore.sh b/bin/openapi3/kotlin-client-petstore.sh
index 5ffd829b05d4..f426dba223b8 100755
--- a/bin/openapi3/kotlin-client-petstore.sh
+++ b/bin/openapi3/kotlin-client-petstore.sh
@@ -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 -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
diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md
index 161ca6d0a967..4c18a6165c9d 100644
--- a/docs/generators/kotlin-server.md
+++ b/docs/generators/kotlin-server.md
@@ -14,6 +14,7 @@ sidebar_label: kotlin-server
|artifactId|Generated artifact id (name of jar).| |kotlin-server|
|artifactVersion|Generated artifact's package version.| |1.0.0|
|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|
|library|library template (sub-template)|
- **ktor**
- ktor framework
|ktor|
|featureAutoHead|Automatically provide responses to HEAD requests for existing routes that have the GET verb defined.| |true|
diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md
index c194143dbfab..9b690b12da5a 100644
--- a/docs/generators/kotlin-spring.md
+++ b/docs/generators/kotlin-spring.md
@@ -14,6 +14,7 @@ sidebar_label: kotlin-spring
|artifactId|Generated artifact id (name of jar).| |openapi-spring|
|artifactVersion|Generated artifact's package version.| |1.0.0|
|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|
|title|server title name or client service name| |OpenAPI Kotlin Spring|
|basePackage|base package (invokerPackage) for generated code| |org.openapitools|
diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md
index 008cf3ccce91..ccf17bb6eccb 100644
--- a/docs/generators/kotlin.md
+++ b/docs/generators/kotlin.md
@@ -14,6 +14,7 @@ sidebar_label: kotlin
|artifactId|Generated artifact id (name of jar).| |kotlin-client|
|artifactVersion|Generated artifact's package version.| |1.0.0|
|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|
|dateLibrary|Option. Date library to use|- **string**
- String
- **java8**
- Java 8 native JSR310
- **threetenbp**
- Threetenbp
|java8|
|collectionType|Option. Collection type to use|- **array**
- kotlin.Array
- **list**
- kotlin.collections.List
|array|
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java
index 0cf95af984df..b200139faa99 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java
@@ -202,6 +202,10 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case,
public static final String ENUM_PROPERTY_NAMING = "enumPropertyNaming";
public static final String ENUM_PROPERTY_NAMING_DESC = "Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'";
+ // Allow different language generators to offer an option of serialization library. Each language specific
+ // Codegen constants should define a description and provide proper input validation for the value of serializationLibrary
+ public static final String SERIALIZATION_LIBRARY = "serializationLibrary";
+
public static final String MODEL_NAME_PREFIX = "modelNamePrefix";
public static final String MODEL_NAME_PREFIX_DESC = "Prefix that will be prepended to all model names.";
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java
index 148cbb547aeb..5351c1fe2d40 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java
@@ -35,6 +35,10 @@
import static org.openapitools.codegen.utils.StringUtils.*;
public abstract class AbstractKotlinCodegen extends DefaultCodegen implements CodegenConfig {
+
+ public static final String SERIALIZATION_LIBRARY_DESC = "What serialization library to use: 'moshi' (default), or 'gson'";
+ public enum SERIALIZATION_LIBRARY_TYPE {moshi, gson}
+
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractKotlinCodegen.class);
protected String artifactId;
@@ -51,6 +55,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
protected boolean parcelizeModels = false;
protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.camelCase;
+ protected SERIALIZATION_LIBRARY_TYPE serializationLibrary = SERIALIZATION_LIBRARY_TYPE.moshi;
public AbstractKotlinCodegen() {
super();
@@ -205,6 +210,10 @@ public AbstractKotlinCodegen() {
CliOption enumPropertyNamingOpt = new CliOption(CodegenConstants.ENUM_PROPERTY_NAMING, CodegenConstants.ENUM_PROPERTY_NAMING_DESC);
cliOptions.add(enumPropertyNamingOpt.defaultValue(enumPropertyNaming.name()));
+
+ CliOption serializationLibraryOpt = new CliOption(CodegenConstants.SERIALIZATION_LIBRARY, SERIALIZATION_LIBRARY_DESC);
+ cliOptions.add(serializationLibraryOpt.defaultValue(serializationLibrary.name()));
+
cliOptions.add(new CliOption(CodegenConstants.PARCELIZE_MODELS, CodegenConstants.PARCELIZE_MODELS_DESC));
}
@@ -244,6 +253,10 @@ public CodegenConstants.ENUM_PROPERTY_NAMING_TYPE getEnumPropertyNaming() {
return this.enumPropertyNaming;
}
+ public SERIALIZATION_LIBRARY_TYPE getSerializationLibrary() {
+ return this.serializationLibrary;
+ }
+
/**
* Sets the naming convention for Kotlin enum properties
*
@@ -261,6 +274,24 @@ public void setEnumPropertyNaming(final String enumPropertyNamingType) {
}
}
+ /**
+ * Sets the serialization engine for Kotlin
+ *
+ * @param enumSerializationLibrary The string representation of the serialization library as defined by
+ * {@link org.openapitools.codegen.languages.AbstractKotlinCodegen.SERIALIZATION_LIBRARY_TYPE}
+ */
+ public void setSerializationLibrary(final String enumSerializationLibrary) {
+ try {
+ this.serializationLibrary = SERIALIZATION_LIBRARY_TYPE.valueOf(enumSerializationLibrary);
+ } catch (IllegalArgumentException ex) {
+ StringBuilder sb = new StringBuilder(enumSerializationLibrary + " is an invalid enum property naming option. Please choose from:");
+ for (SERIALIZATION_LIBRARY_TYPE t : SERIALIZATION_LIBRARY_TYPE.values()) {
+ sb.append("\n ").append(t.name());
+ }
+ throw new RuntimeException(sb.toString());
+ }
+ }
+
/**
* returns the swagger type for the property
*
@@ -330,6 +361,14 @@ public void processOpts() {
setEnumPropertyNaming((String) additionalProperties.get(CodegenConstants.ENUM_PROPERTY_NAMING));
}
+ if (additionalProperties.containsKey(CodegenConstants.SERIALIZATION_LIBRARY)) {
+ setSerializationLibrary((String) additionalProperties.get(CodegenConstants.SERIALIZATION_LIBRARY));
+ additionalProperties.put(this.serializationLibrary.name(), true);
+ }
+ else {
+ additionalProperties.put(this.serializationLibrary.name(), true);
+ }
+
if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) {
this.setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER));
} else {
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache
index 05954bb78a60..e735dc05a205 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache
@@ -32,6 +32,9 @@ dependencies {
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"
+ {{#gson}}
+ implementation "com.google.code.gson:gson:2.8.5"
+ {{/gson}}
compile "com.squareup.okhttp3:okhttp:4.0.1"
{{#threetenbp}}
compile "org.threeten:threetenbp:1.3.8"
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache
index 35b32bc12aab..a9f020ff4003 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache
@@ -1,4 +1,9 @@
+{{#gson}}
+import com.google.gson.annotations.SerializedName
+{{/gson}}
+{{#moshi}}
import com.squareup.moshi.Json
+{{/moshi}}
{{#parcelizeModels}}
import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
@@ -19,17 +24,22 @@ data class {{classname}} (
{{/-last}}{{/requiredVars}}{{#hasRequired}}{{#hasOptional}},
{{/hasOptional}}{{/hasRequired}}{{#optionalVars}}{{>data_class_opt_var}}{{^-last}},
{{/-last}}{{/optionalVars}}
-){{#parcelizeModels}} : Parcelable{{/parcelizeModels}} {
+){{#parcelizeModels}} : Parcelable{{/parcelizeModels}}
{{#hasEnums}}{{#vars}}{{#isEnum}}
+{
/**
* {{{description}}}
* Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}}
*/
enum class {{{nameInCamelCase}}}(val value: {{#isListContainer}}{{{ nestedType }}}{{/isListContainer}}{{^isListContainer}}{{{dataType}}}{{/isListContainer}}){
{{#allowableValues}}{{#enumVars}}
- @Json(name = {{{value}}})
- {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
+ {{#moshi}}
+ @Json(name = {{{value}}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
+ {{/moshi}}
+ {{#gson}}
+ @SerializedName(value={{{value}}}) {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}}
+ {{/gson}}
{{/enumVars}}{{/allowableValues}}
}
-{{/isEnum}}{{/vars}}{{/hasEnums}}
}
+{{/isEnum}}{{/vars}}{{/hasEnums}}
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache
index 03cbd718c34a..7312c4f3fdc4 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_opt_var.mustache
@@ -1,5 +1,10 @@
{{#description}}
/* {{{description}}} */
{{/description}}
+ {{#moshi}}
@Json(name = "{{{baseName}}}")
+ {{/moshi}}
+ {{#gson}}
+ @SerializedName("{{name}}")
+ {{/gson}}
val {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}? = {{#defaultvalue}}{{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}null{{/defaultvalue}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache
index 6682bc8170c7..223bf5904b49 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class_req_var.mustache
@@ -1,5 +1,10 @@
{{#description}}
/* {{{description}}} */
{{/description}}
+ {{#moshi}}
@Json(name = "{{{baseName}}}")
+ {{/moshi}}
+ {{#gson}}
+ @SerializedName("{{name}}")
+ {{/gson}}
val {{{name}}}: {{#isEnum}}{{#isListContainer}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{classname}}.{{{nameInCamelCase}}}>{{/isListContainer}}{{^isListContainer}}{{classname}}.{{{nameInCamelCase}}}{{/isListContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache
index 80b040f6b7c0..af9a327b3dbf 100644
--- a/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache
+++ b/modules/openapi-generator/src/main/resources/kotlin-client/enum_class.mustache
@@ -1,4 +1,9 @@
+{{#gson}}
+import com.google.gson.annotations.SerializedName
+{{/gson}}
+{{#moshi}}
import com.squareup.moshi.Json
+{{/moshi}}
/**
* {{{description}}}
@@ -7,7 +12,12 @@ import com.squareup.moshi.Json
enum class {{classname}}(val value: {{{dataType}}}){
{{#allowableValues}}{{#enumVars}}
+ {{#moshi}}
@Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}})
+ {{/moshi}}
+ {{#gson}}
+ @SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}})
+ {{/gson}}
{{#isListContainer}}
{{#isList}}
{{&name}}(listOf({{{value}}})){{^-last}},{{/-last}}{{#-last}};{{/-last}}
diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt
index 47109faf6125..b8b15769853e 100644
--- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt
+++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt
@@ -26,7 +26,6 @@ data class ApiResponse (
val type: kotlin.String? = null,
@Json(name = "message")
val message: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt
index f068a02b1a03..2cb38b9fba51 100644
--- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt
+++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Category.kt
@@ -23,7 +23,6 @@ data class Category (
val id: kotlin.Long? = null,
@Json(name = "name")
val name: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt
index a263c25f33c2..d979b8b691a4 100644
--- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt
+++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Order.kt
@@ -36,24 +36,22 @@ data class Order (
val status: Order.Status? = null,
@Json(name = "complete")
val complete: kotlin.Boolean? = null
-) {
+)
+{
/**
* Order Status
* Values: placed,approved,delivered
*/
enum class Status(val value: kotlin.String){
- @Json(name = "placed")
- placed("placed"),
+ @Json(name = "placed") placed("placed"),
- @Json(name = "approved")
- approved("approved"),
+ @Json(name = "approved") approved("approved"),
- @Json(name = "delivered")
- delivered("delivered");
+ @Json(name = "delivered") delivered("delivered");
}
-
}
+
diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt
index 88a536ea6227..9ee00ac631e4 100644
--- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt
+++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Pet.kt
@@ -38,24 +38,22 @@ data class Pet (
/* pet status in the store */
@Json(name = "status")
val status: Pet.Status? = null
-) {
+)
+{
/**
* pet status in the store
* Values: available,pending,sold
*/
enum class Status(val value: kotlin.String){
- @Json(name = "available")
- available("available"),
+ @Json(name = "available") available("available"),
- @Json(name = "pending")
- pending("pending"),
+ @Json(name = "pending") pending("pending"),
- @Json(name = "sold")
- sold("sold");
+ @Json(name = "sold") sold("sold");
}
-
}
+
diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt
index e67b899b1ff8..475acce8a0a9 100644
--- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt
+++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/Tag.kt
@@ -23,7 +23,6 @@ data class Tag (
val id: kotlin.Long? = null,
@Json(name = "name")
val name: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt
index 6a66d8e523b9..0cc681309b45 100644
--- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt
+++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/User.kt
@@ -42,7 +42,6 @@ data class User (
/* User Status */
@Json(name = "userStatus")
val userStatus: kotlin.Int? = null
-) {
+)
-}
diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt
index 47109faf6125..b8b15769853e 100644
--- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt
+++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt
@@ -26,7 +26,6 @@ data class ApiResponse (
val type: kotlin.String? = null,
@Json(name = "message")
val message: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt
index f068a02b1a03..2cb38b9fba51 100644
--- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt
+++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Category.kt
@@ -23,7 +23,6 @@ data class Category (
val id: kotlin.Long? = null,
@Json(name = "name")
val name: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt
index 916fe3094b23..6f1657150d81 100644
--- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt
+++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Order.kt
@@ -36,24 +36,22 @@ data class Order (
val status: Order.Status? = null,
@Json(name = "complete")
val complete: kotlin.Boolean? = null
-) {
+)
+{
/**
* Order Status
* Values: placed,approved,delivered
*/
enum class Status(val value: kotlin.String){
- @Json(name = "placed")
- placed("placed"),
+ @Json(name = "placed") placed("placed"),
- @Json(name = "approved")
- approved("approved"),
+ @Json(name = "approved") approved("approved"),
- @Json(name = "delivered")
- delivered("delivered");
+ @Json(name = "delivered") delivered("delivered");
}
-
}
+
diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt
index 88a536ea6227..9ee00ac631e4 100644
--- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt
+++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Pet.kt
@@ -38,24 +38,22 @@ data class Pet (
/* pet status in the store */
@Json(name = "status")
val status: Pet.Status? = null
-) {
+)
+{
/**
* pet status in the store
* Values: available,pending,sold
*/
enum class Status(val value: kotlin.String){
- @Json(name = "available")
- available("available"),
+ @Json(name = "available") available("available"),
- @Json(name = "pending")
- pending("pending"),
+ @Json(name = "pending") pending("pending"),
- @Json(name = "sold")
- sold("sold");
+ @Json(name = "sold") sold("sold");
}
-
}
+
diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt
index e67b899b1ff8..475acce8a0a9 100644
--- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt
+++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/Tag.kt
@@ -23,7 +23,6 @@ data class Tag (
val id: kotlin.Long? = null,
@Json(name = "name")
val name: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt
index 6a66d8e523b9..0cc681309b45 100644
--- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt
+++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/User.kt
@@ -42,7 +42,6 @@ data class User (
/* User Status */
@Json(name = "userStatus")
val userStatus: kotlin.Int? = null
-) {
+)
-}
diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt
index 47109faf6125..b8b15769853e 100644
--- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt
+++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt
@@ -26,7 +26,6 @@ data class ApiResponse (
val type: kotlin.String? = null,
@Json(name = "message")
val message: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt
index f068a02b1a03..2cb38b9fba51 100644
--- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt
+++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt
@@ -23,7 +23,6 @@ data class Category (
val id: kotlin.Long? = null,
@Json(name = "name")
val name: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt
index 00e62b88092c..e77abd68d517 100644
--- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt
+++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt
@@ -36,24 +36,22 @@ data class Order (
val status: Order.Status? = null,
@Json(name = "complete")
val complete: kotlin.Boolean? = null
-) {
+)
+{
/**
* Order Status
* Values: placed,approved,delivered
*/
enum class Status(val value: kotlin.String){
- @Json(name = "placed")
- placed("placed"),
+ @Json(name = "placed") placed("placed"),
- @Json(name = "approved")
- approved("approved"),
+ @Json(name = "approved") approved("approved"),
- @Json(name = "delivered")
- delivered("delivered");
+ @Json(name = "delivered") delivered("delivered");
}
-
}
+
diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt
index 88a536ea6227..9ee00ac631e4 100644
--- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt
+++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt
@@ -38,24 +38,22 @@ data class Pet (
/* pet status in the store */
@Json(name = "status")
val status: Pet.Status? = null
-) {
+)
+{
/**
* pet status in the store
* Values: available,pending,sold
*/
enum class Status(val value: kotlin.String){
- @Json(name = "available")
- available("available"),
+ @Json(name = "available") available("available"),
- @Json(name = "pending")
- pending("pending"),
+ @Json(name = "pending") pending("pending"),
- @Json(name = "sold")
- sold("sold");
+ @Json(name = "sold") sold("sold");
}
-
}
+
diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt
index e67b899b1ff8..475acce8a0a9 100644
--- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt
+++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt
@@ -23,7 +23,6 @@ data class Tag (
val id: kotlin.Long? = null,
@Json(name = "name")
val name: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt
index 6a66d8e523b9..0cc681309b45 100644
--- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt
+++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt
@@ -42,7 +42,6 @@ data class User (
/* User Status */
@Json(name = "userStatus")
val userStatus: kotlin.Int? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt
index ad9d5f84c576..7d5ee7a1bb7f 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt
@@ -23,7 +23,6 @@ data class AdditionalPropertiesClass (
val mapProperty: kotlin.collections.Map? = null,
@Json(name = "map_of_map_property")
val mapOfMapProperty: kotlin.collections.Map>? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt
index 655306a7e897..5f4435f56fa4 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt
@@ -23,7 +23,6 @@ data class Animal (
val className: kotlin.String,
@Json(name = "color")
val color: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt
index f79e529c2fc1..0fe4589a5f4f 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt
@@ -26,7 +26,6 @@ data class ApiResponse (
val type: kotlin.String? = null,
@Json(name = "message")
val message: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt
index 3be01f40411f..7ade7d8cff50 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt
@@ -20,7 +20,6 @@ import com.squareup.moshi.Json
data class ArrayOfArrayOfNumberOnly (
@Json(name = "ArrayArrayNumber")
val arrayArrayNumber: kotlin.Array>? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt
index d4d24cd34edb..263146cfd9cf 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt
@@ -20,7 +20,6 @@ import com.squareup.moshi.Json
data class ArrayOfNumberOnly (
@Json(name = "ArrayNumber")
val arrayNumber: kotlin.Array? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt
index 51fd93eec0e9..a430c0559325 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt
@@ -27,7 +27,6 @@ data class ArrayTest (
val arrayArrayOfInteger: kotlin.Array>? = null,
@Json(name = "array_array_of_model")
val arrayArrayOfModel: kotlin.Array>? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt
index ec12c128324d..72b27a545076 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt
@@ -36,7 +36,6 @@ data class Capitalization (
/* Name of the pet */
@Json(name = "ATT_NAME")
val ATT_NAME: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt
index f7fc445d9efe..1ce9e6ef4315 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt
@@ -26,7 +26,6 @@ data class Cat (
val declawed: kotlin.Boolean? = null,
@Json(name = "color")
val color: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt
index c20830cfc990..ec9862cd1757 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt
@@ -20,7 +20,6 @@ import com.squareup.moshi.Json
data class CatAllOf (
@Json(name = "declawed")
val declawed: kotlin.Boolean? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt
index 637d8f39fdb9..059231f463c0 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt
@@ -23,7 +23,6 @@ data class Category (
val name: kotlin.String,
@Json(name = "id")
val id: kotlin.Long? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt
index 92425fba5640..06245c42beb4 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt
@@ -20,7 +20,6 @@ import com.squareup.moshi.Json
data class ClassModel (
@Json(name = "_class")
val propertyClass: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt
index 656eff708d20..4a0cc69a783c 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt
@@ -20,7 +20,6 @@ import com.squareup.moshi.Json
data class Client (
@Json(name = "client")
val client: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt
index 6f194f25a802..19cb002da7e8 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt
@@ -26,7 +26,6 @@ data class Dog (
val breed: kotlin.String? = null,
@Json(name = "color")
val color: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt
index fab37948f8cc..71b1b71365af 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt
@@ -20,7 +20,6 @@ import com.squareup.moshi.Json
data class DogAllOf (
@Json(name = "breed")
val breed: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt
index 1908c031f154..862929784c01 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt
@@ -23,35 +23,34 @@ data class EnumArrays (
val justSymbol: EnumArrays.JustSymbol? = null,
@Json(name = "array_enum")
val arrayEnum: kotlin.Array? = null
-) {
+)
+{
/**
*
* Values: greaterThanEqual,dollar
*/
enum class JustSymbol(val value: kotlin.String){
- @Json(name = ">=")
- greaterThanEqual(">="),
+ @Json(name = ">=") greaterThanEqual(">="),
- @Json(name = "$")
- dollar("$");
+ @Json(name = "$") dollar("$");
}
+}
+{
/**
*
* Values: fish,crab
*/
enum class ArrayEnum(val value: kotlin.String){
- @Json(name = "fish")
- fish("fish"),
+ @Json(name = "fish") fish("fish"),
- @Json(name = "crab")
- crab("crab");
+ @Json(name = "crab") crab("crab");
}
-
}
+
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt
index 59cd40f659e4..5c4073650378 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt
@@ -45,69 +45,66 @@ data class EnumTest (
val outerEnumDefaultValue: OuterEnumDefaultValue? = null,
@Json(name = "outerEnumIntegerDefaultValue")
val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null
-) {
+)
+{
/**
*
* Values: uPPER,lower,eMPTY
*/
enum class EnumString(val value: kotlin.String){
- @Json(name = "UPPER")
- uPPER("UPPER"),
+ @Json(name = "UPPER") uPPER("UPPER"),
- @Json(name = "lower")
- lower("lower"),
+ @Json(name = "lower") lower("lower"),
- @Json(name = "")
- eMPTY("");
+ @Json(name = "") eMPTY("");
}
+}
+{
/**
*
* Values: uPPER,lower,eMPTY
*/
enum class EnumStringRequired(val value: kotlin.String){
- @Json(name = "UPPER")
- uPPER("UPPER"),
+ @Json(name = "UPPER") uPPER("UPPER"),
- @Json(name = "lower")
- lower("lower"),
+ @Json(name = "lower") lower("lower"),
- @Json(name = "")
- eMPTY("");
+ @Json(name = "") eMPTY("");
}
+}
+{
/**
*
* Values: _1,minus1
*/
enum class EnumInteger(val value: kotlin.Int){
- @Json(name = 1)
- _1(1),
+ @Json(name = 1) _1(1),
- @Json(name = -1)
- minus1(-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.1) _1period1(1.1),
- @Json(name = -1.2)
- minus1Period2(-1.2);
+ @Json(name = -1.2) minus1Period2(-1.2);
}
-
}
+
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt
index 003bc5c6b692..82e56661014b 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt
@@ -23,7 +23,6 @@ data class FileSchemaTestClass (
val file: java.io.File? = null,
@Json(name = "files")
val files: kotlin.Array? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt
index 40d0f465db31..4ac59867244b 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt
@@ -20,7 +20,6 @@ import com.squareup.moshi.Json
data class Foo (
@Json(name = "bar")
val bar: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt
index 79c8dc6968e8..d185226b0dc0 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt
@@ -64,7 +64,6 @@ data class FormatTest (
/* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */
@Json(name = "pattern_with_digits_and_delimiter")
val patternWithDigitsAndDelimiter: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt
index 2fae92679874..1e649d71f249 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt
@@ -23,7 +23,6 @@ data class HasOnlyReadOnly (
val bar: kotlin.String? = null,
@Json(name = "foo")
val foo: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt
index f0466b799b49..8f53541bd227 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt
@@ -20,7 +20,6 @@ import com.squareup.moshi.Json
data class HealthCheckResult (
@Json(name = "NullableMessage")
val nullableMessage: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt
index 53a7082ac0ac..70484e689460 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt
@@ -25,7 +25,6 @@ data class InlineObject (
/* Updated status of the pet */
@Json(name = "status")
val status: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt
index 0917219b4ef5..51f2137de920 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt
@@ -25,7 +25,6 @@ data class InlineObject1 (
/* file to upload */
@Json(name = "file")
val file: java.io.File? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt
index bf824926150e..0f982f05a809 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt
@@ -25,38 +25,36 @@ data class InlineObject2 (
/* Form parameter enum test (string) */
@Json(name = "enum_form_string")
val enumFormString: InlineObject2.EnumFormString? = null
-) {
+)
+{
/**
* Form parameter enum test (string array)
* Values: greaterThan,dollar
*/
enum class EnumFormStringArray(val value: kotlin.String){
- @Json(name = ">")
- greaterThan(">"),
+ @Json(name = ">") greaterThan(">"),
- @Json(name = "$")
- dollar("$");
+ @Json(name = "$") dollar("$");
}
+}
+{
/**
* Form parameter enum test (string)
* Values: abc,minusEfg,leftParenthesisXyzRightParenthesis
*/
enum class EnumFormString(val value: kotlin.String){
- @Json(name = "_abc")
- abc("_abc"),
+ @Json(name = "_abc") abc("_abc"),
- @Json(name = "-efg")
- minusEfg("-efg"),
+ @Json(name = "-efg") minusEfg("-efg"),
- @Json(name = "(xyz)")
- leftParenthesisXyzRightParenthesis("(xyz)");
+ @Json(name = "(xyz)") leftParenthesisXyzRightParenthesis("(xyz)");
}
-
}
+
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt
index 4ade49136757..35dc49df571f 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt
@@ -73,7 +73,6 @@ data class InlineObject3 (
/* None */
@Json(name = "callback")
val callback: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt
index 91b9c2a9cdf2..52eef17034ac 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt
@@ -25,7 +25,6 @@ data class InlineObject4 (
/* field2 */
@Json(name = "param2")
val param2: kotlin.String
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt
index f058f58c4441..ca95c5ee037e 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt
@@ -25,7 +25,6 @@ data class InlineObject5 (
/* Additional data to pass to server */
@Json(name = "additionalMetadata")
val additionalMetadata: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt
index ea862cef739c..5768639b0b22 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt
@@ -21,7 +21,6 @@ import com.squareup.moshi.Json
data class InlineResponseDefault (
@Json(name = "string")
val string: Foo? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt
index 533fb21cc80b..6e2a75355bdc 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt
@@ -20,7 +20,6 @@ import com.squareup.moshi.Json
data class List (
@Json(name = "123-list")
val `123minusList`: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt
index 8d752fbb6887..dc1096dc70b1 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt
@@ -29,21 +29,20 @@ data class MapTest (
val directMap: kotlin.collections.Map? = null,
@Json(name = "indirect_map")
val indirectMap: kotlin.collections.Map? = null
-) {
+)
+{
/**
*
* Values: uPPER,lower
*/
enum class MapOfEnumString(val value: kotlin.collections.Map){
- @Json(name = "UPPER")
- uPPER("UPPER"),
+ @Json(name = "UPPER") uPPER("UPPER"),
- @Json(name = "lower")
- lower("lower");
+ @Json(name = "lower") lower("lower");
}
-
}
+
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt
index 63bf58d8b93c..7d835a2af541 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt
@@ -27,7 +27,6 @@ data class MixedPropertiesAndAdditionalPropertiesClass (
val dateTime: java.time.LocalDateTime? = null,
@Json(name = "map")
val map: kotlin.collections.Map? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt
index 42c48fa7fd1c..b2e792c8e8e8 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt
@@ -23,7 +23,6 @@ data class Model200Response (
val name: kotlin.Int? = null,
@Json(name = "class")
val propertyClass: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt
index d46b4b1c5112..72cb9d7ad64b 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt
@@ -29,7 +29,6 @@ data class Name (
val property: kotlin.String? = null,
@Json(name = "123Number")
val `123number`: kotlin.Int? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt
index 4b75b41a9d75..86bb11c5c1d9 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt
@@ -53,7 +53,6 @@ data class NullableClass (
val objectAndItemsNullableProp: kotlin.collections.Map? = null,
@Json(name = "object_items_nullable")
val objectItemsNullable: kotlin.collections.Map? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt
index c8126af08483..7385bd952314 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt
@@ -20,7 +20,6 @@ import com.squareup.moshi.Json
data class NumberOnly (
@Json(name = "JustNumber")
val justNumber: java.math.BigDecimal? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt
index 296d77047cc5..d33f3bf23935 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt
@@ -36,24 +36,22 @@ data class Order (
val status: Order.Status? = null,
@Json(name = "complete")
val complete: kotlin.Boolean? = null
-) {
+)
+{
/**
* Order Status
* Values: placed,approved,delivered
*/
enum class Status(val value: kotlin.String){
- @Json(name = "placed")
- placed("placed"),
+ @Json(name = "placed") placed("placed"),
- @Json(name = "approved")
- approved("approved"),
+ @Json(name = "approved") approved("approved"),
- @Json(name = "delivered")
- delivered("delivered");
+ @Json(name = "delivered") delivered("delivered");
}
-
}
+
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt
index a0bc846a09b9..304f88c52df4 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt
@@ -26,7 +26,6 @@ data class OuterComposite (
val myString: kotlin.String? = null,
@Json(name = "my_boolean")
val myBoolean: kotlin.Boolean? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt
index 5adf5a0e5f3a..b0c73cfb5144 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt
@@ -38,24 +38,22 @@ data class Pet (
/* pet status in the store */
@Json(name = "status")
val status: Pet.Status? = null
-) {
+)
+{
/**
* pet status in the store
* Values: available,pending,sold
*/
enum class Status(val value: kotlin.String){
- @Json(name = "available")
- available("available"),
+ @Json(name = "available") available("available"),
- @Json(name = "pending")
- pending("pending"),
+ @Json(name = "pending") pending("pending"),
- @Json(name = "sold")
- sold("sold");
+ @Json(name = "sold") sold("sold");
}
-
}
+
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt
index b47c5617c837..52bf083649ae 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt
@@ -23,7 +23,6 @@ data class ReadOnlyFirst (
val bar: kotlin.String? = null,
@Json(name = "baz")
val baz: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt
index 59a24cd83518..91c531468436 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt
@@ -20,7 +20,6 @@ import com.squareup.moshi.Json
data class Return (
@Json(name = "return")
val `return`: kotlin.Int? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt
index 2768460ff671..a4faf3fd57a5 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt
@@ -20,7 +20,6 @@ import com.squareup.moshi.Json
data class SpecialModelname (
@Json(name = "$special[property.name]")
val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt
index bb7bf2ec0730..37e9e0eaef3d 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt
@@ -23,7 +23,6 @@ data class Tag (
val id: kotlin.Long? = null,
@Json(name = "name")
val name: kotlin.String? = null
-) {
+)
-}
diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt
index d0384bc2069d..5301e72d3763 100644
--- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt
+++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt
@@ -42,7 +42,6 @@ data class User (
/* User Status */
@Json(name = "userStatus")
val userStatus: kotlin.Int? = null
-) {
+)
-}