Hello, everyone!
What is the best way to generate OpenAPI docs basing on Ktor routings (already written)?
There`s Ktor OpenAPI Generator (https://github.com/papsign/Ktor-OpenAPI-Generator), but the project seems not very active.
c
CLOVIS
02/17/2023, 5:20 PM
The only active project I know of is the Ktor plugin for IntelliJ, but it has a few limitations (you must have IDEA, and it won't work if you don't write your endpoints exactly as they are in the documentation, you can't generate with utility functions)
I can vouch for https://github.com/bkbnio/kompendium
No intellij plugin needed, and no need to keep your openapi up to date manually since the api is inferred on runtime.
a
aazavoykin
02/20/2023, 8:23 AM
Thank you! I will try it too
@ESchouten It seems that with Kompendium we should describe our API with some DSL (and I will get schema based on these descriptions on some endpoint on runtime), but what I need is to generate schema based on existing routes (as json at some endpoint in runtime or as a file generated by some Gradle task). Do I miss something in Kompendium`s docs?