From d81b571d7cfd8a6ffc2628fb77b79e821e4991c5 Mon Sep 17 00:00:00 2001 From: Vincent Devos Date: Fri, 31 May 2019 12:03:59 +0200 Subject: [PATCH 1/7] [KOTLIN Spring] fix generation with modelNamePrefix/modelNameSuffix --- .../languages/KotlinSpringServerCodegen.java | 45 +++-------------- .../.openapi-generator/VERSION | 2 +- .../kotlin-springboot/build.gradle.kts | 1 + .../petstore/kotlin-springboot/pom.xml | 6 +++ .../kotlin/org/openapitools/api/PetApi.kt | 49 ++++++++++++++----- .../org/openapitools/api/PetApiService.kt | 12 ++--- .../org/openapitools/api/PetApiServiceImpl.kt | 13 +++-- .../kotlin/org/openapitools/api/StoreApi.kt | 32 ++++++++---- .../org/openapitools/api/StoreApiService.kt | 6 +-- .../openapitools/api/StoreApiServiceImpl.kt | 7 ++- .../kotlin/org/openapitools/api/UserApi.kt | 44 ++++++++++++----- .../org/openapitools/api/UserApiService.kt | 12 ++--- .../openapitools/api/UserApiServiceImpl.kt | 13 +++-- .../kotlin/org/openapitools/model/Category.kt | 13 +++-- .../org/openapitools/model/InlineObject.kt | 13 +++-- .../org/openapitools/model/InlineObject1.kt | 13 +++-- .../openapitools/model/ModelApiResponse.kt | 15 ++++-- .../kotlin/org/openapitools/model/Order.kt | 19 ++++--- .../main/kotlin/org/openapitools/model/Pet.kt | 19 ++++--- .../main/kotlin/org/openapitools/model/Tag.kt | 13 +++-- .../kotlin/org/openapitools/model/User.kt | 25 ++++++---- .../kotlin/org/openapitools/api/PetApi.kt | 20 ++++---- .../org/openapitools/api/PetApiService.kt | 12 ++--- .../org/openapitools/api/PetApiServiceImpl.kt | 12 ++--- .../kotlin/org/openapitools/api/StoreApi.kt | 10 ++-- .../org/openapitools/api/StoreApiService.kt | 6 +-- .../openapitools/api/StoreApiServiceImpl.kt | 6 +-- .../kotlin/org/openapitools/api/UserApi.kt | 20 ++++---- .../org/openapitools/api/UserApiService.kt | 12 ++--- .../openapitools/api/UserApiServiceImpl.kt | 12 ++--- .../kotlin/org/openapitools/model/Category.kt | 4 +- .../openapitools/model/ModelApiResponse.kt | 6 +-- .../kotlin/org/openapitools/model/Order.kt | 10 ++-- .../main/kotlin/org/openapitools/model/Pet.kt | 10 ++-- .../main/kotlin/org/openapitools/model/Tag.kt | 4 +- .../kotlin/org/openapitools/model/User.kt | 16 +++--- .../kotlin/org/openapitools/api/PetApiTest.kt | 20 ++++---- .../org/openapitools/api/StoreApiTest.kt | 6 +-- .../org/openapitools/api/UserApiTest.kt | 16 +++--- 39 files changed, 324 insertions(+), 250 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java index f1420915317d..6e699f68ee80 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java @@ -92,48 +92,19 @@ public KotlinSpringServerCodegen() { updateOption(CodegenConstants.ARTIFACT_ID, this.artifactId); // Use lists instead of arrays - typeMapping.put("array", "List"); - typeMapping.put("string", "String"); - typeMapping.put("boolean", "Boolean"); - typeMapping.put("integer", "Int"); - typeMapping.put("float", "Float"); - typeMapping.put("long", "Long"); - typeMapping.put("double", "Double"); - typeMapping.put("ByteArray", "ByteArray"); - typeMapping.put("list", "List"); - typeMapping.put("map", "Map"); - typeMapping.put("object", "Any"); - typeMapping.put("binary", "Array"); + typeMapping.put("array", "kotlin.collections.List"); + typeMapping.put("list", "kotlin.collections.List"); typeMapping.put("date", "java.time.LocalDate"); typeMapping.put("date-time", "java.time.OffsetDateTime"); typeMapping.put("Date", "java.time.LocalDate"); typeMapping.put("DateTime", "java.time.OffsetDateTime"); - importMapping.put("Date", "java.time.LocalDate"); - importMapping.put("DateTime", "java.time.OffsetDateTime"); - // use resource for file handling typeMapping.put("file", "org.springframework.core.io.Resource"); - - languageSpecificPrimitives.addAll(Arrays.asList( - "Any", - "Byte", - "ByteArray", - "Short", - "Int", - "Long", - "Float", - "Double", - "Boolean", - "Char", - "String", - "Array", - "List", - "Map", - "Set" - )); + importMapping.put("Date", "java.time.LocalDate"); + importMapping.put("DateTime", "java.time.OffsetDateTime"); addOption(TITLE, "server title name or client service name", title); addOption(BASE_PACKAGE, "base package (invokerPackage) for generated code", basePackage); @@ -524,16 +495,16 @@ private interface DataTypeAssigner { private void doDataTypeAssignment(final String returnType, DataTypeAssigner dataTypeAssigner) { if (returnType == null) { dataTypeAssigner.setReturnType("Unit"); - } else if (returnType.startsWith("List")) { + } else if (returnType.startsWith("kotlin.collections.List")) { int end = returnType.lastIndexOf(">"); if (end > 0) { - dataTypeAssigner.setReturnType(returnType.substring("List<".length(), end).trim()); + dataTypeAssigner.setReturnType(returnType.substring("kotlin.collections.List<".length(), end).trim()); dataTypeAssigner.setReturnContainer("List"); } - } else if (returnType.startsWith("Map")) { + } else if (returnType.startsWith("kotlin.collections.Map")) { int end = returnType.lastIndexOf(">"); if (end > 0) { - dataTypeAssigner.setReturnType(returnType.substring("Map<".length(), end).split(",")[1].trim()); + dataTypeAssigner.setReturnType(returnType.substring("kotlin.collections.Map<".length(), end).split(",")[1].trim()); dataTypeAssigner.setReturnContainer("Map"); } } diff --git a/samples/server/openapi3/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/server/openapi3/petstore/kotlin-springboot/.openapi-generator/VERSION index afa636560641..06b5019af3f4 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/server/openapi3/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/openapi3/petstore/kotlin-springboot/build.gradle.kts b/samples/server/openapi3/petstore/kotlin-springboot/build.gradle.kts index f7a2deac9960..29ca3edef7e3 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/build.gradle.kts +++ b/samples/server/openapi3/petstore/kotlin-springboot/build.gradle.kts @@ -40,6 +40,7 @@ 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") } diff --git a/samples/server/openapi3/petstore/kotlin-springboot/pom.xml b/samples/server/openapi3/petstore/kotlin-springboot/pom.xml index 96ed05a21d5b..71876ce723f4 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/pom.xml +++ b/samples/server/openapi3/petstore/kotlin-springboot/pom.xml @@ -105,5 +105,11 @@ javax.validation validation-api + + org.jetbrains.kotlin + kotlin-test-junit5 + 1.3.31 + test + diff --git a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt index 8f49e172090d..1ed8a80feaac 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -2,7 +2,13 @@ package org.openapitools.api import org.openapitools.model.ModelApiResponse import org.openapitools.model.Pet -import io.swagger.annotations.* +import io.swagger.annotations.Api +import io.swagger.annotations.ApiOperation +import io.swagger.annotations.ApiParam +import io.swagger.annotations.ApiResponse +import io.swagger.annotations.ApiResponses +import io.swagger.annotations.Authorization +import io.swagger.annotations.AuthorizationScope import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity @@ -16,11 +22,16 @@ import org.springframework.web.bind.annotation.RequestMethod import org.springframework.web.bind.annotation.RequestMapping import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest -import org.springframework.web.multipart.MultipartFile import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map @@ -42,7 +53,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { 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 { + 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) } @@ -56,7 +68,9 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( value = ["/pet/{petId}"], method = [RequestMethod.DELETE]) - fun deletePet(@ApiParam(value = "Pet id to delete", required=true, defaultValue="null") @PathVariable("petId") petId: Long,@ApiParam(value = "" , defaultValue="null") @RequestHeader(value="api_key", required=false) apiKey: String): ResponseEntity { + 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) } @@ -73,7 +87,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { 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", defaultValue = "null") @Valid @RequestParam(value = "status", required = true, defaultValue="null") status: List): ResponseEntity> { + 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) } @@ -90,8 +105,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = ["/pet/findByTags"], produces = ["application/xml", "application/json"], method = [RequestMethod.GET]) - fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true, defaultValue = "null") @Valid @RequestParam(value = "tags", required = true, defaultValue="null") tags: List): ResponseEntity> { - return ResponseEntity(service.findPetsByTags(tags), HttpStatus.OK) + 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) } @ApiOperation( @@ -106,7 +123,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = ["/pet/{petId}"], produces = ["application/xml", "application/json"], method = [RequestMethod.GET]) - fun getPetById(@ApiParam(value = "ID of pet to return", required=true, defaultValue="null") @PathVariable("petId") petId: Long): ResponseEntity { + fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: kotlin.Long +): ResponseEntity { return ResponseEntity(service.getPetById(petId), HttpStatus.OK) } @@ -121,7 +139,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { 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 { + 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) } @@ -136,7 +155,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { 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, defaultValue="null") @PathVariable("petId") petId: Long,@ApiParam(value = "Updated name of the pet", defaultValue="null") @RequestParam(value="name", required=false) name: String ,@ApiParam(value = "Updated status of the pet", defaultValue="null") @RequestParam(value="status", required=false) status: String ): ResponseEntity { + 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) } @@ -153,7 +175,10 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { produces = ["application/json"], consumes = ["multipart/form-data"], method = [RequestMethod.POST]) - fun uploadFile(@ApiParam(value = "ID of pet to update", required=true, defaultValue="null") @PathVariable("petId") petId: Long,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) additionalMetadata: String ,@ApiParam(value = "file detail") @Valid @RequestPart("file") file: MultipartFile): ResponseEntity { + 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) } } diff --git a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt index c2e81c4c66b6..6c6d575db29c 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -7,17 +7,17 @@ interface PetApiService { fun addPet(pet: Pet): Unit - fun deletePet(petId: Long,apiKey: String): Unit + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit - fun findPetsByStatus(status: List): List + fun findPetsByStatus(status: kotlin.collections.List): List - fun findPetsByTags(tags: List): List + fun findPetsByTags(tags: kotlin.collections.List, maxCount: kotlin.Int?): List - fun getPetById(petId: Long): Pet + fun getPetById(petId: kotlin.Long): Pet fun updatePet(pet: Pet): Unit - fun updatePetWithForm(petId: Long,name: String,status: String): Unit + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit - fun uploadFile(petId: Long,additionalMetadata: String,file: org.springframework.web.multipart.MultipartFile): ModelApiResponse + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse } diff --git a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt index 86ae8e063208..26900dc599d7 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt @@ -3,7 +3,6 @@ package org.openapitools.api import org.openapitools.model.ModelApiResponse import org.openapitools.model.Pet import org.springframework.stereotype.Service - @Service class PetApiServiceImpl : PetApiService { @@ -11,19 +10,19 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override fun deletePet(petId: Long,apiKey: String): Unit { + override fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit { TODO("Implement me") } - override fun findPetsByStatus(status: List): List { + override fun findPetsByStatus(status: kotlin.collections.List): List { TODO("Implement me") } - override fun findPetsByTags(tags: List): List { + override fun findPetsByTags(tags: kotlin.collections.List, maxCount: kotlin.Int?): List { TODO("Implement me") } - override fun getPetById(petId: Long): Pet { + override fun getPetById(petId: kotlin.Long): Pet { TODO("Implement me") } @@ -31,11 +30,11 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override fun updatePetWithForm(petId: Long,name: String,status: String): Unit { + override fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit { TODO("Implement me") } - override fun uploadFile(petId: Long,additionalMetadata: String,file: org.springframework.web.multipart.MultipartFile): ModelApiResponse { + override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse { TODO("Implement me") } } diff --git a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt index 6931bd2500c7..430abc7959c1 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -1,7 +1,13 @@ package org.openapitools.api import org.openapitools.model.Order -import io.swagger.annotations.* +import io.swagger.annotations.Api +import io.swagger.annotations.ApiOperation +import io.swagger.annotations.ApiParam +import io.swagger.annotations.ApiResponse +import io.swagger.annotations.ApiResponses +import io.swagger.annotations.Authorization +import io.swagger.annotations.AuthorizationScope import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity @@ -15,11 +21,16 @@ import org.springframework.web.bind.annotation.RequestMethod import org.springframework.web.bind.annotation.RequestMapping import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest -import org.springframework.web.multipart.MultipartFile import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map @@ -39,7 +50,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( value = ["/store/order/{orderId}"], method = [RequestMethod.DELETE]) - fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true, defaultValue="null") @PathVariable("orderId") orderId: String): ResponseEntity { + 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) } @@ -47,16 +59,16 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", - response = Int::class, + 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]) - fun getInventory(): ResponseEntity> { + fun getInventory(): ResponseEntity> { return ResponseEntity(service.getInventory(), HttpStatus.OK) } @@ -71,7 +83,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic 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, defaultValue="null") @PathVariable("orderId") orderId: Long): ResponseEntity { + 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) } @@ -87,7 +100,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic 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 { + fun placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody order: Order +): ResponseEntity { return ResponseEntity(service.placeOrder(order), HttpStatus.OK) } } diff --git a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt index 7767fa87a8a5..5eb379cb1854 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt @@ -4,11 +4,11 @@ import org.openapitools.model.Order interface StoreApiService { - fun deleteOrder(orderId: String): Unit + fun deleteOrder(orderId: kotlin.String): Unit - fun getInventory(): Map + fun getInventory(): Map - fun getOrderById(orderId: Long): Order + fun getOrderById(orderId: kotlin.Long): Order fun placeOrder(order: Order): Order } diff --git a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt index 850853758fed..70e1e76b06b3 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt @@ -2,19 +2,18 @@ package org.openapitools.api import org.openapitools.model.Order import org.springframework.stereotype.Service - @Service class StoreApiServiceImpl : StoreApiService { - override fun deleteOrder(orderId: String): Unit { + override fun deleteOrder(orderId: kotlin.String): Unit { TODO("Implement me") } - override fun getInventory(): Map { + override fun getInventory(): Map { TODO("Implement me") } - override fun getOrderById(orderId: Long): Order { + override fun getOrderById(orderId: kotlin.Long): Order { TODO("Implement me") } diff --git a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt index 71d5afca249e..bc0e76df1497 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -1,7 +1,13 @@ package org.openapitools.api import org.openapitools.model.User -import io.swagger.annotations.* +import io.swagger.annotations.Api +import io.swagger.annotations.ApiOperation +import io.swagger.annotations.ApiParam +import io.swagger.annotations.ApiResponse +import io.swagger.annotations.ApiResponses +import io.swagger.annotations.Authorization +import io.swagger.annotations.AuthorizationScope import org.springframework.http.HttpStatus import org.springframework.http.MediaType import org.springframework.http.ResponseEntity @@ -15,11 +21,16 @@ import org.springframework.web.bind.annotation.RequestMethod import org.springframework.web.bind.annotation.RequestMapping import org.springframework.validation.annotation.Validated import org.springframework.web.context.request.NativeWebRequest -import org.springframework.web.multipart.MultipartFile import org.springframework.beans.factory.annotation.Autowired import javax.validation.Valid -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import kotlin.collections.List import kotlin.collections.Map @@ -41,7 +52,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = ["/user"], consumes = ["application/json"], method = [RequestMethod.POST]) - fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody user: User): ResponseEntity { + fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody user: User +): ResponseEntity { return ResponseEntity(service.createUser(user), HttpStatus.OK) } @@ -56,7 +68,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = ["/user/createWithArray"], consumes = ["application/json"], method = [RequestMethod.POST]) - fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: List): ResponseEntity { + fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: kotlin.collections.List +): ResponseEntity { return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.OK) } @@ -71,7 +84,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = ["/user/createWithList"], consumes = ["application/json"], method = [RequestMethod.POST]) - fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: List): ResponseEntity { + fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: kotlin.collections.List +): ResponseEntity { return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.OK) } @@ -85,7 +99,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( value = ["/user/{username}"], method = [RequestMethod.DELETE]) - fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true, defaultValue="null") @PathVariable("username") username: String): ResponseEntity { + 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) } @@ -100,7 +115,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) 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, defaultValue="null") @PathVariable("username") username: String): ResponseEntity { + 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) } @@ -108,14 +124,16 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = "Logs user into the system", nickname = "loginUser", notes = "", - response = String::class) + 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]) - 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, defaultValue = "null") @Valid @RequestParam(value = "username", required = true, defaultValue="null") username: String,@NotNull @ApiParam(value = "The password for login in clear text", required = true, defaultValue = "null") @Valid @RequestParam(value = "password", required = true, defaultValue="null") password: String): ResponseEntity { + 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) } @@ -144,7 +162,9 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = ["/user/{username}"], consumes = ["application/json"], method = [RequestMethod.PUT]) - fun updateUser(@ApiParam(value = "name that need to be deleted", required=true, defaultValue="null") @PathVariable("username") username: String,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody user: User): ResponseEntity { + 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) } } diff --git a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt index b8a3d7ebae1b..d992fbb7085c 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt @@ -6,17 +6,17 @@ interface UserApiService { fun createUser(user: User): Unit - fun createUsersWithArrayInput(user: List): Unit + fun createUsersWithArrayInput(user: kotlin.collections.List): Unit - fun createUsersWithListInput(user: List): Unit + fun createUsersWithListInput(user: kotlin.collections.List): Unit - fun deleteUser(username: String): Unit + fun deleteUser(username: kotlin.String): Unit - fun getUserByName(username: String): User + fun getUserByName(username: kotlin.String): User - fun loginUser(username: String,password: String): String + fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String fun logoutUser(): Unit - fun updateUser(username: String,user: User): Unit + fun updateUser(username: kotlin.String, user: User): Unit } diff --git a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt index 62b365a6d823..0c24688975c9 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt @@ -2,7 +2,6 @@ package org.openapitools.api import org.openapitools.model.User import org.springframework.stereotype.Service - @Service class UserApiServiceImpl : UserApiService { @@ -10,23 +9,23 @@ class UserApiServiceImpl : UserApiService { TODO("Implement me") } - override fun createUsersWithArrayInput(user: List): Unit { + override fun createUsersWithArrayInput(user: kotlin.collections.List): Unit { TODO("Implement me") } - override fun createUsersWithListInput(user: List): Unit { + override fun createUsersWithListInput(user: kotlin.collections.List): Unit { TODO("Implement me") } - override fun deleteUser(username: String): Unit { + override fun deleteUser(username: kotlin.String): Unit { TODO("Implement me") } - override fun getUserByName(username: String): User { + override fun getUserByName(username: kotlin.String): User { TODO("Implement me") } - override fun loginUser(username: String,password: String): String { + override fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String { TODO("Implement me") } @@ -34,7 +33,7 @@ class UserApiServiceImpl : UserApiService { TODO("Implement me") } - override fun updateUser(username: String,user: User): Unit { + override fun updateUser(username: kotlin.String, user: User): Unit { TODO("Implement me") } } diff --git a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt index 499ed4743e10..4be27d19748b 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,8 +2,13 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.Valid -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import io.swagger.annotations.ApiModelProperty /** @@ -14,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/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject.kt index 3a1526a0db77..ee034530c638 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject.kt @@ -2,8 +2,13 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.Valid -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import io.swagger.annotations.ApiModelProperty /** @@ -14,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/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject1.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject1.kt index 4600798bc9a1..a289d8c05f79 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject1.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/InlineObject1.kt @@ -2,8 +2,13 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.Valid -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import io.swagger.annotations.ApiModelProperty /** @@ -14,10 +19,10 @@ 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: java.io.File? = null + @JsonProperty("file") val file: org.springframework.core.io.Resource? = null ) { } diff --git a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 17697fdfe8d4..0e86b28e937d 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,8 +2,13 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.Valid -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import io.swagger.annotations.ApiModelProperty /** @@ -15,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/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt index be8e2f33fb37..08726893f7d3 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt @@ -3,8 +3,13 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import javax.validation.Valid -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import io.swagger.annotations.ApiModelProperty /** @@ -19,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, @@ -34,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/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt index 80af728b7e49..4a2e9d26cb95 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt @@ -5,8 +5,13 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import javax.validation.Valid -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import io.swagger.annotations.ApiModelProperty /** @@ -22,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 @@ -45,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/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt index 70c706d00a6e..df04dcd035dc 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,8 +2,13 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.Valid -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import io.swagger.annotations.ApiModelProperty /** @@ -14,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/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt index 4cfaf0988746..619b2e7c2c3a 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt @@ -2,8 +2,13 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.Valid -import javax.validation.constraints.* +import javax.validation.constraints.DecimalMax +import javax.validation.constraints.DecimalMin +import javax.validation.constraints.Max +import javax.validation.constraints.Min +import javax.validation.constraints.NotNull +import javax.validation.constraints.Pattern +import javax.validation.constraints.Size import io.swagger.annotations.ApiModelProperty /** @@ -20,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/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt index 2f70853c857e..220e9dcc5974 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -68,8 +68,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( value = ["/pet/{petId}"], method = [RequestMethod.DELETE]) - fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: Long -,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) apiKey: String? + 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) } @@ -87,7 +87,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { 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 + 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) } @@ -105,7 +105,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { 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 + 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), HttpStatus.OK) } @@ -122,7 +122,7 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { 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: Long + fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: kotlin.Long ): ResponseEntity { return ResponseEntity(service.getPetById(petId), HttpStatus.OK) } @@ -154,9 +154,9 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { 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: 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? + 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) } @@ -174,8 +174,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { produces = ["application/json"], consumes = ["multipart/form-data"], method = [RequestMethod.POST]) - 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? + 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) diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt index 741a97d86038..b96e86aff1bb 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -7,17 +7,17 @@ interface PetApiService { fun addPet(body: Pet): Unit - fun deletePet(petId: Long, apiKey: String?): Unit + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit - fun findPetsByStatus(status: List): List + fun findPetsByStatus(status: kotlin.collections.List): List - fun findPetsByTags(tags: List): List + fun findPetsByTags(tags: kotlin.collections.List): List - fun getPetById(petId: Long): Pet + fun getPetById(petId: kotlin.Long): Pet fun updatePet(body: Pet): Unit - fun updatePetWithForm(petId: Long, name: String?, status: String?): Unit + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit - fun uploadFile(petId: Long, additionalMetadata: String?, file: org.springframework.core.io.Resource?): ModelApiResponse + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt index 5ecf2c91f330..452e4e400b7c 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt @@ -10,19 +10,19 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override fun deletePet(petId: Long, apiKey: String?): Unit { + override fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit { TODO("Implement me") } - override fun findPetsByStatus(status: List): List { + override fun findPetsByStatus(status: kotlin.collections.List): List { TODO("Implement me") } - override fun findPetsByTags(tags: List): List { + override fun findPetsByTags(tags: kotlin.collections.List): List { TODO("Implement me") } - override fun getPetById(petId: Long): Pet { + override fun getPetById(petId: kotlin.Long): Pet { TODO("Implement me") } @@ -30,11 +30,11 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override fun updatePetWithForm(petId: Long, name: String?, status: String?): Unit { + override fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit { TODO("Implement me") } - override fun uploadFile(petId: Long, additionalMetadata: String?, file: org.springframework.core.io.Resource?): ModelApiResponse { + override fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse { TODO("Implement me") } } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt index ed467c5700e1..da0148e6ba53 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -50,7 +50,7 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( 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: String + 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) } @@ -59,16 +59,16 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic value = "Returns pet inventories by status", nickname = "getInventory", notes = "Returns a map of status codes to quantities", - response = Int::class, + 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]) - fun getInventory(): ResponseEntity> { + fun getInventory(): ResponseEntity> { return ResponseEntity(service.getInventory(), HttpStatus.OK) } @@ -83,7 +83,7 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic 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: Long + 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) } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt index cf479e2c8a71..e67a66c4f7e5 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt @@ -4,11 +4,11 @@ import org.openapitools.model.Order interface StoreApiService { - fun deleteOrder(orderId: String): Unit + fun deleteOrder(orderId: kotlin.String): Unit - fun getInventory(): Map + fun getInventory(): Map - fun getOrderById(orderId: Long): Order + fun getOrderById(orderId: kotlin.Long): Order fun placeOrder(body: Order): Order } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt index f38e0eca525e..7e733e28dc50 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt @@ -5,15 +5,15 @@ import org.springframework.stereotype.Service @Service class StoreApiServiceImpl : StoreApiService { - override fun deleteOrder(orderId: String): Unit { + override fun deleteOrder(orderId: kotlin.String): Unit { TODO("Implement me") } - override fun getInventory(): Map { + override fun getInventory(): Map { TODO("Implement me") } - override fun getOrderById(orderId: Long): Order { + override fun getOrderById(orderId: kotlin.Long): Order { TODO("Implement me") } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt index bab2a54b1175..b4e28a843b69 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -64,7 +64,7 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( value = ["/user/createWithArray"], method = [RequestMethod.POST]) - fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody body: List + fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody body: kotlin.collections.List ): ResponseEntity { return ResponseEntity(service.createUsersWithArrayInput(body), HttpStatus.OK) } @@ -78,7 +78,7 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( value = ["/user/createWithList"], method = [RequestMethod.POST]) - fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody body: List + fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody body: kotlin.collections.List ): ResponseEntity { return ResponseEntity(service.createUsersWithListInput(body), HttpStatus.OK) } @@ -92,7 +92,7 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( value = ["/user/{username}"], method = [RequestMethod.DELETE]) - fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: String + 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) } @@ -108,7 +108,7 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) 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: String + 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) } @@ -117,16 +117,16 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = "Logs user into the system", nickname = "loginUser", notes = "", - response = String::class) + 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]) - fun loginUser(@NotNull @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 { + fun loginUser(@NotNull @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) } @@ -152,7 +152,7 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( value = ["/user/{username}"], method = [RequestMethod.PUT]) - fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: String + 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 body: User ): ResponseEntity { return ResponseEntity(service.updateUser(username, body), HttpStatus.OK) diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt index de61cf72c437..40148efeb72c 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt @@ -6,17 +6,17 @@ interface UserApiService { fun createUser(body: User): Unit - fun createUsersWithArrayInput(body: List): Unit + fun createUsersWithArrayInput(body: kotlin.collections.List): Unit - fun createUsersWithListInput(body: List): Unit + fun createUsersWithListInput(body: kotlin.collections.List): Unit - fun deleteUser(username: String): Unit + fun deleteUser(username: kotlin.String): Unit - fun getUserByName(username: String): User + fun getUserByName(username: kotlin.String): User - fun loginUser(username: String, password: String): String + fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String fun logoutUser(): Unit - fun updateUser(username: String, body: User): Unit + fun updateUser(username: kotlin.String, body: User): Unit } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt index 3373dcb6a732..ebd822220153 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt @@ -9,23 +9,23 @@ class UserApiServiceImpl : UserApiService { TODO("Implement me") } - override fun createUsersWithArrayInput(body: List): Unit { + override fun createUsersWithArrayInput(body: kotlin.collections.List): Unit { TODO("Implement me") } - override fun createUsersWithListInput(body: List): Unit { + override fun createUsersWithListInput(body: kotlin.collections.List): Unit { TODO("Implement me") } - override fun deleteUser(username: String): Unit { + override fun deleteUser(username: kotlin.String): Unit { TODO("Implement me") } - override fun getUserByName(username: String): User { + override fun getUserByName(username: kotlin.String): User { TODO("Implement me") } - override fun loginUser(username: String, password: String): String { + override fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String { TODO("Implement me") } @@ -33,7 +33,7 @@ class UserApiServiceImpl : UserApiService { TODO("Implement me") } - override fun updateUser(username: String, body: User): Unit { + override fun updateUser(username: kotlin.String, body: User): Unit { TODO("Implement me") } } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt index 1a1dbf7223c4..f477eb4e7a8a 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot/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, @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") val name: String? = null + @JsonProperty("name") val name: kotlin.String? = null ) { } diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 2f844a9c3565..0e86b28e937d 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot/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/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt index e20d850491fa..08726893f7d3 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot/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/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt index 9e054ac22f73..4a2e9d26cb95 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot/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/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt index 40ef1b9a86b7..df04dcd035dc 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot/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/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt index 95fe12aa467b..619b2e7c2c3a 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot/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/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt index 394aff3b339a..d621c1669665 100644 --- a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt +++ b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt @@ -38,8 +38,8 @@ class PetApiTest { */ @Test fun deletePetTest() { - val petId:Long? = null - val apiKey:String? = null + val petId:kotlin.Long? = null + val apiKey:kotlin.String? = null val response: ResponseEntity = api.deletePet(petId!!, apiKey!!) // TODO: test validations @@ -55,7 +55,7 @@ class PetApiTest { */ @Test fun findPetsByStatusTest() { - val status:List? = null + val status:kotlin.collections.List? = null val response: ResponseEntity> = api.findPetsByStatus(status!!) // TODO: test validations @@ -71,7 +71,7 @@ class PetApiTest { */ @Test fun findPetsByTagsTest() { - val tags:List? = null + val tags:kotlin.collections.List? = null val response: ResponseEntity> = api.findPetsByTags(tags!!) // TODO: test validations @@ -87,7 +87,7 @@ class PetApiTest { */ @Test fun getPetByIdTest() { - val petId:Long? = null + val petId:kotlin.Long? = null val response: ResponseEntity = api.getPetById(petId!!) // TODO: test validations @@ -119,9 +119,9 @@ class PetApiTest { */ @Test fun updatePetWithFormTest() { - val petId:Long? = null - val name:String? = null - val status:String? = null + val petId:kotlin.Long? = null + val name:kotlin.String? = null + val status:kotlin.String? = null val response: ResponseEntity = api.updatePetWithForm(petId!!, name!!, status!!) // TODO: test validations @@ -137,8 +137,8 @@ class PetApiTest { */ @Test fun uploadFileTest() { - val petId:Long? = null - val additionalMetadata:String? = null + val petId:kotlin.Long? = null + val additionalMetadata:kotlin.String? = null val file:org.springframework.core.io.Resource? = null val response: ResponseEntity = api.uploadFile(petId!!, additionalMetadata!!, file!!) diff --git a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt index 48b25c4eafdc..82b91cd652bd 100644 --- a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt +++ b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt @@ -21,7 +21,7 @@ class StoreApiTest { */ @Test fun deleteOrderTest() { - val orderId:String? = null + val orderId:kotlin.String? = null val response: ResponseEntity = api.deleteOrder(orderId!!) // TODO: test validations @@ -37,7 +37,7 @@ class StoreApiTest { */ @Test fun getInventoryTest() { - val response: ResponseEntity> = api.getInventory() + val response: ResponseEntity> = api.getInventory() // TODO: test validations } @@ -52,7 +52,7 @@ class StoreApiTest { */ @Test fun getOrderByIdTest() { - val orderId:Long? = null + val orderId:kotlin.Long? = null val response: ResponseEntity = api.getOrderById(orderId!!) // TODO: test validations diff --git a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt index 50940559e87a..14917f70aeb2 100644 --- a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt +++ b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt @@ -37,7 +37,7 @@ class UserApiTest { */ @Test fun createUsersWithArrayInputTest() { - val body:List? = null + val body:kotlin.collections.List? = null val response: ResponseEntity = api.createUsersWithArrayInput(body!!) // TODO: test validations @@ -53,7 +53,7 @@ class UserApiTest { */ @Test fun createUsersWithListInputTest() { - val body:List? = null + val body:kotlin.collections.List? = null val response: ResponseEntity = api.createUsersWithListInput(body!!) // TODO: test validations @@ -69,7 +69,7 @@ class UserApiTest { */ @Test fun deleteUserTest() { - val username:String? = null + val username:kotlin.String? = null val response: ResponseEntity = api.deleteUser(username!!) // TODO: test validations @@ -85,7 +85,7 @@ class UserApiTest { */ @Test fun getUserByNameTest() { - val username:String? = null + val username:kotlin.String? = null val response: ResponseEntity = api.getUserByName(username!!) // TODO: test validations @@ -101,9 +101,9 @@ class UserApiTest { */ @Test fun loginUserTest() { - val username:String? = null - val password:String? = null - val response: ResponseEntity = api.loginUser(username!!, password!!) + val username:kotlin.String? = null + val password:kotlin.String? = null + val response: ResponseEntity = api.loginUser(username!!, password!!) // TODO: test validations } @@ -133,7 +133,7 @@ class UserApiTest { */ @Test fun updateUserTest() { - val username:String? = null + val username:kotlin.String? = null val body:User? = null val response: ResponseEntity = api.updateUser(username!!, body!!) From 050131de5ef5d9298fd1621b2545f53c32e06c8c Mon Sep 17 00:00:00 2001 From: Vincent Devos <46601673+karismann@users.noreply.github.com> Date: Mon, 3 Jun 2019 09:56:33 +0200 Subject: [PATCH 2/7] fix indent --- .../kotlin/org/openapitools/api/PetApiService.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt index 4299df3065a9..89bae4c1ceb8 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -6,17 +6,17 @@ interface PetApiService { fun addPet(pet: Pet): Unit - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit - fun findPetsByStatus(status: kotlin.collections.List): List + fun findPetsByStatus(status: kotlin.collections.List): List - fun findPetsByTags(tags: kotlin.collections.List, maxCount: kotlin.Int?): List + fun findPetsByTags(tags: kotlin.collections.List, maxCount: kotlin.Int?): List - fun getPetById(petId: kotlin.Long): Pet + fun getPetById(petId: kotlin.Long): Pet fun updatePet(pet: Pet): Unit - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse } From 44829d19ff46cbbbbc862967df95dc137f5a7b10 Mon Sep 17 00:00:00 2001 From: Vincent Devos <46601673+karismann@users.noreply.github.com> Date: Mon, 3 Jun 2019 09:57:42 +0200 Subject: [PATCH 3/7] fix indent --- .../src/main/kotlin/org/openapitools/api/StoreApiService.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt index 83d8be0d6194..5fa51ca922e9 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt @@ -3,11 +3,11 @@ package org.openapitools.api import org.openapitools.model.Order interface StoreApiService { - fun deleteOrder(orderId: kotlin.String): Unit + fun deleteOrder(orderId: kotlin.String): Unit - fun getInventory(): Map + fun getInventory(): Map - fun getOrderById(orderId: kotlin.Long): Order + fun getOrderById(orderId: kotlin.Long): Order fun placeOrder(order: Order): Order } From e153263bf74e9a9803cd73e9cadd53515657ceea Mon Sep 17 00:00:00 2001 From: Vincent Devos <46601673+karismann@users.noreply.github.com> Date: Mon, 3 Jun 2019 09:58:34 +0200 Subject: [PATCH 4/7] fix indent --- .../kotlin/org/openapitools/api/UserApiService.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt index f894165efb66..d64d09e8314c 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt +++ b/samples/server/openapi3/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt @@ -5,17 +5,17 @@ interface UserApiService { fun createUser(user: User): Unit - fun createUsersWithArrayInput(user: kotlin.collections.List): Unit + fun createUsersWithArrayInput(user: kotlin.collections.List): Unit - fun createUsersWithListInput(user: kotlin.collections.List): Unit + fun createUsersWithListInput(user: kotlin.collections.List): Unit - fun deleteUser(username: kotlin.String): Unit + fun deleteUser(username: kotlin.String): Unit - fun getUserByName(username: kotlin.String): User + fun getUserByName(username: kotlin.String): User - fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String + fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String fun logoutUser(): Unit - fun updateUser(username: kotlin.String, user: User): Unit + fun updateUser(username: kotlin.String, user: User): Unit } From 53df04bc88573c3ab259ce0e3db05ec43b3454dc Mon Sep 17 00:00:00 2001 From: Vincent Devos <46601673+karismann@users.noreply.github.com> Date: Mon, 3 Jun 2019 09:59:20 +0200 Subject: [PATCH 5/7] fix indent --- .../kotlin/org/openapitools/api/PetApiService.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt index b5f08cb75257..f3f2fd68b6c2 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -6,17 +6,17 @@ interface PetApiService { fun addPet(body: Pet): Unit - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit - fun findPetsByStatus(status: kotlin.collections.List): List + fun findPetsByStatus(status: kotlin.collections.List): List - fun findPetsByTags(tags: kotlin.collections.List): List + fun findPetsByTags(tags: kotlin.collections.List): List - fun getPetById(petId: kotlin.Long): Pet + fun getPetById(petId: kotlin.Long): Pet fun updatePet(body: Pet): Unit - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse } From 918482df8d4bdf5514e666c7ec47fff2de0e0f7f Mon Sep 17 00:00:00 2001 From: Vincent Devos <46601673+karismann@users.noreply.github.com> Date: Mon, 3 Jun 2019 09:59:57 +0200 Subject: [PATCH 6/7] fix indent --- .../src/main/kotlin/org/openapitools/api/StoreApiService.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt index c1df51e48873..d4a4ef9507f2 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiService.kt @@ -3,11 +3,11 @@ package org.openapitools.api import org.openapitools.model.Order interface StoreApiService { - fun deleteOrder(orderId: kotlin.String): Unit + fun deleteOrder(orderId: kotlin.String): Unit - fun getInventory(): Map + fun getInventory(): Map - fun getOrderById(orderId: kotlin.Long): Order + fun getOrderById(orderId: kotlin.Long): Order fun placeOrder(body: Order): Order } From 038b025e3abc447a7e823c3f07e37f4f02e9f9af Mon Sep 17 00:00:00 2001 From: Vincent Devos <46601673+karismann@users.noreply.github.com> Date: Mon, 3 Jun 2019 10:00:45 +0200 Subject: [PATCH 7/7] fix indent --- .../kotlin/org/openapitools/api/UserApiService.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt index b58125464185..491705c3b509 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiService.kt @@ -5,17 +5,17 @@ interface UserApiService { fun createUser(body: User): Unit - fun createUsersWithArrayInput(body: kotlin.collections.List): Unit + fun createUsersWithArrayInput(body: kotlin.collections.List): Unit - fun createUsersWithListInput(body: kotlin.collections.List): Unit + fun createUsersWithListInput(body: kotlin.collections.List): Unit - fun deleteUser(username: kotlin.String): Unit + fun deleteUser(username: kotlin.String): Unit - fun getUserByName(username: kotlin.String): User + fun getUserByName(username: kotlin.String): User - fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String + fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String fun logoutUser(): Unit - fun updateUser(username: kotlin.String, body: User): Unit + fun updateUser(username: kotlin.String, body: User): Unit }