Hi, planning to use Ktor 2.0 for a new API backend...
# ktor
s
Hi, planning to use Ktor 2.0 for a new API backend project and would like to use auto generated OpenAPI yaml and hosted UI. Since there is no official support in 2.0, wondering how you folks are achieving this? Would like to have something like in micronaut (compile time generated yaml from route data https://micronaut-projects.github.io/micronaut-openapi/latest/guide/index.html#openApiViews)
l
I used https://github.com/bkbnio/kompendium in the past, and was happy with it. It generates the Swagger json and automatically hosts the endpoint.
đź‘Ť 1
m
Unfortunately Kompendium does not support Ktor 2.0: https://github.com/bkbnio/kompendium/issues/96
l
It sounds like the author’s not maintaining the library for 2.0 because Jetbrains is working on a first party solution. I hope the Jetbrains solution is just as good when it’s released.
m
Any idea about what first party solution the author is talking about? I couldn’t find any information.
l
Their last blog post mentioned that they’re starting work on it now, but I was under the impression that it was targeted for Ktor 3.0, like Database support.
Hopefully their solution will use compile time generation instead of using kotlin-reflection, which I had lot of trouble integrating with GraalVM native image 🙂