OpenAPIGenStatusPagesInterop

class OpenAPIGenStatusPagesInterop(val api: OpenAPIGen, val statusCfg: StatusPagesConfig)(source)

Wrapper for Status pages that handles exceptions and generates documentation in OpenAPI. This is useful for default error pages.

Constructors

Link copied to clipboard
constructor(api: OpenAPIGen, statusCfg: StatusPagesConfig)

Properties

Link copied to clipboard
Link copied to clipboard
val statusCfg: StatusPagesConfig

Functions

Link copied to clipboard
inline fun <TThrowable : Throwable> exception(status: HttpStatusCode)

Registers a handler for exception type TThrowable and returns a status page

inline fun <TThrowable : Throwable, TResponse> exception(status: HttpStatusCode, example: TResponse? = null, noinline gen: (TThrowable) -> TResponse)

Registers a handler for exception type TThrowable and returns a status page that includes a response body of type TResponse.