openApiEndpoint

fun Route.openApiEndpoint(path: String): Route

Adds a get(path) endpoint that will return the OpenAPI document for this API.

Available query parameters are:

  • version: the version of the OpenAPI document to return (supported values: 3.0 (default), 3.1)

  • format: the format of the OpenAPI document to return (supported values: json (default), yaml)

You must install the TegralOpenApiKtor feature and describe your endpoints for this to work.