diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinMiskServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinMiskServerCodegen.java index ccdbbd6da93f..f873d7061362 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinMiskServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinMiskServerCodegen.java @@ -172,6 +172,8 @@ public KotlinMiskServerCodegen() { artifactId = "openapi-kotlin-misk-server"; artifactVersion = apiVersion; + typeMapping.put("array", "kotlin.collections.List"); + updateOption(CodegenConstants.API_PACKAGE, apiPackage); updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage); additionalProperties.put(ROOT_PACKAGE, rootPackage); @@ -328,4 +330,4 @@ private static Map getMappings() { return result; } -} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-misk/apiAction.mustache b/modules/openapi-generator/src/main/resources/kotlin-misk/apiAction.mustache index 094e78f60b54..9d9f929aeed6 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-misk/apiAction.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-misk/apiAction.mustache @@ -28,6 +28,7 @@ import misk.web.QueryParam import misk.web.RequestBody import misk.web.RequestContentType import misk.web.RequestHeader +import misk.web.Response import misk.web.ResponseContentType import misk.web.mediatype.MediaTypes {{#imports}} @@ -50,10 +51,13 @@ class {{classname}}Action @Inject constructor( {{#actionAnnotations}} {{{.}}} {{/actionAnnotations}} - fun {{operationId}}({{#allParams}} - {{>queryParams}}{{>pathParams}}{{>headerParams}}{{>cookieParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}: {{{returnType}}}{{/returnType}} { + fun {{operationId}}( +{{#allParams}} + {{>queryParams}}{{>pathParams}}{{>headerParams}}{{>cookieParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}} +{{/allParams}} + ): {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Response{{/returnType}} { TODO() } {{/operation}} } -{{/operations}} +{{/operations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-misk/optionalDataType.mustache b/modules/openapi-generator/src/main/resources/kotlin-misk/optionalDataType.mustache index 96a2ec611e60..cb39a7d46a70 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-misk/optionalDataType.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-misk/optionalDataType.mustache @@ -1 +1 @@ -{{^isFile}}{{{dataType}}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isFile}}{{#isFile}}{{#isArray}}Array<{{/isArray}}{{#isArray}}>{{/isArray}}{{^isArray}}{{^required}}{{/required}}{{/isArray}}{{/isFile}} \ No newline at end of file +{{^isFile}}{{{dataType}}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isFile}}{{#isFile}}{{#isArray}}kotlin.collections.List<{{/isArray}}{{#isArray}}>{{/isArray}}{{^isArray}}{{^required}}{{/required}}{{/isArray}}{{/isFile}} \ No newline at end of file diff --git a/samples/server/petstore/kotlin-misk-config/docs/Pet.md b/samples/server/petstore/kotlin-misk-config/docs/Pet.md index e60adf1fc22f..da70fca06e65 100644 --- a/samples/server/petstore/kotlin-misk-config/docs/Pet.md +++ b/samples/server/petstore/kotlin-misk-config/docs/Pet.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **kotlin.String** | | -**photoUrls** | **kotlin.Array<kotlin.String>** | | +**photoUrls** | **kotlin.collections.List<kotlin.String>** | | **id** | **kotlin.Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional] +**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] **status** | [**inline**](#Status) | pet status in the store | [optional] diff --git a/samples/server/petstore/kotlin-misk-config/docs/PetApi.md b/samples/server/petstore/kotlin-misk-config/docs/PetApi.md index c12d3668388c..99dbe788edb0 100644 --- a/samples/server/petstore/kotlin-misk-config/docs/PetApi.md +++ b/samples/server/petstore/kotlin-misk-config/docs/PetApi.md @@ -111,7 +111,7 @@ null (empty response body) # **findPetsByStatus** -> kotlin.Array<Pet> findPetsByStatus(status) +> kotlin.collections.List<Pet> findPetsByStatus(status) Finds Pets by status @@ -124,9 +124,9 @@ Multiple status values can be provided with comma separated strings //import org.openapitools.server.api.model.* val apiInstance = PetApi() -val status : kotlin.Array = // kotlin.Array | Status values that need to be considered for filter +val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter try { - val result : kotlin.Array = apiInstance.findPetsByStatus(status) + val result : kotlin.collections.List = apiInstance.findPetsByStatus(status) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#findPetsByStatus") @@ -141,11 +141,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] ### Return type -[**kotlin.Array<Pet>**](Pet.md) +[**kotlin.collections.List<Pet>**](Pet.md) ### Authorization @@ -158,7 +158,7 @@ Name | Type | Description | Notes # **findPetsByTags** -> kotlin.Array<Pet> findPetsByTags(tags) +> kotlin.collections.List<Pet> findPetsByTags(tags) Finds Pets by tags @@ -171,9 +171,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 //import org.openapitools.server.api.model.* val apiInstance = PetApi() -val tags : kotlin.Array = // kotlin.Array | Tags to filter by +val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by try { - val result : kotlin.Array = apiInstance.findPetsByTags(tags) + val result : kotlin.collections.List = apiInstance.findPetsByTags(tags) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#findPetsByTags") @@ -188,11 +188,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | + **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | ### Return type -[**kotlin.Array<Pet>**](Pet.md) +[**kotlin.collections.List<Pet>**](Pet.md) ### Authorization diff --git a/samples/server/petstore/kotlin-misk-config/docs/UserApi.md b/samples/server/petstore/kotlin-misk-config/docs/UserApi.md index b8f5fca6eea0..ef066d94e9f9 100644 --- a/samples/server/petstore/kotlin-misk-config/docs/UserApi.md +++ b/samples/server/petstore/kotlin-misk-config/docs/UserApi.md @@ -75,7 +75,7 @@ Creates list of users with given input array //import org.openapitools.server.api.model.* val apiInstance = UserApi() -val user : kotlin.Array = // kotlin.Array | List of user object +val user : kotlin.collections.List = // kotlin.collections.List | List of user object try { apiInstance.createUsersWithArrayInput(user) } catch (e: ClientException) { @@ -91,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](User.md)| List of user object | + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | ### Return type @@ -121,7 +121,7 @@ Creates list of users with given input array //import org.openapitools.server.api.model.* val apiInstance = UserApi() -val user : kotlin.Array = // kotlin.Array | List of user object +val user : kotlin.collections.List = // kotlin.collections.List | List of user object try { apiInstance.createUsersWithListInput(user) } catch (e: ClientException) { @@ -137,7 +137,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](User.md)| List of user object | + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt b/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt index f8784b0c7715..f98d5a463e85 100644 --- a/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt +++ b/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt @@ -25,6 +25,7 @@ import misk.web.QueryParam import misk.web.RequestBody import misk.web.RequestContentType import misk.web.RequestHeader +import misk.web.Response import misk.web.ResponseContentType import misk.web.mediatype.MediaTypes import org.openapitools.server.api.model.ModelApiResponse @@ -44,7 +45,8 @@ class PetApiAction @Inject constructor( @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0) @Suppress("unused") fun addPet( - @Valid @RequestBody pet: Pet): Pet { + @Valid @RequestBody pet: Pet + ): Pet { TODO() } @@ -54,7 +56,8 @@ class PetApiAction @Inject constructor( @Suppress("unused") fun deletePet( @PathParam("petId") petId: kotlin.Long, - @RequestHeader(value = "api_key") apiKey: kotlin.String?) { + @RequestHeader(value = "api_key") apiKey: kotlin.String? + ): Response { TODO() } @@ -64,7 +67,8 @@ class PetApiAction @Inject constructor( @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0) @Suppress("unused") fun findPetsByStatus( - @QueryParam(value = "status") status: kotlin.Array): kotlin.Array { + @QueryParam(value = "status") status: kotlin.collections.List + ): kotlin.collections.List { TODO() } @@ -74,7 +78,8 @@ class PetApiAction @Inject constructor( @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0) @Suppress("unused") fun findPetsByTags( - @QueryParam(value = "tags") tags: kotlin.Array): kotlin.Array { + @QueryParam(value = "tags") tags: kotlin.collections.List + ): kotlin.collections.List { TODO() } @@ -84,7 +89,8 @@ class PetApiAction @Inject constructor( @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0) @Suppress("unused") fun getPetById( - @PathParam("petId") petId: kotlin.Long): Pet { + @PathParam("petId") petId: kotlin.Long + ): Pet { TODO() } @@ -95,7 +101,8 @@ class PetApiAction @Inject constructor( @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0) @Suppress("unused") fun updatePet( - @Valid @RequestBody pet: Pet): Pet { + @Valid @RequestBody pet: Pet + ): Pet { TODO() } @@ -107,7 +114,8 @@ class PetApiAction @Inject constructor( fun updatePetWithForm( @PathParam("petId") petId: kotlin.Long, @QueryParam(value = "name") name: kotlin.String? , - @QueryParam(value = "status") status: kotlin.String? ) { + @QueryParam(value = "status") status: kotlin.String? + ): Response { TODO() } @@ -120,7 +128,8 @@ class PetApiAction @Inject constructor( fun uploadFile( @PathParam("petId") petId: kotlin.Long, @QueryParam(value = "additionalMetadata") additionalMetadata: kotlin.String? , - @Valid file: HttpCall): ModelApiResponse { + @Valid file: HttpCall + ): ModelApiResponse { TODO() } } diff --git a/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/StoreApiAction.kt b/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/StoreApiAction.kt index 55912b1754f1..a9a09ac45943 100644 --- a/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/StoreApiAction.kt +++ b/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/StoreApiAction.kt @@ -25,6 +25,7 @@ import misk.web.QueryParam import misk.web.RequestBody import misk.web.RequestContentType import misk.web.RequestHeader +import misk.web.Response import misk.web.ResponseContentType import misk.web.mediatype.MediaTypes import org.openapitools.server.api.model.Order @@ -41,7 +42,8 @@ class StoreApiAction @Inject constructor( @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0) @Suppress("unused") fun deleteOrder( - @PathParam("orderId") orderId: kotlin.String) { + @PathParam("orderId") orderId: kotlin.String + ): Response { TODO() } @@ -50,7 +52,8 @@ class StoreApiAction @Inject constructor( @ResponseContentType(MediaTypes.APPLICATION_JSON) @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0) @Suppress("unused") - fun getInventory(): kotlin.collections.Map { + fun getInventory( + ): kotlin.collections.Map { TODO() } @@ -60,7 +63,8 @@ class StoreApiAction @Inject constructor( @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0) @Suppress("unused") fun getOrderById( - @Min(1L) @Max(5L) @PathParam("orderId") orderId: kotlin.Long): Order { + @Min(1L) @Max(5L) @PathParam("orderId") orderId: kotlin.Long + ): Order { TODO() } @@ -71,7 +75,8 @@ class StoreApiAction @Inject constructor( @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0) @Suppress("unused") fun placeOrder( - @Valid @RequestBody order: Order): Order { + @Valid @RequestBody order: Order + ): Order { TODO() } } diff --git a/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/UserApiAction.kt b/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/UserApiAction.kt index cc3fe5a0fa5c..5e7ceedae24c 100644 --- a/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/UserApiAction.kt +++ b/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/api/UserApiAction.kt @@ -25,6 +25,7 @@ import misk.web.QueryParam import misk.web.RequestBody import misk.web.RequestContentType import misk.web.RequestHeader +import misk.web.Response import misk.web.ResponseContentType import misk.web.mediatype.MediaTypes import org.openapitools.server.api.model.User @@ -42,7 +43,8 @@ class UserApiAction @Inject constructor( @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0) @Suppress("unused") fun createUser( - @Valid @RequestBody user: User) { + @Valid @RequestBody user: User + ): Response { TODO() } @@ -52,7 +54,8 @@ class UserApiAction @Inject constructor( @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0) @Suppress("unused") fun createUsersWithArrayInput( - @Valid @RequestBody user: kotlin.Array) { + @Valid @RequestBody user: kotlin.collections.List + ): Response { TODO() } @@ -62,7 +65,8 @@ class UserApiAction @Inject constructor( @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0) @Suppress("unused") fun createUsersWithListInput( - @Valid @RequestBody user: kotlin.Array) { + @Valid @RequestBody user: kotlin.collections.List + ): Response { TODO() } @@ -71,7 +75,8 @@ class UserApiAction @Inject constructor( @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0) @Suppress("unused") fun deleteUser( - @PathParam("username") username: kotlin.String) { + @PathParam("username") username: kotlin.String + ): Response { TODO() } @@ -81,7 +86,8 @@ class UserApiAction @Inject constructor( @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0) @Suppress("unused") fun getUserByName( - @PathParam("username") username: kotlin.String): User { + @PathParam("username") username: kotlin.String + ): User { TODO() } @@ -92,7 +98,8 @@ class UserApiAction @Inject constructor( @Suppress("unused") fun loginUser( @QueryParam(value = "username") username: kotlin.String, - @QueryParam(value = "password") password: kotlin.String): kotlin.String { + @QueryParam(value = "password") password: kotlin.String + ): kotlin.String { TODO() } @@ -100,7 +107,8 @@ class UserApiAction @Inject constructor( @Description("Logs out current logged in user session") @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0) @Suppress("unused") - fun logoutUser() { + fun logoutUser( + ): Response { TODO() } @@ -111,7 +119,8 @@ class UserApiAction @Inject constructor( @Suppress("unused") fun updateUser( @PathParam("username") username: kotlin.String, - @Valid @RequestBody user: User) { + @Valid @RequestBody user: User + ): Response { TODO() } } diff --git a/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/model/Pet.kt b/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/model/Pet.kt index 0011e60785e4..a48be4bbf406 100644 --- a/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/model/Pet.kt +++ b/samples/server/petstore/kotlin-misk-config/src/main/kotlin/org/openapitools/server/api/model/Pet.kt @@ -7,10 +7,10 @@ import com.squareup.moshi.JsonClass @JsonClass(generateAdapter = true) data class Pet( val name: kotlin.String, - val photoUrls: kotlin.Array, + val photoUrls: kotlin.collections.List, val id: kotlin.Long? = null, val category: Category? = null, - val tags: kotlin.Array? = null, + val tags: kotlin.collections.List? = null, /** pet status in the store */ val status: kotlin.String? = null ) diff --git a/samples/server/petstore/kotlin-misk-config/src/test/kotlin/org/openapitools/server/api/api/PetApiTest.kt b/samples/server/petstore/kotlin-misk-config/src/test/kotlin/org/openapitools/server/api/api/PetApiTest.kt index cabdd730fe75..c874c99576d7 100644 --- a/samples/server/petstore/kotlin-misk-config/src/test/kotlin/org/openapitools/server/api/api/PetApiTest.kt +++ b/samples/server/petstore/kotlin-misk-config/src/test/kotlin/org/openapitools/server/api/api/PetApiTest.kt @@ -47,7 +47,7 @@ internal class PetApiTest { @Test fun `should handle findPetsByStatus`() { val status = TODO() - val response: kotlin.Array = petApi.findPetsByStatus(status) + val response: kotlin.collections.List = petApi.findPetsByStatus(status) } /** @@ -56,7 +56,7 @@ internal class PetApiTest { @Test fun `should handle findPetsByTags`() { val tags = TODO() - val response: kotlin.Array = petApi.findPetsByTags(tags) + val response: kotlin.collections.List = petApi.findPetsByTags(tags) } /** diff --git a/samples/server/petstore/kotlin-misk/docs/Pet.md b/samples/server/petstore/kotlin-misk/docs/Pet.md index e60adf1fc22f..da70fca06e65 100644 --- a/samples/server/petstore/kotlin-misk/docs/Pet.md +++ b/samples/server/petstore/kotlin-misk/docs/Pet.md @@ -5,10 +5,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **kotlin.String** | | -**photoUrls** | **kotlin.Array<kotlin.String>** | | +**photoUrls** | **kotlin.collections.List<kotlin.String>** | | **id** | **kotlin.Long** | | [optional] **category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional] +**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] **status** | [**inline**](#Status) | pet status in the store | [optional] diff --git a/samples/server/petstore/kotlin-misk/docs/PetApi.md b/samples/server/petstore/kotlin-misk/docs/PetApi.md index c12d3668388c..99dbe788edb0 100644 --- a/samples/server/petstore/kotlin-misk/docs/PetApi.md +++ b/samples/server/petstore/kotlin-misk/docs/PetApi.md @@ -111,7 +111,7 @@ null (empty response body) # **findPetsByStatus** -> kotlin.Array<Pet> findPetsByStatus(status) +> kotlin.collections.List<Pet> findPetsByStatus(status) Finds Pets by status @@ -124,9 +124,9 @@ Multiple status values can be provided with comma separated strings //import org.openapitools.server.api.model.* val apiInstance = PetApi() -val status : kotlin.Array = // kotlin.Array | Status values that need to be considered for filter +val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter try { - val result : kotlin.Array = apiInstance.findPetsByStatus(status) + val result : kotlin.collections.List = apiInstance.findPetsByStatus(status) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#findPetsByStatus") @@ -141,11 +141,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] ### Return type -[**kotlin.Array<Pet>**](Pet.md) +[**kotlin.collections.List<Pet>**](Pet.md) ### Authorization @@ -158,7 +158,7 @@ Name | Type | Description | Notes # **findPetsByTags** -> kotlin.Array<Pet> findPetsByTags(tags) +> kotlin.collections.List<Pet> findPetsByTags(tags) Finds Pets by tags @@ -171,9 +171,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 //import org.openapitools.server.api.model.* val apiInstance = PetApi() -val tags : kotlin.Array = // kotlin.Array | Tags to filter by +val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by try { - val result : kotlin.Array = apiInstance.findPetsByTags(tags) + val result : kotlin.collections.List = apiInstance.findPetsByTags(tags) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#findPetsByTags") @@ -188,11 +188,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | + **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | ### Return type -[**kotlin.Array<Pet>**](Pet.md) +[**kotlin.collections.List<Pet>**](Pet.md) ### Authorization diff --git a/samples/server/petstore/kotlin-misk/docs/UserApi.md b/samples/server/petstore/kotlin-misk/docs/UserApi.md index b8f5fca6eea0..ef066d94e9f9 100644 --- a/samples/server/petstore/kotlin-misk/docs/UserApi.md +++ b/samples/server/petstore/kotlin-misk/docs/UserApi.md @@ -75,7 +75,7 @@ Creates list of users with given input array //import org.openapitools.server.api.model.* val apiInstance = UserApi() -val user : kotlin.Array = // kotlin.Array | List of user object +val user : kotlin.collections.List = // kotlin.collections.List | List of user object try { apiInstance.createUsersWithArrayInput(user) } catch (e: ClientException) { @@ -91,7 +91,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](User.md)| List of user object | + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | ### Return type @@ -121,7 +121,7 @@ Creates list of users with given input array //import org.openapitools.server.api.model.* val apiInstance = UserApi() -val user : kotlin.Array = // kotlin.Array | List of user object +val user : kotlin.collections.List = // kotlin.collections.List | List of user object try { apiInstance.createUsersWithListInput(user) } catch (e: ClientException) { @@ -137,7 +137,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](User.md)| List of user object | + **user** | [**kotlin.collections.List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt b/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt index 1b1b88cb2654..1a8c806566d5 100644 --- a/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt +++ b/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/api/PetApiAction.kt @@ -25,6 +25,7 @@ import misk.web.QueryParam import misk.web.RequestBody import misk.web.RequestContentType import misk.web.RequestHeader +import misk.web.Response import misk.web.ResponseContentType import misk.web.mediatype.MediaTypes import org.openapitools.server.api.model.ModelApiResponse @@ -43,7 +44,8 @@ class PetApiAction @Inject constructor( @ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON) @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) fun addPet( - @Valid @RequestBody pet: Pet): Pet { + @Valid @RequestBody pet: Pet + ): Pet { TODO() } @@ -52,7 +54,8 @@ class PetApiAction @Inject constructor( @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) fun deletePet( @PathParam("petId") petId: kotlin.Long, - @RequestHeader(value = "api_key") apiKey: kotlin.String?) { + @RequestHeader(value = "api_key") apiKey: kotlin.String? + ): Response { TODO() } @@ -61,7 +64,8 @@ class PetApiAction @Inject constructor( @ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON) @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) fun findPetsByStatus( - @QueryParam(value = "status") status: kotlin.Array): kotlin.Array { + @QueryParam(value = "status") status: kotlin.collections.List + ): kotlin.collections.List { TODO() } @@ -70,7 +74,8 @@ class PetApiAction @Inject constructor( @ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON) @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) fun findPetsByTags( - @QueryParam(value = "tags") tags: kotlin.Array): kotlin.Array { + @QueryParam(value = "tags") tags: kotlin.collections.List + ): kotlin.collections.List { TODO() } @@ -79,7 +84,8 @@ class PetApiAction @Inject constructor( @ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON) @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) fun getPetById( - @PathParam("petId") petId: kotlin.Long): Pet { + @PathParam("petId") petId: kotlin.Long + ): Pet { TODO() } @@ -89,7 +95,8 @@ class PetApiAction @Inject constructor( @ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON) @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) fun updatePet( - @Valid @RequestBody pet: Pet): Pet { + @Valid @RequestBody pet: Pet + ): Pet { TODO() } @@ -100,7 +107,8 @@ class PetApiAction @Inject constructor( fun updatePetWithForm( @PathParam("petId") petId: kotlin.Long, @QueryParam(value = "name") name: kotlin.String? , - @QueryParam(value = "status") status: kotlin.String? ) { + @QueryParam(value = "status") status: kotlin.String? + ): Response { TODO() } @@ -112,7 +120,8 @@ class PetApiAction @Inject constructor( fun uploadFile( @PathParam("petId") petId: kotlin.Long, @QueryParam(value = "additionalMetadata") additionalMetadata: kotlin.String? , - @Valid file: HttpCall): ModelApiResponse { + @Valid file: HttpCall + ): ModelApiResponse { TODO() } } diff --git a/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/api/StoreApiAction.kt b/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/api/StoreApiAction.kt index ae5b91af0c77..c4c83cae9938 100644 --- a/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/api/StoreApiAction.kt +++ b/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/api/StoreApiAction.kt @@ -25,6 +25,7 @@ import misk.web.QueryParam import misk.web.RequestBody import misk.web.RequestContentType import misk.web.RequestHeader +import misk.web.Response import misk.web.ResponseContentType import misk.web.mediatype.MediaTypes import org.openapitools.server.api.model.Order @@ -40,7 +41,8 @@ class StoreApiAction @Inject constructor( @Description("Delete purchase order by ID") @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) fun deleteOrder( - @PathParam("orderId") orderId: kotlin.String) { + @PathParam("orderId") orderId: kotlin.String + ): Response { TODO() } @@ -48,7 +50,8 @@ class StoreApiAction @Inject constructor( @Description("Returns pet inventories by status") @ResponseContentType(MediaTypes.APPLICATION_JSON) @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) - fun getInventory(): kotlin.collections.Map { + fun getInventory( + ): kotlin.collections.Map { TODO() } @@ -57,7 +60,8 @@ class StoreApiAction @Inject constructor( @ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON) @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) fun getOrderById( - @Min(1L) @Max(5L) @PathParam("orderId") orderId: kotlin.Long): Order { + @Min(1L) @Max(5L) @PathParam("orderId") orderId: kotlin.Long + ): Order { TODO() } @@ -67,7 +71,8 @@ class StoreApiAction @Inject constructor( @ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON) @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) fun placeOrder( - @Valid @RequestBody order: Order): Order { + @Valid @RequestBody order: Order + ): Order { TODO() } } diff --git a/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/api/UserApiAction.kt b/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/api/UserApiAction.kt index 1107661204f5..153a0e6c5eb1 100644 --- a/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/api/UserApiAction.kt +++ b/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/api/UserApiAction.kt @@ -25,6 +25,7 @@ import misk.web.QueryParam import misk.web.RequestBody import misk.web.RequestContentType import misk.web.RequestHeader +import misk.web.Response import misk.web.ResponseContentType import misk.web.mediatype.MediaTypes import org.openapitools.server.api.model.User @@ -41,7 +42,8 @@ class UserApiAction @Inject constructor( @RequestContentType(MediaTypes.APPLICATION_JSON) @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) fun createUser( - @Valid @RequestBody user: User) { + @Valid @RequestBody user: User + ): Response { TODO() } @@ -50,7 +52,8 @@ class UserApiAction @Inject constructor( @RequestContentType(MediaTypes.APPLICATION_JSON) @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) fun createUsersWithArrayInput( - @Valid @RequestBody user: kotlin.Array) { + @Valid @RequestBody user: kotlin.collections.List + ): Response { TODO() } @@ -59,7 +62,8 @@ class UserApiAction @Inject constructor( @RequestContentType(MediaTypes.APPLICATION_JSON) @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) fun createUsersWithListInput( - @Valid @RequestBody user: kotlin.Array) { + @Valid @RequestBody user: kotlin.collections.List + ): Response { TODO() } @@ -67,7 +71,8 @@ class UserApiAction @Inject constructor( @Description("Delete user") @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) fun deleteUser( - @PathParam("username") username: kotlin.String) { + @PathParam("username") username: kotlin.String + ): Response { TODO() } @@ -76,7 +81,8 @@ class UserApiAction @Inject constructor( @ResponseContentType(MediaTypes.APPLICATION_XML, MediaTypes.APPLICATION_JSON) @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) fun getUserByName( - @PathParam("username") username: kotlin.String): User { + @PathParam("username") username: kotlin.String + ): User { TODO() } @@ -86,14 +92,16 @@ class UserApiAction @Inject constructor( @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) fun loginUser( @QueryParam(value = "username") username: kotlin.String, - @QueryParam(value = "password") password: kotlin.String): kotlin.String { + @QueryParam(value = "password") password: kotlin.String + ): kotlin.String { TODO() } @Get("/user/logout") @Description("Logs out current logged in user session") @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) - fun logoutUser() { + fun logoutUser( + ): Response { TODO() } @@ -103,7 +111,8 @@ class UserApiAction @Inject constructor( @LogRequestResponse(bodySampling = 1.0, errorBodySampling = 1.0) fun updateUser( @PathParam("username") username: kotlin.String, - @Valid @RequestBody user: User) { + @Valid @RequestBody user: User + ): Response { TODO() } } diff --git a/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/model/Pet.kt b/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/model/Pet.kt index 0011e60785e4..a48be4bbf406 100644 --- a/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/model/Pet.kt +++ b/samples/server/petstore/kotlin-misk/src/main/kotlin/org/openapitools/server/api/model/Pet.kt @@ -7,10 +7,10 @@ import com.squareup.moshi.JsonClass @JsonClass(generateAdapter = true) data class Pet( val name: kotlin.String, - val photoUrls: kotlin.Array, + val photoUrls: kotlin.collections.List, val id: kotlin.Long? = null, val category: Category? = null, - val tags: kotlin.Array? = null, + val tags: kotlin.collections.List? = null, /** pet status in the store */ val status: kotlin.String? = null ) diff --git a/samples/server/petstore/kotlin-misk/src/test/kotlin/org/openapitools/server/api/api/PetApiTest.kt b/samples/server/petstore/kotlin-misk/src/test/kotlin/org/openapitools/server/api/api/PetApiTest.kt index 445451d8b053..a932999b1668 100644 --- a/samples/server/petstore/kotlin-misk/src/test/kotlin/org/openapitools/server/api/api/PetApiTest.kt +++ b/samples/server/petstore/kotlin-misk/src/test/kotlin/org/openapitools/server/api/api/PetApiTest.kt @@ -47,7 +47,7 @@ internal class PetApiTest { @Test fun `should handle findPetsByStatus`() { val status = TODO() - val response: kotlin.Array = petApi.findPetsByStatus(status) + val response: kotlin.collections.List = petApi.findPetsByStatus(status) } /** @@ -56,7 +56,7 @@ internal class PetApiTest { @Test fun `should handle findPetsByTags`() { val tags = TODO() - val response: kotlin.Array = petApi.findPetsByTags(tags) + val response: kotlin.collections.List = petApi.findPetsByTags(tags) } /**