Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard

A lambda for creating OperationBuilders. This is useful if you need to heavily customize the operation creation process.

This lambda receives:

Link copied to clipboard
typealias PathDescriptionHook = PathDsl.() -> Unit
Link copied to clipboard

A Ktor plugin that adds a Tegral OpenAPI DSL integration to the Ktor application, including:

Properties

Link copied to clipboard
val Application.openApi: TegralOpenApiKtor

Retrieve the TegralOpenApiKtor plugin from this application.

Functions

Link copied to clipboard
fun Application.describe(description: RootDsl.() -> Unit)

Specify additional information about the API via the RootDsl.

infix fun Route.describe(description: OperationDsl.() -> Unit): Route

Adds an OpenAPI operation description to this route.

Link copied to clipboard
fun Route.describeSubroutes(hook: OperationDsl.() -> Unit)

Adds a hook to the given route. All following descriptions on endpoints that are sub-endpoints of this route will have the given hook applied to their description.

Link copied to clipboard
infix fun Route.describeWith(builder: OperationBuilderWithHooks): Route

Adds an OpenAPI operation description to this route using a prepared builder.

Link copied to clipboard

Retrieve the TegralOpenApiKtor plugin instance from this application, or print a warning message once and return null.

Link copied to clipboard
fun Route.openApiEndpoint(path: String): Route

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