https://kotlinlang.org logo
Title
h

Hank

07/17/2020, 2:40 PM
How can I use Swagger UI with Ktor, any reference?
n

nschulzke

07/17/2020, 9:32 PM
Swagger UI is generated from an OpenAPI specification, so you'd need to document your API as an OpenAPI spec, then you can generate the Swagger UI for it.
p

pmiklos

07/18/2020, 1:36 AM
I think he meant if you can generate it from the Kotlin sources eg. by placing open api annotations on routes and stuff
❤️ 1
h

Hank

07/18/2020, 1:55 AM
Thanks for replying. I've checked the swagger website but I didn't find the solution. Does the swagger not support the Ktor yet officially?
n

nschulzke

07/20/2020, 2:30 PM
If you're looking to generate the API spec from your existing API, try this: https://swagger.io/resources/articles/documenting-apis-with-swagger/#how-to-generate-openapi-from-existing-apis-7 Swagger Inspector should work with any API, regardless of implementation language.
h

Hank

07/23/2020, 12:24 AM
It’s helpful to me. Thanks a lot.