swaggerUI
fun Route.swaggerUI(path: String, swaggerFile: String = "openapi/documentation.yaml", block: SwaggerConfig.() -> Unit = {})
Creates a get
endpoint with SwaggerUI at path rendered from the OpenAPI file located at swaggerFile.
This method tries to lookup swaggerFile in the resources first, and if it's not found, it will try to read it from the file system using java.io.File.
Creates a get
endpoint with SwaggerUI at path rendered from the apiFile.
fun Route.swaggerUI(path: String, apiUrl: String, api: String, block: SwaggerConfig.() -> Unit = {})
Configures a route to serve Swagger UI and its corresponding API specification.
This function sets up a given path to serve a Swagger UI interface based on the provided API specification.
Parameters
path
The base path where the Swagger UI will be accessible.
apiUrl
The relative URL for the Swagger API JSON file.
api
The content of the Swagger API specification.
block
A configuration block to apply additional Swagger configuration settings.