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 8ac3ea459a53..ddc2cbf99c15 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 @@ -95,48 +95,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); @@ -543,16 +514,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/build.gradle.kts b/samples/server/openapi3/petstore/kotlin-springboot/build.gradle.kts index 0192dfa91623..26f4601e5705 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/build.gradle.kts +++ b/samples/server/openapi3/petstore/kotlin-springboot/build.gradle.kts @@ -41,6 +41,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 45c650bae0fe..10720393bf09 100644 --- a/samples/server/openapi3/petstore/kotlin-springboot/pom.xml +++ b/samples/server/openapi3/petstore/kotlin-springboot/pom.xml @@ -107,6 +107,12 @@ 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 21d677c730c5..7b397708c7aa 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 @@ -69,8 +69,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) } @@ -88,7 +88,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) } @@ -106,8 +106,8 @@ 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 -,@ApiParam(value = "Maximum number of items to return") @Valid @RequestParam(value = "maxCount", required = false) maxCount: Int? + 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) } @@ -124,7 +124,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) } @@ -156,9 +156,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) } @@ -176,8 +176,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/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 1ef6953cb76c..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: 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, maxCount: Int?): 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.core.io.Resource?): 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 2b9815beddda..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 @@ -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, maxCount: Int?): 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") } @@ -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/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 3f1615634b1a..16104fb0d22b 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 @@ -51,7 +51,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) } @@ -60,16 +60,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) } @@ -84,7 +84,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/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 ce32895d2197..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: 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 ab4e08e794c4..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 @@ -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/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 42f3e2609038..bd7583274b52 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 @@ -69,7 +69,7 @@ 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 + fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: kotlin.collections.List ): ResponseEntity { return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.OK) } @@ -85,7 +85,7 @@ 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 + fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: kotlin.collections.List ): ResponseEntity { return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.OK) } @@ -100,7 +100,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) } @@ -116,7 +116,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) } @@ -125,16 +125,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) @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 @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) } @@ -163,7 +163,7 @@ 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) @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 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 538b00df9bb6..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: 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 c15ee34dbdb6..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 @@ -9,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") } @@ -33,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 e042a7f997c3..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 @@ -19,10 +19,10 @@ import io.swagger.annotations.ApiModelProperty data class Category ( @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: Long? = null, + @JsonProperty("id") val id: kotlin.Long? = null, @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") val name: String? = null + @JsonProperty("name") val name: kotlin.String? = null ) { } diff --git a/samples/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 e998bc995ce4..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 @@ -19,10 +19,10 @@ import io.swagger.annotations.ApiModelProperty data class InlineObject ( @ApiModelProperty(example = "null", value = "Updated name of the pet") - @JsonProperty("name") val name: String? = null, + @JsonProperty("name") val name: kotlin.String? = null, @ApiModelProperty(example = "null", value = "Updated status of the pet") - @JsonProperty("status") val status: String? = null + @JsonProperty("status") val status: kotlin.String? = null ) { } diff --git a/samples/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 d29578fd0c09..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 @@ -19,7 +19,7 @@ import io.swagger.annotations.ApiModelProperty data class InlineObject1 ( @ApiModelProperty(example = "null", value = "Additional data to pass to server") - @JsonProperty("additionalMetadata") val additionalMetadata: String? = null, + @JsonProperty("additionalMetadata") val additionalMetadata: kotlin.String? = null, @ApiModelProperty(example = "null", value = "file to upload") @JsonProperty("file") val file: org.springframework.core.io.Resource? = null diff --git a/samples/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 2f844a9c3565..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 @@ -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/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 e20d850491fa..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 @@ -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/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 9e054ac22f73..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 @@ -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/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 40ef1b9a86b7..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 @@ -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/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 95fe12aa467b..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 @@ -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/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt index cf2e8c2d1ae0..6beea7c3bedf 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 @@ -69,8 +69,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.valueOf(400)) } @@ -88,7 +88,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.valueOf(200)) } @@ -106,7 +106,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.valueOf(200)) } @@ -123,7 +123,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.valueOf(200)) } @@ -155,9 +155,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.valueOf(405)) } @@ -175,8 +175,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.valueOf(200)) 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 8e5d3cfd6e1e..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: 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 db4ee51c21ab..a3ba066c21a0 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 @@ -51,7 +51,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.valueOf(400)) } @@ -60,16 +60,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.valueOf(200)) } @@ -84,7 +84,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.valueOf(200)) } 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 8ddca95e7d56..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: 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 6fbd89971aa4..0a77ac8ecd82 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 @@ -65,7 +65,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.valueOf(200)) } @@ -79,7 +79,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.valueOf(200)) } @@ -93,7 +93,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.valueOf(400)) } @@ -109,7 +109,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.valueOf(200)) } @@ -118,16 +118,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.valueOf(200)) } @@ -153,7 +153,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.valueOf(400)) 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 f7286538c609..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: 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!!)