openAPI

fun Route.openAPI(path: String, swaggerFile: String = "openapi/documentation.yaml", block: OpenAPIConfig.() -> Unit = {})

Creates a get endpoint at path with documentation rendered from the OpenAPI file.

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.

The documentation is generated using StaticHtml2Codegen by default. It can be customized using config in block. See OpenAPIConfig for more details.