diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index 54e62dcf208..942ccd478a1 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -16,7 +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| +|serializableModel|boolean - toggle "implements java.io.Serializable" 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| |featureConditionalHeaders|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |false| diff --git a/docs/generators/kotlin-vertx.md b/docs/generators/kotlin-vertx.md index 03e2d0dd1fc..b73ca814c06 100644 --- a/docs/generators/kotlin-vertx.md +++ b/docs/generators/kotlin-vertx.md @@ -16,4 +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| +|serializableModel|boolean - toggle "implements java.io.Serializable" for generated models| |null| diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 719ed37accb..5ccffd462be 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -16,7 +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| +|serializableModel|boolean - toggle "implements java.io.Serializable" for generated models| |null| |dateLibrary|Option. Date library to use|
**string**
String
**java8**
Java 8 native JSR310 (jvm only)
**threetenbp**
Threetenbp (jvm only)
|java8| |collectionType|Option. Collection type to use|
**array**
kotlin.Array
**list**
kotlin.collections.List
|array| |library|Library template (sub-template) to use|
**jvm**
Platform: Java Virtual Machine. HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.8.1.
**multiplatform**
Platform: Kotlin multiplatform. HTTP client: Ktor 1.2.4. JSON processing: Kotlinx Serialization: 0.12.0.
|jvm| 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 fa6d51ffb00..cc77584dfc1 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 @@ -248,6 +248,9 @@ public class CodegenConstants { public static final String CASE_INSENSITIVE_RESPONSE_HEADERS = "caseInsensitiveResponseHeaders"; public static final String CASE_INSENSITIVE_RESPONSE_HEADERS_DESC = "Make API response's headers case-insensitive"; + public static final String NEEDS_DATACLASS_BODY = "needsDataClassBody"; + public static final String NEEDS_DATACLASS_BODY_DESC = "Specifies if the kotlin data class needs a body with curly braces or not."; + // Not user-configurable. System provided for use in templates. public static final String GENERATE_APIS = "generateApis"; 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 da9f4f14192..03cd06a017f 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 @@ -24,6 +24,7 @@ import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.DefaultCodegen; import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; @@ -31,12 +32,14 @@ import org.slf4j.LoggerFactory; import java.io.File; import java.util.*; +import java.util.stream.Collectors; 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); @@ -53,8 +56,9 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; protected boolean parcelizeModels = false; - protected boolean serializableModel = false; + protected boolean needsDataClassBody = false; + protected boolean hasEnums = false; protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.camelCase; protected SERIALIZATION_LIBRARY_TYPE serializationLibrary = SERIALIZATION_LIBRARY_TYPE.moshi; @@ -426,6 +430,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co additionalProperties.put(CodegenConstants.PARCELIZE_MODELS, parcelizeModels); } + additionalProperties.put(CodegenConstants.NEEDS_DATACLASS_BODY, this.hasEnums || serializableModel); additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage()); additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage()); @@ -476,6 +481,15 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co public void setSerializableModel(boolean serializableModel) { this.serializableModel = serializableModel; } + + public boolean isNeedsDataClassBody() { + return needsDataClassBody; + } + + public void setNeedsDataClassBody(boolean needsDataClassBody) { + this.needsDataClassBody = needsDataClassBody; + } + /** * Return the sanitized variable name for enum * @@ -746,6 +760,15 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co return imports; } + @Override + public CodegenModel fromModel(String name, Schema schema) { + CodegenModel m = super.fromModel(name, schema); + m.optionalVars = m.optionalVars.stream().distinct().collect(Collectors.toList()); + m.allVars.stream().filter(p -> !m.vars.contains(p)).forEach(p -> p.isInherited = true); + this.hasEnums = m.hasEnums; + return m; + } + @Override public String toEnumValue(String value, String datatype) { if ("kotlin.Int".equals(datatype) || "kotlin.Long".equals(datatype)) { 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 1cb58bb49e9..d23344f59d7 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 @@ -37,8 +37,12 @@ data class {{classname}} ( ) {{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}} {{^parcelizeModels}}{{#serializableModel}}: Serializable {{/serializableModel}}{{/parcelizeModels}} {{#parcelizeModels}}{{#serializableModel}} : Parcelable, Serializable {{/serializableModel}}{{/parcelizeModels}} -{{#hasEnums}} -{ +{{#needsDataClassBody}}{{=<% %>=}}{<%={{ }}=%>{{/needsDataClassBody}} +{{#serializableModel}} + companion object { + private const val serialVersionUID: Long = 123 + } +{{/serializableModel}}{{#hasEnums}} {{#vars}}{{#isEnum}} /** * {{{description}}} @@ -65,5 +69,4 @@ data class {{classname}} ( {{/multiplatform}} } {{/isEnum}}{{/vars}} -} -{{/hasEnums}} +{{/hasEnums}}{{#needsDataClassBody}}{{=<% %>=}}}<%={{ }}=%>{{/needsDataClassBody}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache index fe88e433f20..eb5b0d565ee 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache @@ -21,11 +21,15 @@ data class {{classname}} ( {{/-last}}{{/requiredVars}}{{#hasRequired}}{{#hasOptional}}, {{/hasOptional}}{{/hasRequired}}{{#optionalVars}}{{>data_class_opt_var}}{{^-last}}, {{/-last}}{{/optionalVars}} -) {{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}} -{{^parcelizeModels}}{{#serializableModel}}: Serializable {{/serializableModel}}{{/parcelizeModels}} -{{#parcelizeModels}}{{#serializableModel}} : Parcelable, Serializable {{/serializableModel}}{{/parcelizeModels}} -{ -{{#hasEnums}}{{#vars}}{{#isEnum}} +) {{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}}{{^parcelizeModels}}{{#serializableModel}}: Serializable {{/serializableModel}}{{/parcelizeModels}}{{#parcelizeModels}}{{#serializableModel}} : Parcelable, Serializable {{/serializableModel}}{{/parcelizeModels}} +{{#needsDataClassBody}}{{=<% %>=}}{<%={{ }}=%>{{/needsDataClassBody}} +{{#serializableModel}} + companion object { + private const val serialVersionUID: Long = 123 + } +{{/serializableModel}} +{{#hasEnums}} + {{#vars}}{{#isEnum}} /** * {{{description}}} * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^-last}},{{/-last}}{{/enumVars}}{{/allowableValues}} @@ -35,5 +39,4 @@ data class {{classname}} ( {{&name}}({{{value}}}){{^-last}},{{/-last}}{{#-last}};{{/-last}} {{/enumVars}}{{/allowableValues}} } -{{/isEnum}}{{/vars}}{{/hasEnums}} -} +{{/isEnum}}{{/vars}}{{/hasEnums}}{{#needsDataClassBody}}{{=<% %>=}}}<%={{ }}=%>{{/needsDataClassBody}} diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt index 3f05f17779e..831b50ef770 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -29,3 +29,5 @@ data class ApiResponse ( + + diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt index eff7d12a4ab..2f08fc27d6b 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Category.kt @@ -27,3 +27,5 @@ data class Category ( + + diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt index 76b9cf068ed..57ebfbf1a67 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Order.kt @@ -35,7 +35,8 @@ data class Order ( ) -{ + + /** * Order Status @@ -54,5 +55,5 @@ data class Order ( object Serializer : CommonEnumSerializer("Status", values(), values().map { it.value }.toTypedArray()) } -} + diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt index 145683fe578..1e0d08a1b85 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Pet.kt @@ -37,7 +37,8 @@ data class Pet ( ) -{ + + /** * pet status in the store @@ -56,5 +57,5 @@ data class Pet ( object Serializer : CommonEnumSerializer("Status", values(), values().map { it.value }.toTypedArray()) } -} + diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt index 6c5ce642e78..29ebfaf424f 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Tag.kt @@ -27,3 +27,5 @@ data class Tag ( + + diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt index dd092dfd707..78d48510ade 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/User.kt @@ -40,3 +40,5 @@ data class User ( + + 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 6d5c231ccc8..8d5c8448f04 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 @@ -31,4 +31,9 @@ data class ApiResponse ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 1fe92af826c..7895d7627ab 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 @@ -28,4 +28,9 @@ data class Category ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 81cc2b0940b..451109b15f5 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 @@ -42,6 +42,10 @@ data class Order ( : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + /** * Order Status 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 3b4dfc22abd..9771dda248c 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 @@ -44,6 +44,10 @@ data class Pet ( : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + /** * pet status in the store 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 1d97954c460..7fb74357125 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 @@ -28,4 +28,9 @@ data class Tag ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 df835a5d968..e66f3cf09fe 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 @@ -47,4 +47,9 @@ data class User ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 47766821f18..90b60bdccfc 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 @@ -31,3 +31,5 @@ data class ApiResponse ( + + 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 edb16cc1270..f28b1fa2cdd 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 @@ -28,3 +28,5 @@ data class Category ( + + 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 af6dcb45604..800a7fd6406 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 @@ -40,7 +40,8 @@ data class Order ( ) -{ + + /** * Order Status @@ -58,5 +59,5 @@ data class Order ( } -} + 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 8015b6dab72..a85f990e1e8 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 @@ -42,7 +42,8 @@ data class Pet ( ) -{ + + /** * pet status in the store @@ -60,5 +61,5 @@ data class Pet ( } -} + 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 05dc7c9afef..16c40f6039c 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 @@ -28,3 +28,5 @@ data class Tag ( + + 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 537b01d3c27..bb6442aefcb 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 @@ -47,3 +47,5 @@ data class User ( + + 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 6d5c231ccc8..8d5c8448f04 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 @@ -31,4 +31,9 @@ data class ApiResponse ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 1fe92af826c..7895d7627ab 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 @@ -28,4 +28,9 @@ data class Category ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 a5478a61626..2e883cccdd0 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 @@ -42,6 +42,10 @@ data class Order ( : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + /** * Order Status 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 3b4dfc22abd..9771dda248c 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 @@ -44,6 +44,10 @@ data class Pet ( : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + /** * pet status in the store 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 1d97954c460..7fb74357125 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 @@ -28,4 +28,9 @@ data class Tag ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 df835a5d968..e66f3cf09fe 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 @@ -47,4 +47,9 @@ data class User ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} diff --git a/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION index d99e7162d01..0e97bd19efb 100644 --- a/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.0-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file 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 4367965e2dc..fe775011a95 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 @@ -28,4 +28,9 @@ data class AdditionalPropertiesClass ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 ba590f165b8..188e1ddc708 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 @@ -28,4 +28,9 @@ data class Animal ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 22773e65057..6df7feef3d9 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 @@ -31,4 +31,9 @@ data class ApiResponse ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 5c9048466e0..7a302b510f4 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 @@ -25,4 +25,9 @@ data class ArrayOfArrayOfNumberOnly ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 214ef4b0cfe..f8b5404b7e1 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 @@ -25,4 +25,9 @@ data class ArrayOfNumberOnly ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 d406e97bf71..1831ecc889a 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 @@ -32,4 +32,9 @@ data class ArrayTest ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 c9153d08cc2..c478ffe9180 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 @@ -41,4 +41,9 @@ data class Capitalization ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 05c1647fb79..48c9727de07 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 @@ -31,4 +31,9 @@ data class Cat ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 c4cb55cb62c..37bc7add21f 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 @@ -25,4 +25,9 @@ data class CatAllOf ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 f3280e75d4c..61dc86df218 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 @@ -28,4 +28,9 @@ data class Category ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 7580a49224f..17228f01f48 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 @@ -25,4 +25,9 @@ data class ClassModel ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 09324d61a09..c0f91b21a9d 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 @@ -25,4 +25,9 @@ data class Client ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 54a2bb6feaf..22414a0efd1 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 @@ -31,4 +31,9 @@ data class Dog ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 6085540ff7f..086ee4c6a0d 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 @@ -25,4 +25,9 @@ data class DogAllOf ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 79b1a4c1018..c0e6c30e55e 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 @@ -29,6 +29,10 @@ data class EnumArrays ( : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + /** * 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 52ea113cc92..53b05926f1e 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 @@ -51,6 +51,10 @@ data class EnumTest ( : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + /** * 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 ab39639e0cc..7deb80853b3 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 @@ -28,4 +28,9 @@ data class FileSchemaTestClass ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 0dd32c21afb..57925fce832 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 @@ -25,4 +25,9 @@ data class Foo ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 e746da485f9..2b587f520d2 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 @@ -69,4 +69,9 @@ data class FormatTest ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 04eef4d206b..949cb4e5b80 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 @@ -28,4 +28,9 @@ data class HasOnlyReadOnly ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 ce497df1fca..57c37e9dc60 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 @@ -25,4 +25,9 @@ data class HealthCheckResult ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 f2f290f4081..91689261680 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 @@ -30,4 +30,9 @@ data class InlineObject ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 ea1e3ae2411..7e996c6a4fc 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 @@ -30,4 +30,9 @@ data class InlineObject1 ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 ec48e39edf2..16b100cac2d 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 @@ -31,6 +31,10 @@ data class InlineObject2 ( : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + /** * Form parameter enum test (string array) 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 b2725c7fc12..aacdc7583fc 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 @@ -78,4 +78,9 @@ data class InlineObject3 ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 f6776d3b7fc..58674757a7b 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 @@ -30,4 +30,9 @@ data class InlineObject4 ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 0497fa03e67..0c7c601bd7d 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 @@ -30,4 +30,9 @@ data class InlineObject5 ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 b09c724605e..de26c4e00b4 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 @@ -26,4 +26,9 @@ data class InlineResponseDefault ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 43f321eabcb..c24ed15deac 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 @@ -16,13 +16,18 @@ 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 +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 bf1aa56a158..d877a29bfd9 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 @@ -35,6 +35,10 @@ data class MapTest ( : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + /** * 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 1551efc4c2a..21d8a098101 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 @@ -32,4 +32,9 @@ data class MixedPropertiesAndAdditionalPropertiesClass ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 bb071875225..542405de963 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 @@ -28,4 +28,9 @@ data class Model200Response ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 1362bd97c1b..99df32389af 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 @@ -19,7 +19,7 @@ import java.io.Serializable * @param name * @param snakeCase * @param property - * @param ``123number`` + * @param `123number` */ data class Name ( @@ -30,8 +30,13 @@ 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 +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 7bfd1d97c1a..afc8d24463f 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 @@ -58,4 +58,9 @@ data class NullableClass ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 d14ad1907e1..15c8dfdcf56 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 @@ -25,4 +25,9 @@ data class NumberOnly ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 07459585e99..db8d8a57bdd 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 @@ -42,6 +42,10 @@ data class Order ( : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + /** * Order Status 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 21565c2cff3..2d2fd9b1c6d 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 @@ -31,4 +31,9 @@ data class OuterComposite ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 23abc63ce39..f687d449014 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 @@ -44,6 +44,10 @@ data class Pet ( : Serializable { + companion object { + private const val serialVersionUID: Long = 123 + } + /** * pet status in the store 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 325a4c5ffd8..7265237f9b1 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 @@ -28,4 +28,9 @@ data class ReadOnlyFirst ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 6670a26a8f9..4ee2459c1cf 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 @@ -16,13 +16,18 @@ 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 +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 2bcfeb506eb..b6161bcfd65 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 @@ -25,4 +25,9 @@ data class SpecialModelname ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 7596c7d495d..13667abe035 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 @@ -28,4 +28,9 @@ data class Tag ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} 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 d6bd140f13a..4443da984df 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 @@ -47,4 +47,9 @@ data class User ( ) : Serializable +{ + companion object { + private const val serialVersionUID: Long = 123 + } +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION b/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION index 06b5019af3f..0e97bd19efb 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/build.gradle.kts b/samples/openapi3/server/petstore/kotlin-springboot-reactive/build.gradle.kts index f62d3f33c8d..f4561be14be 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/build.gradle.kts +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/build.gradle.kts @@ -43,9 +43,11 @@ dependencies { compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") compile("com.fasterxml.jackson.module:jackson-module-kotlin") + testCompile("org.jetbrains.kotlin:kotlin-test-junit5") testCompile("org.springframework.boot:spring-boot-starter-test") { exclude(module = "junit") } + testCompile("org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinxCoroutinesVersion") } repositories { diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/pom.xml b/samples/openapi3/server/petstore/kotlin-springboot-reactive/pom.xml index 1932017d4bf..b0a954d4707 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/pom.xml +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/pom.xml @@ -96,6 +96,12 @@ swagger-annotations 1.5.21 + + + com.google.code.findbugs + jsr305 + 3.0.2 + com.fasterxml.jackson.dataformat jackson-dataformat-yaml @@ -117,6 +123,12 @@ javax.validation validation-api + + org.jetbrains.kotlin + kotlin-test-junit5 + 1.3.31 + test + diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt index 29de43b1a02..c0aeae1a41c 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -45,142 +45,141 @@ import kotlin.collections.Map class PetApiController(@Autowired(required = true) val service: PetApiService) { @ApiOperation( - value = "Add a new pet to the store", - nickname = "addPet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Add a new pet to the store", + nickname = "addPet", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 405, message = "Invalid input")]) + value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( - value = ["/pet"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.POST]) + value = ["/pet"], + consumes = ["application/json", "application/xml"], + method = [RequestMethod.POST]) suspend fun addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet ): ResponseEntity { - return ResponseEntity(service.addPet(pet), HttpStatus.OK) + return ResponseEntity(service.addPet(pet), HttpStatus.valueOf(405)) } @ApiOperation( - value = "Deletes a pet", - nickname = "deletePet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Deletes a pet", + nickname = "deletePet", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid pet value")]) + value = [ApiResponse(code = 400, message = "Invalid pet value")]) @RequestMapping( - value = ["/pet/{petId}"], - method = [RequestMethod.DELETE]) - suspend fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: Long -,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) apiKey: String? + value = ["/pet/{petId}"], + method = [RequestMethod.DELETE]) + suspend fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long +,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) apiKey: kotlin.String? ): ResponseEntity { - return ResponseEntity(service.deletePet(petId, apiKey), HttpStatus.OK) + return ResponseEntity(service.deletePet(petId, apiKey), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Finds Pets by status", - nickname = "findPetsByStatus", - notes = "Multiple status values can be provided with comma separated strings", - response = Pet::class, - responseContainer = "List", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Finds Pets by status", + nickname = "findPetsByStatus", + notes = "Multiple status values can be provided with comma separated strings", + response = Pet::class, + responseContainer = "List", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) @RequestMapping( - value = ["/pet/findByStatus"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: List + value = ["/pet/findByStatus"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List ): ResponseEntity> { - return ResponseEntity(service.findPetsByStatus(status), HttpStatus.OK) + return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Finds Pets by tags", - nickname = "findPetsByTags", - notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - response = Pet::class, - responseContainer = "List", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Finds Pets by tags", + nickname = "findPetsByTags", + notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + response = Pet::class, + responseContainer = "List", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) @RequestMapping( - value = ["/pet/findByTags"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: List -,@ApiParam(value = "Maximum number of items to return") @Valid @RequestParam(value = "maxCount", required = false) maxCount: Int? + value = ["/pet/findByTags"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List ): ResponseEntity> { - return ResponseEntity(service.findPetsByTags(tags, maxCount), HttpStatus.OK) + return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Find pet by ID", - nickname = "getPetById", - notes = "Returns a single pet", - response = Pet::class, - authorizations = [Authorization(value = "api_key")]) + value = "Find pet by ID", + nickname = "getPetById", + notes = "Returns a single pet", + response = Pet::class, + authorizations = [Authorization(value = "api_key")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) @RequestMapping( - value = ["/pet/{petId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - suspend fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: Long + value = ["/pet/{petId}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + suspend fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: kotlin.Long ): ResponseEntity { - return ResponseEntity(service.getPetById(petId), HttpStatus.OK) + return ResponseEntity(service.getPetById(petId), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Update an existing pet", - nickname = "updatePet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Update an existing pet", + nickname = "updatePet", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) + value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) @RequestMapping( - value = ["/pet"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.PUT]) + value = ["/pet"], + consumes = ["application/json", "application/xml"], + method = [RequestMethod.PUT]) suspend fun updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet ): ResponseEntity { - return ResponseEntity(service.updatePet(pet), HttpStatus.OK) + return ResponseEntity(service.updatePet(pet), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Updates a pet in the store with form data", - nickname = "updatePetWithForm", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Updates a pet in the store with form data", + nickname = "updatePetWithForm", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 405, message = "Invalid input")]) + value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( - value = ["/pet/{petId}"], - consumes = ["application/x-www-form-urlencoded"], - method = [RequestMethod.POST]) - suspend fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required=true) @PathVariable("petId") petId: Long -,@ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) name: String? -,@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) status: String? + value = ["/pet/{petId}"], + consumes = ["application/x-www-form-urlencoded"], + method = [RequestMethod.POST]) + suspend fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required=true) @PathVariable("petId") petId: kotlin.Long +,@ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) name: kotlin.String? +,@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) status: kotlin.String? ): ResponseEntity { - return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.OK) + return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.valueOf(405)) } @ApiOperation( - value = "uploads an image", - nickname = "uploadFile", - notes = "", - response = ModelApiResponse::class, - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "uploads an image", + nickname = "uploadFile", + notes = "", + response = ModelApiResponse::class, + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) + value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) @RequestMapping( - value = ["/pet/{petId}/uploadImage"], - produces = ["application/json"], - consumes = ["multipart/form-data"], - method = [RequestMethod.POST]) - suspend fun uploadFile(@ApiParam(value = "ID of pet to update", required=true) @PathVariable("petId") petId: Long -,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) additionalMetadata: String? + value = ["/pet/{petId}/uploadImage"], + produces = ["application/json"], + consumes = ["multipart/form-data"], + method = [RequestMethod.POST]) + suspend fun uploadFile(@ApiParam(value = "ID of pet to update", required=true) @PathVariable("petId") petId: kotlin.Long +,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file") file: org.springframework.core.io.Resource? ): ResponseEntity { - return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.OK) + return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt index 2bd53b2a56d..033bd517c44 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -7,17 +7,17 @@ interface PetApiService { suspend fun addPet(pet: Pet): Unit - suspend fun deletePet(petId: Long, apiKey: String?): Unit + suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit - fun findPetsByStatus(status: List): Flow + fun findPetsByStatus(status: kotlin.collections.List): Flow - fun findPetsByTags(tags: List, maxCount: Int?): Flow + fun findPetsByTags(tags: kotlin.collections.List): Flow - suspend fun getPetById(petId: Long): Pet + suspend fun getPetById(petId: kotlin.Long): Pet suspend fun updatePet(pet: Pet): Unit - suspend fun updatePetWithForm(petId: Long, name: String?, status: String?): Unit + suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit - suspend fun uploadFile(petId: Long, additionalMetadata: String?, file: org.springframework.core.io.Resource?): ModelApiResponse + suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt index 009f039d860..e6db20b52c9 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt @@ -11,19 +11,19 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override suspend fun deletePet(petId: Long, apiKey: String?): Unit { + override suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit { TODO("Implement me") } - override fun findPetsByStatus(status: List): Flow { + override fun findPetsByStatus(status: kotlin.collections.List): Flow { TODO("Implement me") } - override fun findPetsByTags(tags: List, maxCount: Int?): Flow { + override fun findPetsByTags(tags: kotlin.collections.List): Flow { TODO("Implement me") } - override suspend fun getPetById(petId: Long): Pet { + override suspend fun getPetById(petId: kotlin.Long): Pet { TODO("Implement me") } @@ -31,11 +31,11 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override suspend fun updatePetWithForm(petId: Long, name: String?, status: String?): Unit { + override suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit { TODO("Implement me") } - override suspend fun uploadFile(petId: Long, additionalMetadata: String?, file: org.springframework.core.io.Resource?): ModelApiResponse { + override suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse { TODO("Implement me") } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt index 2ee42a77233..9bbe9fa4665 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -44,66 +44,66 @@ import kotlin.collections.Map class StoreApiController(@Autowired(required = true) val service: StoreApiService) { @ApiOperation( - value = "Delete purchase order by ID", - nickname = "deleteOrder", - notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") + value = "Delete purchase order by ID", + nickname = "deleteOrder", + notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) + value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( - value = ["/store/order/{orderId}"], - method = [RequestMethod.DELETE]) - suspend fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: String + value = ["/store/order/{orderId}"], + method = [RequestMethod.DELETE]) + suspend fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String ): ResponseEntity { - return ResponseEntity(service.deleteOrder(orderId), HttpStatus.OK) + return ResponseEntity(service.deleteOrder(orderId), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Returns pet inventories by status", - nickname = "getInventory", - notes = "Returns a map of status codes to quantities", - response = Int::class, - responseContainer = "Map", - authorizations = [Authorization(value = "api_key")]) + value = "Returns pet inventories by status", + nickname = "getInventory", + notes = "Returns a map of status codes to quantities", + response = kotlin.Int::class, + responseContainer = "Map", + authorizations = [Authorization(value = "api_key")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Map::class, responseContainer = "Map")]) + value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) @RequestMapping( - value = ["/store/inventory"], - produces = ["application/json"], - method = [RequestMethod.GET]) - suspend fun getInventory(): ResponseEntity> { - return ResponseEntity(service.getInventory(), HttpStatus.OK) + value = ["/store/inventory"], + produces = ["application/json"], + method = [RequestMethod.GET]) + suspend fun getInventory(): ResponseEntity> { + return ResponseEntity(service.getInventory(), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Find purchase order by ID", - nickname = "getOrderById", - notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - response = Order::class) + value = "Find purchase order by ID", + nickname = "getOrderById", + notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + response = Order::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( - value = ["/store/order/{orderId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - suspend fun getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") orderId: Long + value = ["/store/order/{orderId}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + suspend fun getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") orderId: kotlin.Long ): ResponseEntity { - return ResponseEntity(service.getOrderById(orderId), HttpStatus.OK) + return ResponseEntity(service.getOrderById(orderId), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Place an order for a pet", - nickname = "placeOrder", - notes = "", - response = Order::class) + value = "Place an order for a pet", + nickname = "placeOrder", + notes = "", + response = Order::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) @RequestMapping( - value = ["/store/order"], - produces = ["application/xml", "application/json"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/store/order"], + produces = ["application/xml", "application/json"], + consumes = ["application/json"], + method = [RequestMethod.POST]) suspend fun placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody order: Order ): ResponseEntity { - return ResponseEntity(service.placeOrder(order), HttpStatus.OK) + return ResponseEntity(service.placeOrder(order), HttpStatus.valueOf(200)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt index 84dc2837054..89393699d39 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt @@ -4,11 +4,11 @@ import org.openapitools.model.Order import kotlinx.coroutines.flow.Flow; interface StoreApiService { - suspend fun deleteOrder(orderId: String): Unit + suspend fun deleteOrder(orderId: kotlin.String): Unit - suspend fun getInventory(): Map + suspend fun getInventory(): Map - suspend fun getOrderById(orderId: Long): Order + suspend fun getOrderById(orderId: kotlin.Long): Order suspend fun placeOrder(order: Order): Order } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt index f29e7e08c2e..52fc3ff57c0 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt @@ -6,15 +6,15 @@ import org.springframework.stereotype.Service @Service class StoreApiServiceImpl : StoreApiService { - override suspend fun deleteOrder(orderId: String): Unit { + override suspend fun deleteOrder(orderId: kotlin.String): Unit { TODO("Implement me") } - override suspend fun getInventory(): Map { + override suspend fun getInventory(): Map { TODO("Implement me") } - override suspend fun getOrderById(orderId: Long): Order { + override suspend fun getOrderById(orderId: kotlin.Long): Order { TODO("Implement me") } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt index 1aed45eebdd..0a0c2492d32 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -44,129 +44,129 @@ import kotlin.collections.Map class UserApiController(@Autowired(required = true) val service: UserApiService) { @ApiOperation( - value = "Create user", - nickname = "createUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Create user", + nickname = "createUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user"], + consumes = ["application/json"], + method = [RequestMethod.POST]) suspend fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity { - return ResponseEntity(service.createUser(user), HttpStatus.OK) + return ResponseEntity(service.createUser(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Creates list of users with given input array", - nickname = "createUsersWithArrayInput", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Creates list of users with given input array", + nickname = "createUsersWithArrayInput", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/createWithArray"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user/createWithArray"], + consumes = ["application/json"], + method = [RequestMethod.POST]) suspend fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: Flow ): ResponseEntity { - return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.OK) + return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Creates list of users with given input array", - nickname = "createUsersWithListInput", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Creates list of users with given input array", + nickname = "createUsersWithListInput", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/createWithList"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user/createWithList"], + consumes = ["application/json"], + method = [RequestMethod.POST]) suspend fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: Flow ): ResponseEntity { - return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.OK) + return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Delete user", - nickname = "deleteUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Delete user", + nickname = "deleteUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) + value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - method = [RequestMethod.DELETE]) - suspend fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: String + value = ["/user/{username}"], + method = [RequestMethod.DELETE]) + suspend fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity { - return ResponseEntity(service.deleteUser(username), HttpStatus.OK) + return ResponseEntity(service.deleteUser(username), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Get user by user name", - nickname = "getUserByName", - notes = "", - response = User::class) + value = "Get user by user name", + nickname = "getUserByName", + notes = "", + response = User::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) + value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - suspend fun getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") username: String + value = ["/user/{username}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + suspend fun getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity { - return ResponseEntity(service.getUserByName(username), HttpStatus.OK) + return ResponseEntity(service.getUserByName(username), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Logs user into the system", - nickname = "loginUser", - notes = "", - response = String::class) + value = "Logs user into the system", + nickname = "loginUser", + notes = "", + response = kotlin.String::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) + value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) @RequestMapping( - value = ["/user/login"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - suspend fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: String -,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: String -): ResponseEntity { - return ResponseEntity(service.loginUser(username, password), HttpStatus.OK) + value = ["/user/login"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + suspend fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String +): ResponseEntity { + return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Logs out current logged in user session", - nickname = "logoutUser", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Logs out current logged in user session", + nickname = "logoutUser", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/logout"], - method = [RequestMethod.GET]) + value = ["/user/logout"], + method = [RequestMethod.GET]) suspend fun logoutUser(): ResponseEntity { - return ResponseEntity(service.logoutUser(), HttpStatus.OK) + return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Updated user", - nickname = "updateUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Updated user", + nickname = "updateUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) + value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - consumes = ["application/json"], - method = [RequestMethod.PUT]) - suspend fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: String + value = ["/user/{username}"], + consumes = ["application/json"], + method = [RequestMethod.PUT]) + suspend fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: kotlin.String ,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity { - return ResponseEntity(service.updateUser(username, user), HttpStatus.OK) + return ResponseEntity(service.updateUser(username, user), HttpStatus.valueOf(400)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt index 999ae4f4074..43dd4b0a384 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt @@ -10,13 +10,13 @@ interface UserApiService { suspend fun createUsersWithListInput(user: Flow): Unit - suspend fun deleteUser(username: String): Unit + suspend fun deleteUser(username: kotlin.String): Unit - suspend fun getUserByName(username: String): User + suspend fun getUserByName(username: kotlin.String): User - suspend fun loginUser(username: String, password: String): String + suspend fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String suspend fun logoutUser(): Unit - suspend fun updateUser(username: String, user: User): Unit + suspend fun updateUser(username: kotlin.String, user: User): Unit } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt index 8872d309e4d..251bd927749 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt @@ -18,15 +18,15 @@ class UserApiServiceImpl : UserApiService { TODO("Implement me") } - override suspend fun deleteUser(username: String): Unit { + override suspend fun deleteUser(username: kotlin.String): Unit { TODO("Implement me") } - override suspend fun getUserByName(username: String): User { + override suspend fun getUserByName(username: kotlin.String): User { TODO("Implement me") } - override suspend fun loginUser(username: String, password: String): String { + override suspend fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String { TODO("Implement me") } @@ -34,7 +34,7 @@ class UserApiServiceImpl : UserApiService { TODO("Implement me") } - override suspend fun updateUser(username: String, user: User): Unit { + override suspend fun updateUser(username: kotlin.String, user: User): Unit { TODO("Implement me") } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt index e042a7f997c..4be27d19748 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt @@ -19,10 +19,10 @@ import io.swagger.annotations.ApiModelProperty data class Category ( @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: Long? = null, + @JsonProperty("id") val id: kotlin.Long? = null, @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") val name: String? = null + @JsonProperty("name") val name: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt index e998bc995ce..ee034530c63 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt @@ -19,10 +19,10 @@ import io.swagger.annotations.ApiModelProperty data class InlineObject ( @ApiModelProperty(example = "null", value = "Updated name of the pet") - @JsonProperty("name") val name: String? = null, + @JsonProperty("name") val name: kotlin.String? = null, @ApiModelProperty(example = "null", value = "Updated status of the pet") - @JsonProperty("status") val status: String? = null + @JsonProperty("status") val status: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt index d29578fd0c0..a289d8c05f7 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt @@ -19,7 +19,7 @@ import io.swagger.annotations.ApiModelProperty data class InlineObject1 ( @ApiModelProperty(example = "null", value = "Additional data to pass to server") - @JsonProperty("additionalMetadata") val additionalMetadata: String? = null, + @JsonProperty("additionalMetadata") val additionalMetadata: kotlin.String? = null, @ApiModelProperty(example = "null", value = "file to upload") @JsonProperty("file") val file: org.springframework.core.io.Resource? = null diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 2f844a9c356..0e86b28e937 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -20,13 +20,13 @@ import io.swagger.annotations.ApiModelProperty data class ModelApiResponse ( @ApiModelProperty(example = "null", value = "") - @JsonProperty("code") val code: Int? = null, + @JsonProperty("code") val code: kotlin.Int? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("type") val type: String? = null, + @JsonProperty("type") val type: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("message") val message: String? = null + @JsonProperty("message") val message: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt index e20d850491f..08726893f7d 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt @@ -24,13 +24,13 @@ import io.swagger.annotations.ApiModelProperty data class Order ( @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: Long? = null, + @JsonProperty("id") val id: kotlin.Long? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("petId") val petId: Long? = null, + @JsonProperty("petId") val petId: kotlin.Long? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("quantity") val quantity: Int? = null, + @JsonProperty("quantity") val quantity: kotlin.Int? = null, @ApiModelProperty(example = "null", value = "") @JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, @@ -39,14 +39,14 @@ data class Order ( @JsonProperty("status") val status: Order.Status? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("complete") val complete: Boolean? = null + @JsonProperty("complete") val complete: kotlin.Boolean? = null ) { /** * Order Status * Values: placed,approved,delivered */ - enum class Status(val value: String) { + enum class Status(val value: kotlin.String) { @JsonProperty("placed") placed("placed"), diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt index 9e054ac22f7..4a2e9d26cb9 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt @@ -27,20 +27,20 @@ data class Pet ( @get:NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @JsonProperty("name") val name: String, + @JsonProperty("name") val name: kotlin.String, @get:NotNull @ApiModelProperty(example = "null", required = true, value = "") - @JsonProperty("photoUrls") val photoUrls: List, + @JsonProperty("photoUrls") val photoUrls: kotlin.collections.List, @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: Long? = null, + @JsonProperty("id") val id: kotlin.Long? = null, @ApiModelProperty(example = "null", value = "") @JsonProperty("category") val category: Category? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("tags") val tags: List? = null, + @JsonProperty("tags") val tags: kotlin.collections.List? = null, @ApiModelProperty(example = "null", value = "pet status in the store") @JsonProperty("status") val status: Pet.Status? = null @@ -50,7 +50,7 @@ data class Pet ( * pet status in the store * Values: available,pending,sold */ - enum class Status(val value: String) { + enum class Status(val value: kotlin.String) { @JsonProperty("available") available("available"), diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt index 40ef1b9a86b..df04dcd035d 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt @@ -19,10 +19,10 @@ import io.swagger.annotations.ApiModelProperty data class Tag ( @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: Long? = null, + @JsonProperty("id") val id: kotlin.Long? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") val name: String? = null + @JsonProperty("name") val name: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt index 95fe12aa467..619b2e7c2c3 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt @@ -25,28 +25,28 @@ import io.swagger.annotations.ApiModelProperty data class User ( @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: Long? = null, + @JsonProperty("id") val id: kotlin.Long? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("username") val username: String? = null, + @JsonProperty("username") val username: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("firstName") val firstName: String? = null, + @JsonProperty("firstName") val firstName: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("lastName") val lastName: String? = null, + @JsonProperty("lastName") val lastName: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("email") val email: String? = null, + @JsonProperty("email") val email: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("password") val password: String? = null, + @JsonProperty("password") val password: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("phone") val phone: String? = null, + @JsonProperty("phone") val phone: kotlin.String? = null, @ApiModelProperty(example = "null", value = "User Status") - @JsonProperty("userStatus") val userStatus: Int? = null + @JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION index 06b5019af3f..0e97bd19efb 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/kotlin-springboot/pom.xml b/samples/openapi3/server/petstore/kotlin-springboot/pom.xml index 10720393bf0..38491e8939c 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/pom.xml +++ b/samples/openapi3/server/petstore/kotlin-springboot/pom.xml @@ -86,6 +86,12 @@ swagger-annotations 1.5.21 + + + com.google.code.findbugs + jsr305 + 3.0.2 + com.fasterxml.jackson.dataformat jackson-dataformat-yaml diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt index 7b397708c7a..4a111fdb7f5 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -44,142 +44,141 @@ import kotlin.collections.Map class PetApiController(@Autowired(required = true) val service: PetApiService) { @ApiOperation( - value = "Add a new pet to the store", - nickname = "addPet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Add a new pet to the store", + nickname = "addPet", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 405, message = "Invalid input")]) + value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( - value = ["/pet"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.POST]) + value = ["/pet"], + consumes = ["application/json", "application/xml"], + method = [RequestMethod.POST]) fun addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet ): ResponseEntity { - return ResponseEntity(service.addPet(pet), HttpStatus.OK) + return ResponseEntity(service.addPet(pet), HttpStatus.valueOf(405)) } @ApiOperation( - value = "Deletes a pet", - nickname = "deletePet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Deletes a pet", + nickname = "deletePet", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid pet value")]) + value = [ApiResponse(code = 400, message = "Invalid pet value")]) @RequestMapping( - value = ["/pet/{petId}"], - method = [RequestMethod.DELETE]) + value = ["/pet/{petId}"], + method = [RequestMethod.DELETE]) fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) apiKey: kotlin.String? ): ResponseEntity { - return ResponseEntity(service.deletePet(petId, apiKey), HttpStatus.OK) + return ResponseEntity(service.deletePet(petId, apiKey), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Finds Pets by status", - nickname = "findPetsByStatus", - notes = "Multiple status values can be provided with comma separated strings", - response = Pet::class, - responseContainer = "List", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Finds Pets by status", + nickname = "findPetsByStatus", + notes = "Multiple status values can be provided with comma separated strings", + response = Pet::class, + responseContainer = "List", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) @RequestMapping( - value = ["/pet/findByStatus"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/pet/findByStatus"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List ): ResponseEntity> { - return ResponseEntity(service.findPetsByStatus(status), HttpStatus.OK) + return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Finds Pets by tags", - nickname = "findPetsByTags", - notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - response = Pet::class, - responseContainer = "List", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Finds Pets by tags", + nickname = "findPetsByTags", + notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + response = Pet::class, + responseContainer = "List", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) @RequestMapping( - value = ["/pet/findByTags"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/pet/findByTags"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List -,@ApiParam(value = "Maximum number of items to return") @Valid @RequestParam(value = "maxCount", required = false) maxCount: kotlin.Int? ): ResponseEntity> { - return ResponseEntity(service.findPetsByTags(tags, maxCount), HttpStatus.OK) + return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Find pet by ID", - nickname = "getPetById", - notes = "Returns a single pet", - response = Pet::class, - authorizations = [Authorization(value = "api_key")]) + value = "Find pet by ID", + nickname = "getPetById", + notes = "Returns a single pet", + response = Pet::class, + authorizations = [Authorization(value = "api_key")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) @RequestMapping( - value = ["/pet/{petId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/pet/{petId}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: kotlin.Long ): ResponseEntity { - return ResponseEntity(service.getPetById(petId), HttpStatus.OK) + return ResponseEntity(service.getPetById(petId), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Update an existing pet", - nickname = "updatePet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Update an existing pet", + nickname = "updatePet", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) + value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) @RequestMapping( - value = ["/pet"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.PUT]) + value = ["/pet"], + consumes = ["application/json", "application/xml"], + method = [RequestMethod.PUT]) fun updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet ): ResponseEntity { - return ResponseEntity(service.updatePet(pet), HttpStatus.OK) + return ResponseEntity(service.updatePet(pet), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Updates a pet in the store with form data", - nickname = "updatePetWithForm", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Updates a pet in the store with form data", + nickname = "updatePetWithForm", + notes = "", + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 405, message = "Invalid input")]) + value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( - value = ["/pet/{petId}"], - consumes = ["application/x-www-form-urlencoded"], - method = [RequestMethod.POST]) + value = ["/pet/{petId}"], + consumes = ["application/x-www-form-urlencoded"], + method = [RequestMethod.POST]) fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) name: kotlin.String? ,@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) status: kotlin.String? ): ResponseEntity { - return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.OK) + return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.valueOf(405)) } @ApiOperation( - value = "uploads an image", - nickname = "uploadFile", - notes = "", - response = ModelApiResponse::class, - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "uploads an image", + nickname = "uploadFile", + notes = "", + response = ModelApiResponse::class, + authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) + value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) @RequestMapping( - value = ["/pet/{petId}/uploadImage"], - produces = ["application/json"], - consumes = ["multipart/form-data"], - method = [RequestMethod.POST]) + value = ["/pet/{petId}/uploadImage"], + produces = ["application/json"], + consumes = ["multipart/form-data"], + method = [RequestMethod.POST]) fun uploadFile(@ApiParam(value = "ID of pet to update", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file") file: org.springframework.core.io.Resource? ): ResponseEntity { - return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.OK) + return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt index 89bae4c1ceb..364f027cf8b 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -10,7 +10,7 @@ interface PetApiService { fun findPetsByStatus(status: kotlin.collections.List): List - fun findPetsByTags(tags: kotlin.collections.List, maxCount: kotlin.Int?): List + fun findPetsByTags(tags: kotlin.collections.List): List fun getPetById(petId: kotlin.Long): Pet diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt index 26900dc599d..a4e09c0f158 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt @@ -18,7 +18,7 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override fun findPetsByTags(tags: kotlin.collections.List, maxCount: kotlin.Int?): List { + override fun findPetsByTags(tags: kotlin.collections.List): List { TODO("Implement me") } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt index 16104fb0d22..435631042e4 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -43,66 +43,66 @@ import kotlin.collections.Map class StoreApiController(@Autowired(required = true) val service: StoreApiService) { @ApiOperation( - value = "Delete purchase order by ID", - nickname = "deleteOrder", - notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") + value = "Delete purchase order by ID", + nickname = "deleteOrder", + notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) + value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( - value = ["/store/order/{orderId}"], - method = [RequestMethod.DELETE]) + value = ["/store/order/{orderId}"], + method = [RequestMethod.DELETE]) fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String ): ResponseEntity { - return ResponseEntity(service.deleteOrder(orderId), HttpStatus.OK) + return ResponseEntity(service.deleteOrder(orderId), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Returns pet inventories by status", - nickname = "getInventory", - notes = "Returns a map of status codes to quantities", - response = kotlin.Int::class, - responseContainer = "Map", - authorizations = [Authorization(value = "api_key")]) + value = "Returns pet inventories by status", + nickname = "getInventory", + notes = "Returns a map of status codes to quantities", + response = kotlin.Int::class, + responseContainer = "Map", + authorizations = [Authorization(value = "api_key")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) + value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) @RequestMapping( - value = ["/store/inventory"], - produces = ["application/json"], - method = [RequestMethod.GET]) + value = ["/store/inventory"], + produces = ["application/json"], + method = [RequestMethod.GET]) fun getInventory(): ResponseEntity> { - return ResponseEntity(service.getInventory(), HttpStatus.OK) + return ResponseEntity(service.getInventory(), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Find purchase order by ID", - nickname = "getOrderById", - notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - response = Order::class) + value = "Find purchase order by ID", + nickname = "getOrderById", + notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + response = Order::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( - value = ["/store/order/{orderId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/store/order/{orderId}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") orderId: kotlin.Long ): ResponseEntity { - return ResponseEntity(service.getOrderById(orderId), HttpStatus.OK) + return ResponseEntity(service.getOrderById(orderId), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Place an order for a pet", - nickname = "placeOrder", - notes = "", - response = Order::class) + value = "Place an order for a pet", + nickname = "placeOrder", + notes = "", + response = Order::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) @RequestMapping( - value = ["/store/order"], - produces = ["application/xml", "application/json"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/store/order"], + produces = ["application/xml", "application/json"], + consumes = ["application/json"], + method = [RequestMethod.POST]) fun placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody order: Order ): ResponseEntity { - return ResponseEntity(service.placeOrder(order), HttpStatus.OK) + return ResponseEntity(service.placeOrder(order), HttpStatus.valueOf(200)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt index bd7583274b5..f1f7d6eba45 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -43,129 +43,129 @@ import kotlin.collections.Map class UserApiController(@Autowired(required = true) val service: UserApiService) { @ApiOperation( - value = "Create user", - nickname = "createUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Create user", + nickname = "createUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user"], + consumes = ["application/json"], + method = [RequestMethod.POST]) fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity { - return ResponseEntity(service.createUser(user), HttpStatus.OK) + return ResponseEntity(service.createUser(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Creates list of users with given input array", - nickname = "createUsersWithArrayInput", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Creates list of users with given input array", + nickname = "createUsersWithArrayInput", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/createWithArray"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user/createWithArray"], + consumes = ["application/json"], + method = [RequestMethod.POST]) fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: kotlin.collections.List ): ResponseEntity { - return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.OK) + return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Creates list of users with given input array", - nickname = "createUsersWithListInput", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Creates list of users with given input array", + nickname = "createUsersWithListInput", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/createWithList"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user/createWithList"], + consumes = ["application/json"], + method = [RequestMethod.POST]) fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: kotlin.collections.List ): ResponseEntity { - return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.OK) + return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Delete user", - nickname = "deleteUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Delete user", + nickname = "deleteUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) + value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - method = [RequestMethod.DELETE]) + value = ["/user/{username}"], + method = [RequestMethod.DELETE]) fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity { - return ResponseEntity(service.deleteUser(username), HttpStatus.OK) + return ResponseEntity(service.deleteUser(username), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Get user by user name", - nickname = "getUserByName", - notes = "", - response = User::class) + value = "Get user by user name", + nickname = "getUserByName", + notes = "", + response = User::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) + value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/user/{username}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity { - return ResponseEntity(service.getUserByName(username), HttpStatus.OK) + return ResponseEntity(service.getUserByName(username), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Logs user into the system", - nickname = "loginUser", - notes = "", - response = kotlin.String::class) + value = "Logs user into the system", + nickname = "loginUser", + notes = "", + response = kotlin.String::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) + value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) @RequestMapping( - value = ["/user/login"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/user/login"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String ,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String ): ResponseEntity { - return ResponseEntity(service.loginUser(username, password), HttpStatus.OK) + return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Logs out current logged in user session", - nickname = "logoutUser", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Logs out current logged in user session", + nickname = "logoutUser", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/logout"], - method = [RequestMethod.GET]) + value = ["/user/logout"], + method = [RequestMethod.GET]) fun logoutUser(): ResponseEntity { - return ResponseEntity(service.logoutUser(), HttpStatus.OK) + return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Updated user", - nickname = "updateUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Updated user", + nickname = "updateUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) + value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - consumes = ["application/json"], - method = [RequestMethod.PUT]) + value = ["/user/{username}"], + consumes = ["application/json"], + method = [RequestMethod.PUT]) fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: kotlin.String ,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity { - return ResponseEntity(service.updateUser(username, user), HttpStatus.OK) + return ResponseEntity(service.updateUser(username, user), HttpStatus.valueOf(400)) } } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt index 5ced7087da8..f5835ca6519 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt @@ -23,10 +23,10 @@ data class ApiResponse ( val code: kotlin.Int? = null, val type: kotlin.String? = null, val message: kotlin.String? = null -) -: Serializable - +) : Serializable { - + companion object { + private const val serialVersionUID: Long = 123 + } } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt index a347a27877f..4ca711e4ac1 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt @@ -21,10 +21,10 @@ import java.io.Serializable data class Category ( val id: kotlin.Long? = null, val name: kotlin.String? = null -) -: Serializable - +) : Serializable { - + companion object { + private const val serialVersionUID: Long = 123 + } } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt index f3eba3816ed..d2200d829dc 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt @@ -30,11 +30,12 @@ data class Order ( /* Order Status */ val status: Order.Status? = null, val complete: kotlin.Boolean? = null -) -: Serializable - +) : Serializable { - + companion object { + private const val serialVersionUID: Long = 123 + } + /** * Order Status * Values: placed,approved,delivered @@ -48,6 +49,5 @@ data class Order ( delivered("delivered"); } - } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt index 07644fc8bd2..4dd9cc4d650 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt @@ -32,11 +32,12 @@ data class Pet ( val tags: kotlin.Array? = null, /* pet status in the store */ val status: Pet.Status? = null -) -: Serializable - +) : Serializable { - + companion object { + private const val serialVersionUID: Long = 123 + } + /** * pet status in the store * Values: available,pending,sold @@ -50,6 +51,5 @@ data class Pet ( sold("sold"); } - } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt index aa13b7ca76c..dab1c21898d 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt @@ -21,10 +21,10 @@ import java.io.Serializable data class Tag ( val id: kotlin.Long? = null, val name: kotlin.String? = null -) -: Serializable - +) : Serializable { - + companion object { + private const val serialVersionUID: Long = 123 + } } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/User.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/User.kt index 0aa8a67299f..77f8f02f38a 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/User.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/User.kt @@ -34,10 +34,10 @@ data class User ( val phone: kotlin.String? = null, /* User Status */ val userStatus: kotlin.Int? = null -) -: Serializable - +) : Serializable { - + companion object { + private const val serialVersionUID: Long = 123 + } }