Hi. I am trying to generate the OpenAPI documentation using the built-in tool in IntelliJ Ultimate. The issue I'm facing is that the endpoint and request object are not added at all into the generated OpenAPI output file when I specify the actual request types, such as for example
post<TestMessageRequest>
, like in the following example:
@Serializable
data class TestMessageRequest(val message: String, val status: Int)
fun Route.testMessageRoute() {
post<TestMessageRequest>("/message") { request ->
println(request)
call.respond(HttpStatusCode.OK)
}
}
The endpoint only gets included in the OpenAPI file if I remove
<TestMessageRequest>
.
On the other hand, type objects are included in the file when the endpoints are instead
get
calls returning them. It seems the issue affects only
post
calls.