I see that Ktor has a generator that reads OpenAPI...
# ktor
c
I see that Ktor has a generator that reads OpenAPI, is there a way to do the opposite (generate an OpenAPI file from my route declarations)?
j
I've used https://github.com/nielsfalk/ktor-swagger in one project and seems to work well.... though note that it isn't being maintained
Maybe could be integrated in to ktor?
r
Here is the ticket to track https://youtrack.jetbrains.com/issue/KTOR-774. We are investigating different ways on how to implement it using idiomatic kotlin and ktor style. No estimates yet.
👍 3
c
Thanks, I hope it makes it into Ktor one day 👍
j
Or you can create a common multiplatform library between backend and frontend with DTO's and paths and whatnot, which you can call upon from code 🙂 Then there is no need for api generation
c
Not all projects allow me to choose the tech for backend and frontend. It's already pretty good that I managed to get Ktor/Kotlin at all.
👍 1
c
I implement OpenAPI generator myself in my ktor-example side project. but it is not a independent library https://github.com/csieflyman/ktor-example
g
dunno if it helps ^ (for swagger generation)