https://kotlinlang.org logo
#ktor
Title
# ktor
s

suresh

04/18/2022, 10:55 PM
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

Landry Norris

04/19/2022, 3:01 PM
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

Marcel Bochtler

04/19/2022, 3:02 PM
Unfortunately Kompendium does not support Ktor 2.0: https://github.com/bkbnio/kompendium/issues/96
l

Landry Norris

04/19/2022, 3:07 PM
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

Marcel Bochtler

04/19/2022, 3:08 PM
Any idea about what first party solution the author is talking about? I couldn’t find any information.
l

Landry Norris

04/19/2022, 3:08 PM
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 🙂
11 Views