swaggerUI

fun Route.swaggerUI(path: String, swaggerFile: String, block: SwaggerConfig.() -> Unit = {}): Route(source)

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.

If source is supplied inside the config block, the swaggerFile argument will take precedence.

Report a problem


fun Route.swaggerUI(path: String, apiFile: File, block: SwaggerConfig.() -> Unit = {}): Route(source)

Creates a get endpoint with swaggerUI at path rendered from the apiFile.

If source is supplied inside the config block, the apiFile argument will take precedence.

Report a problem


fun Route.swaggerUI(path: String, apiUrl: String, api: String, block: SwaggerConfig.() -> Unit = {}): Route(source)

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.

If source is supplied inside the config block, the api argument will take precedence.

Report a problem

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.


fun Route.swaggerUI(path: String, block: SwaggerConfig.() -> Unit = {}): Route(source)

Adds a Swagger UI endpoint to the current route.

Report a problem

Parameters

path

The root path where the Swagger UI will be available.

block

Configuration block for customizing the Swagger UI, such as defining the OpenAPI specification source.