Swagger UI
Library for Ktor applications to serve Swagger UI - visualize and interact with generated OpenAPI specifications.
Features
- Explore and interact with OpenAPI specifications generated by
ktor-openapi
or external specifications - Serve bundled Swagger UI
- Expose multiple "instances" of Swagger UI (e.g. for different OpenAPI specifications)
- All Swagger UI configuration options available
Example
routing {
route("swagger") { //(1)!
swaggerUI("/api.json") { //(2)!
//...(3)
}
}
}
- Specify route to serve Swagger UI at
/swagger
. - Expose Swagger UI using OpenAPI specification at
/api.json
. Path can be relative pointing to specification provided by this application or absolute pointing to an external resource. - Add configuration for this Swagger UI "instance" here.