Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ public KotlinMiskServerCodegen() {
artifactId = "openapi-kotlin-misk-server";
artifactVersion = apiVersion;

typeMapping.put("File", "Response<ByteString>");

updateOption(CodegenConstants.API_PACKAGE, apiPackage);
updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage);
additionalProperties.put(ROOT_PACKAGE, rootPackage);
Expand Down Expand Up @@ -328,4 +330,4 @@ private static Map<String, String> getMappings() {

return result;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -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}}
Original file line number Diff line number Diff line change
@@ -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}}List<{{/isArray}}{{#isArray}}>{{/isArray}}{{^isArray}}{{^required}}{{/required}}{{/isArray}}{{/isFile}}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
}

Expand All @@ -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()
}

Expand All @@ -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.Array<kotlin.String>
): kotlin.Array<Pet> {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a lot of context of this file

But with the change above from Array -> List https://github.com/OpenAPITools/openapi-generator/pull/21390/files#diff-4c93f665fc6f95375f506f04f625f2cd823f4bf4907425b607124ba893812f73R1

Should this be kotlin.List<Pet> instead

Copy link
Copy Markdown
Author

@andrewwilsonnew andrewwilsonnew Jun 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was late last night. Nice, fixed to kotlin.collections.List

TODO()
}

Expand All @@ -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.Array<kotlin.String>
): kotlin.Array<Pet> {
TODO()
}

Expand All @@ -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()
}

Expand All @@ -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()
}

Expand All @@ -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()
}

Expand All @@ -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()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
}

Expand All @@ -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()
}

Expand All @@ -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()
}

Expand All @@ -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()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
}

Expand All @@ -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.Array<User>
): Response<Unit> {
TODO()
}

Expand All @@ -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.Array<User>
): Response<Unit> {
TODO()
}

Expand All @@ -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()
}

Expand All @@ -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()
}

Expand All @@ -92,15 +98,17 @@ 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()
}

@Get("samplePrefix/user/logout")
@Description("Logs out current logged in user session")
@LogRequestResponse(bodySampling = 1.0, errorBodySampling = 2.0)
@Suppress("unused")
fun logoutUser() {
fun logoutUser(
): Response<Unit> {
TODO()
}

Expand All @@ -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()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
}

Expand All @@ -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()
}

Expand All @@ -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.Array<kotlin.String>
): kotlin.Array<Pet> {
TODO()
}

Expand All @@ -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.Array<kotlin.String>
): kotlin.Array<Pet> {
TODO()
}

Expand All @@ -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()
}

Expand All @@ -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()
}

Expand All @@ -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()
}

Expand All @@ -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()
}
}
Loading
Loading