Hello, everyone! What is the best way to generate ...
# server
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.
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)
Thank you, it`s an option!
I believe they added support for openapi in ktor v2.2 -> https://ktor.io/docs/openapi.html
@Dariusz Kuc that's the plugin I mentioned.
👍 1
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.
🔥 1
🙏 1
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?
It looks promising, but also quite verbose 🤔