Fix MiskKotlin OpenApiGenerator types (#21390)

* first pass

* fixup up Array -> List

* fixup up Array -> List

* File response type

* don't mess returnTypes.mustache
This commit is contained in:
Andrew Wilson
2025-06-06 13:47:39 +01:00
committed by GitHub
parent 89eea742fe
commit 4402d836bb
19 changed files with 137 additions and 85 deletions

View File

@@ -172,6 +172,8 @@ public class KotlinMiskServerCodegen extends AbstractKotlinCodegen implements Be
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 @@ public class KotlinMiskServerCodegen extends AbstractKotlinCodegen implements Be
return result;
}
}
}

View File

@@ -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<Unit>{{/returnType}} {
TODO()
}
{{/operation}}
}
{{/operations}}
{{/operations}}

View File

@@ -1 +1 @@
{{^isFile}}{{{dataType}}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isFile}}{{#isFile}}{{#isArray}}Array<{{/isArray}}{{#isArray}}>{{/isArray}}{{^isArray}}{{^required}}{{/required}}{{/isArray}}{{/isFile}}
{{^isFile}}{{{dataType}}}{{^required}}{{^defaultValue}}?{{/defaultValue}}{{/required}}{{/isFile}}{{#isFile}}{{#isArray}}kotlin.collections.List<{{/isArray}}{{#isArray}}>{{/isArray}}{{^isArray}}{{^required}}{{/required}}{{/isArray}}{{/isFile}}

View File

@@ -5,10 +5,10 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **kotlin.String** | |
**photoUrls** | **kotlin.Array&lt;kotlin.String&gt;** | |
**photoUrls** | **kotlin.collections.List&lt;kotlin.String&gt;** | |
**id** | **kotlin.Long** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
**tags** | [**kotlin.Array&lt;Tag&gt;**](Tag.md) | | [optional]
**tags** | [**kotlin.collections.List&lt;Tag&gt;**](Tag.md) | | [optional]
**status** | [**inline**](#Status) | pet status in the store | [optional]

View File

@@ -111,7 +111,7 @@ null (empty response body)
<a name="findPetsByStatus"></a>
# **findPetsByStatus**
> kotlin.Array&lt;Pet&gt; findPetsByStatus(status)
> kotlin.collections.List&lt;Pet&gt; 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.String> = // kotlin.Array<kotlin.String> | Status values that need to be considered for filter
val status : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Status values that need to be considered for filter
try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByStatus(status)
val result : kotlin.collections.List<Pet> = 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&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
**status** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md)
[**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization
@@ -158,7 +158,7 @@ Name | Type | Description | Notes
<a name="findPetsByTags"></a>
# **findPetsByTags**
> kotlin.Array&lt;Pet&gt; findPetsByTags(tags)
> kotlin.collections.List&lt;Pet&gt; 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.String> = // kotlin.Array<kotlin.String> | Tags to filter by
val tags : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Tags to filter by
try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByTags(tags)
val result : kotlin.collections.List<Pet> = 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&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
**tags** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md)
[**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization

View File

@@ -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<User> = // kotlin.Array<User> | List of user object
val user : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try {
apiInstance.createUsersWithArrayInput(user)
} catch (e: ClientException) {
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object |
**user** | [**kotlin.collections.List&lt;User&gt;**](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<User> = // kotlin.Array<User> | List of user object
val user : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try {
apiInstance.createUsersWithListInput(user)
} catch (e: ClientException) {
@@ -137,7 +137,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object |
**user** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type

View File

@@ -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<Unit> {
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.String>): kotlin.Array<Pet> {
@QueryParam(value = "status") status: kotlin.collections.List<kotlin.String>
): kotlin.collections.List<Pet> {
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.String>): kotlin.Array<Pet> {
@QueryParam(value = "tags") tags: kotlin.collections.List<kotlin.String>
): kotlin.collections.List<Pet> {
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<Unit> {
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()
}
}

View File

@@ -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<Unit> {
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<kotlin.String, kotlin.Int> {
fun getInventory(
): kotlin.collections.Map<kotlin.String, kotlin.Int> {
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()
}
}

View File

@@ -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<Unit> {
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<User>) {
@Valid @RequestBody user: kotlin.collections.List<User>
): Response<Unit> {
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<User>) {
@Valid @RequestBody user: kotlin.collections.List<User>
): Response<Unit> {
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<Unit> {
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<Unit> {
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<Unit> {
TODO()
}
}

View File

@@ -7,10 +7,10 @@ import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class Pet(
val name: kotlin.String,
val photoUrls: kotlin.Array<kotlin.String>,
val photoUrls: kotlin.collections.List<kotlin.String>,
val id: kotlin.Long? = null,
val category: Category? = null,
val tags: kotlin.Array<Tag>? = null,
val tags: kotlin.collections.List<Tag>? = null,
/** pet status in the store */
val status: kotlin.String? = null
)

View File

@@ -47,7 +47,7 @@ internal class PetApiTest {
@Test
fun `should handle findPetsByStatus`() {
val status = TODO()
val response: kotlin.Array<Pet> = petApi.findPetsByStatus(status)
val response: kotlin.collections.List<Pet> = petApi.findPetsByStatus(status)
}
/**
@@ -56,7 +56,7 @@ internal class PetApiTest {
@Test
fun `should handle findPetsByTags`() {
val tags = TODO()
val response: kotlin.Array<Pet> = petApi.findPetsByTags(tags)
val response: kotlin.collections.List<Pet> = petApi.findPetsByTags(tags)
}
/**

View File

@@ -5,10 +5,10 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **kotlin.String** | |
**photoUrls** | **kotlin.Array&lt;kotlin.String&gt;** | |
**photoUrls** | **kotlin.collections.List&lt;kotlin.String&gt;** | |
**id** | **kotlin.Long** | | [optional]
**category** | [**Category**](Category.md) | | [optional]
**tags** | [**kotlin.Array&lt;Tag&gt;**](Tag.md) | | [optional]
**tags** | [**kotlin.collections.List&lt;Tag&gt;**](Tag.md) | | [optional]
**status** | [**inline**](#Status) | pet status in the store | [optional]

View File

@@ -111,7 +111,7 @@ null (empty response body)
<a name="findPetsByStatus"></a>
# **findPetsByStatus**
> kotlin.Array&lt;Pet&gt; findPetsByStatus(status)
> kotlin.collections.List&lt;Pet&gt; 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.String> = // kotlin.Array<kotlin.String> | Status values that need to be considered for filter
val status : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Status values that need to be considered for filter
try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByStatus(status)
val result : kotlin.collections.List<Pet> = 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&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
**status** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md)
[**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization
@@ -158,7 +158,7 @@ Name | Type | Description | Notes
<a name="findPetsByTags"></a>
# **findPetsByTags**
> kotlin.Array&lt;Pet&gt; findPetsByTags(tags)
> kotlin.collections.List&lt;Pet&gt; 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.String> = // kotlin.Array<kotlin.String> | Tags to filter by
val tags : kotlin.collections.List<kotlin.String> = // kotlin.collections.List<kotlin.String> | Tags to filter by
try {
val result : kotlin.Array<Pet> = apiInstance.findPetsByTags(tags)
val result : kotlin.collections.List<Pet> = 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&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
**tags** | [**kotlin.collections.List&lt;kotlin.String&gt;**](kotlin.String.md)| Tags to filter by |
### Return type
[**kotlin.Array&lt;Pet&gt;**](Pet.md)
[**kotlin.collections.List&lt;Pet&gt;**](Pet.md)
### Authorization

View File

@@ -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<User> = // kotlin.Array<User> | List of user object
val user : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try {
apiInstance.createUsersWithArrayInput(user)
} catch (e: ClientException) {
@@ -91,7 +91,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object |
**user** | [**kotlin.collections.List&lt;User&gt;**](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<User> = // kotlin.Array<User> | List of user object
val user : kotlin.collections.List<User> = // kotlin.collections.List<User> | List of user object
try {
apiInstance.createUsersWithListInput(user)
} catch (e: ClientException) {
@@ -137,7 +137,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user** | [**kotlin.Array&lt;User&gt;**](User.md)| List of user object |
**user** | [**kotlin.collections.List&lt;User&gt;**](User.md)| List of user object |
### Return type

View File

@@ -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<Unit> {
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.String>): kotlin.Array<Pet> {
@QueryParam(value = "status") status: kotlin.collections.List<kotlin.String>
): kotlin.collections.List<Pet> {
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.String>): kotlin.Array<Pet> {
@QueryParam(value = "tags") tags: kotlin.collections.List<kotlin.String>
): kotlin.collections.List<Pet> {
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<Unit> {
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()
}
}

View File

@@ -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<Unit> {
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<kotlin.String, kotlin.Int> {
fun getInventory(
): kotlin.collections.Map<kotlin.String, kotlin.Int> {
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()
}
}

View File

@@ -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<Unit> {
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<User>) {
@Valid @RequestBody user: kotlin.collections.List<User>
): Response<Unit> {
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<User>) {
@Valid @RequestBody user: kotlin.collections.List<User>
): Response<Unit> {
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<Unit> {
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<Unit> {
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<Unit> {
TODO()
}
}

View File

@@ -7,10 +7,10 @@ import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class Pet(
val name: kotlin.String,
val photoUrls: kotlin.Array<kotlin.String>,
val photoUrls: kotlin.collections.List<kotlin.String>,
val id: kotlin.Long? = null,
val category: Category? = null,
val tags: kotlin.Array<Tag>? = null,
val tags: kotlin.collections.List<Tag>? = null,
/** pet status in the store */
val status: kotlin.String? = null
)

View File

@@ -47,7 +47,7 @@ internal class PetApiTest {
@Test
fun `should handle findPetsByStatus`() {
val status = TODO()
val response: kotlin.Array<Pet> = petApi.findPetsByStatus(status)
val response: kotlin.collections.List<Pet> = petApi.findPetsByStatus(status)
}
/**
@@ -56,7 +56,7 @@ internal class PetApiTest {
@Test
fun `should handle findPetsByTags`() {
val tags = TODO()
val response: kotlin.Array<Pet> = petApi.findPetsByTags(tags)
val response: kotlin.collections.List<Pet> = petApi.findPetsByTags(tags)
}
/**